From: Andy Clement Date: Wed, 27 Sep 2017 21:43:04 +0000 (-0700) Subject: Ensure version of generated class is correct X-Git-Tag: V1_9_0_RC3~2^2~52 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7020be7deec5f90712959f0a7f7b9519b5a632c4;p=aspectj.git 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. --- 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