make this static final
This commit is contained in:
parent
8d5a70200f
commit
e2f999b025
|
@ -158,8 +158,7 @@ public final class SSource extends AStatement {
|
|||
if (!functions.isEmpty()) {
|
||||
// write a reference to each function
|
||||
for (SFunction function : functions) {
|
||||
// XXX: Opcodes.ACC_FINAL too
|
||||
writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC,
|
||||
writer.visitField(Opcodes.ACC_FINAL | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC,
|
||||
"handle$" + function.name + "$" + function.parameters.size(),
|
||||
Type.getDescriptor(MethodHandle.class),
|
||||
null,
|
||||
|
|
|
@ -110,8 +110,6 @@ public class FunctionRefTests extends ScriptTestCase {
|
|||
}
|
||||
|
||||
public void testOwnStaticMethodReference() {
|
||||
System.out.println(Debugger.toString("int mycompare(int i, int j) { return j - i; } " +
|
||||
"List l = new ArrayList(); l.add(2); l.add(1); l.sort(this::mycompare); return l.get(0);"));
|
||||
assertEquals(2, exec("int mycompare(int i, int j) { j - i } " +
|
||||
"List l = new ArrayList(); l.add(2); l.add(1); l.sort(this::mycompare); return l.get(0);"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue