Skip to content

Commit c7fce84

Browse files
committed
Minor fix to PyJavaFunction 2-arg call
Drafting error fixed. Some improvements to comments.
1 parent 2ba65e4 commit c7fce84

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

rt4core/src/main/java/uk/co/farowl/vsj4/runtime/PyJavaFunction.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ static PyJavaFunction forStaticMethod(ArgParser ap,
217217
* Construct a {@code PyJavaFunction} from an {@link ArgParser} and
218218
* {@code MethodHandle} for a {@code __new__} method. Although
219219
* {@code __new__} is a static method the {@code PyJavaFunction} we
220-
* produce is bound to the defining {@code PyType self}.
220+
* produce is bound (by setting {@link #self}) to the defining
221+
* {@code PyType self}. The {@link #handle} derived from
222+
* {@code method} is <i>not</i> bound to {@code self}, but
223+
* <i>does</i> add a filter to check the type of the first argument.
221224
*
222225
* @param ap argument parser (provides argument names etc.)
223226
* @param method raw handle to the method defined
@@ -662,9 +665,8 @@ public Object call(Object a0) throws Throwable {
662665
}
663666

664667
@Override
665-
public Object call(Object self, Object a0, Object a1)
666-
throws Throwable {
667-
return handle.invokeExact(self, a0, a1);
668+
public Object call(Object a0, Object a1) throws Throwable {
669+
return handle.invokeExact(a0, a1);
668670
}
669671
}
670672

rt4core/src/main/java/uk/co/farowl/vsj4/runtime/subclass/SubclassSpec.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ protected final SubclassSpec freeze() {
123123
}
124124

125125
// FIXME : (maybe order and) freeze interfaces.
126+
/*
127+
* Order of interfaces is *not* significant in Java and
128+
* treating them as ordered in the MRO is perhaps behind
129+
* certain problems in Jython 2 such as #70 and #391. Yet we
130+
* must (I think) acknowledge them when looking for a
131+
* representation, and probably as bases in Python.
132+
*/
126133

127134
/*
128135
* The specification calls for instances to have a __dict__

0 commit comments

Comments
 (0)