make this static final

This commit is contained in:
Robert Muir 2016-06-11 14:33:48 -04:00
parent 8d5a70200f
commit e2f999b025
2 changed files with 1 additions and 4 deletions

View File

@ -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,

View File

@ -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);"));
}