Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ASM8 to ASM9 #12487

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class FrontendAnnotatedClassVisitor extends ClassVisitor {
* The annotation class name to visit
*/
FrontendAnnotatedClassVisitor(ClassFinder finder, String annotationName) {
super(Opcodes.ASM8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (https://gitlab.ow2.org/asm/asm/-/issues/317854) could probably explain why the OpCodes has to be updated for newer java releases to work properly. Comment by Remi Forax:

I will close this issue as work as intended even if you may think it's surprising, currently ASM ClassReader support Java 11 (and even Java 12) so it recognizes Java 11 new attributes (here NestMembers). But here you are using a ClassVisitor which is configured to only recognize the ASM6 API, thus it fails at runtime with an UnsupportedOperation exception.

super(Opcodes.ASM9);
this.finder = finder;
this.annotationName = annotationName;
if (!annotationDefaults.containsKey(annotationName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final class FrontendClassVisitor extends ClassVisitor {

private final class FrontendMethodVisitor extends MethodVisitor {
public FrontendMethodVisitor() {
super(Opcodes.ASM8);
super(Opcodes.ASM9);
}

// We are interested in the new instances created inside the method
Expand Down Expand Up @@ -143,7 +143,7 @@ public void visitInvokeDynamicInsn(String name, String descriptor,
*/
FrontendClassVisitor(String className, EndPointData endPoint,
boolean themeScope) { // NOSONAR
super(Opcodes.ASM8);
super(Opcodes.ASM9);
this.className = className;
this.endPoint = endPoint;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
abstract class RepeatedAnnotationVisitor extends AnnotationVisitor {
RepeatedAnnotationVisitor() {
super(Opcodes.ASM8);
super(Opcodes.ASM9);
}

@Override
Expand Down