Generate compatible bytecode
Generated filter expressions contain an invocation to a default
interface method. These were added to Java 8, so it's technically
incorrect to generate Java 7 bytecode with references to default
interface methods.
Java 9 has stricter bytecode validation and fails in this case.
@@ -33,7 +33,7 @@ import static com.google.common.collect.Iterables.any;
import static com.google.common.collect.Iterables.concat;
import static java.util.Objects.requireNonNull;
import static org.objectweb.asm.Opcodes.ACC_SUPER;
-import static org.objectweb.asm.Opcodes.V1_7;
+import static org.objectweb.asm.Opcodes.V1_8;
@NotThreadSafe
public class ClassDefinition
@@ -140,7 +140,7 @@ public class ClassDefinition
interfaces[i] = this.interfaces.get(i).getClassName();
}
int accessModifier = toAccessModifier(access);
- visitor.visit(V1_7, isInterface() ? accessModifier : accessModifier | ACC_SUPER, type.getClassName(), signature, superClass.getClassName(), interfaces);
+ visitor.visit(V1_8, isInterface() ? accessModifier : accessModifier | ACC_SUPER, type.getClassName(), signature, superClass.getClassName(), interfaces);
// visit source
if (source != null) {
