From 7020be7deec5f90712959f0a7f7b9519b5a632c4 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 27 Sep 2017 14:43:04 -0700 Subject: Ensure version of generated class is correct Important to ensure we generate it of the right version as it may end up containing code derived from a particular class that needs a be run with a certain level of verifier. In this case if inserting invokestatic targeting a interface method, we need to be using something later than a java 1.2 level class file. --- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 1 + 1 file changed, 1 insertion(+) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 10fdbd05c..6ba22ed97 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -3059,6 +3059,7 @@ public class BcelShadow extends Shadow { LazyClassGen closureClass = new LazyClassGen(closureClassName, superClassName, getEnclosingClass().getFileName(), Modifier.PUBLIC, new String[] {}, getWorld()); + closureClass.setMajorMinor(getEnclosingClass().getMajor(), getEnclosingClass().getMinor()); InstructionFactory fact = new InstructionFactory(closureClass.getConstantPool()); // constructor -- cgit v1.2.3