diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-04 09:31:31 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-04 09:31:31 +0700 |
commit | b86246b87cfeec95e70122ad877d17fbf2e96b08 (patch) | |
tree | e2300c523c2b4438aca358e673db293dad74b3ef /weaver | |
parent | db76c175037c10ce21fc8f7fe681162e31082445 (diff) | |
download | aspectj-b86246b87cfeec95e70122ad877d17fbf2e96b08.tar.gz aspectj-b86246b87cfeec95e70122ad877d17fbf2e96b08.zip |
Use relocated ASM class names in BCException message
Fixes #251.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java index 3feadca38..61ebfb7cf 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java @@ -753,11 +753,14 @@ public final class LazyClassGen { // are required (unless 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 classes (" + AsmDetector.CLASS_READER + ", " + AsmDetector.CLASS_VISITOR + ") " + - "for stackmap generation. Stackmap generation for woven code is required to avoid verify errors " + - "on a Java 1.7 or higher runtime.", AsmDetector.reasonAsmIsMissing - ); + // Fix https://github.com/eclipse-aspectj/aspectj/issues/251, using "replace('Ä', 'Ö')" to avoid non-relocated + // class names to be embedded into the error message during compile time, making it end up in the class constant + // pool unwantedly, as this clashes with post-compile ASM package relocation. + final String errorMessage = "Unable to find ASM classes (" + + AsmDetector.CLASS_READER.replace('Ä', 'Ö') + ", " + AsmDetector.CLASS_VISITOR.replace('Ä', 'Ö') + ") " + + "for stackmap generation. Stackmap generation for woven code is required to avoid verify errors " + + "on a Java 1.7 or higher runtime."; + throw new BCException(errorMessage, AsmDetector.reasonAsmIsMissing); } wovenClassFileData = StackMapAdder.addStackMaps(world, myGen.getClassName(), wovenClassFileData); } |