diff options
author | Andy Clement <aclement@pivotal.io> | 2015-11-25 12:19:12 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2015-11-25 12:19:12 -0800 |
commit | fd1888b49c109ad97d539060b61dd38ceb8d7151 (patch) | |
tree | f8d5b95b4dee8c661f0f1066443368dd5419ed5e /weaver/src/org | |
parent | af8a5a2ac9a64e6f48101d7442024a685450285a (diff) | |
download | aspectj-fd1888b49c109ad97d539060b61dd38ceb8d7151.tar.gz aspectj-fd1888b49c109ad97d539060b61dd38ceb8d7151.zip |
Fix 482990: throw exception if asm missing at > 1.6 java
Diffstat (limited to 'weaver/src/org')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index bc465a2ea..933402248 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -696,9 +696,12 @@ public final class LazyClassGen { public byte[] getJavaClassBytesIncludingReweavable(BcelWorld world) { writeBack(world); byte[] wovenClassFileData = myGen.getJavaClass().getBytes(); - // if is java 6 class file - if (((myGen.getMajor() == Constants.MAJOR_1_6 && world.shouldGenerateStackMaps()) || myGen.getMajor() > Constants.MAJOR_1_6) - && AsmDetector.isAsmAround) { + // At 1.6 stackmaps are optional + // At 1.7 or later stackmaps are required (if not turning off the verifier) + if ((myGen.getMajor() == Constants.MAJOR_1_6 && world.shouldGenerateStackMaps()) || myGen.getMajor() > Constants.MAJOR_1_6) { + if (!AsmDetector.isAsmAround) { + throw new BCException("Unable to find Asm for stackmap generation (Looking for 'aj.org.objectweb.asm.ClassReader'). Stackmap generation for woven code is required to avoid verify errors on a Java 1.7 or higher runtime"); + }; wovenClassFileData = StackMapAdder.addStackMaps(world, wovenClassFileData); } |