From cb7d8cfc0737cdd3eba28cad135fa0ebb7715680 Mon Sep 17 00:00:00 2001 From: Eric Bruneton Date: Thu, 6 Sep 2018 21:04:57 +0200 Subject: [PATCH 1/3] Prepare for the next version, 7.0-beta. --- .../asm/tree/analysis/BasicInterpreter.java | 2 +- .../asm/tree/analysis/BasicVerifier.java | 2 +- .../asm/tree/analysis/Interpreter.java | 4 +- .../asm/tree/analysis/SimpleVerifier.java | 2 +- .../asm/tree/analysis/SourceInterpreter.java | 2 +- .../tree/analysis/BasicInterpreterTest.java | 2 +- .../asm/tree/analysis/SimpleVerifierTest.java | 5 +- .../objectweb/asm/commons/AdviceAdapter.java | 3 +- .../asm/commons/AnalyzerAdapter.java | 5 +- .../asm/commons/AnnotationRemapper.java | 2 +- .../objectweb/asm/commons/ClassRemapper.java | 12 ++--- .../asm/commons/CodeSizeEvaluator.java | 2 +- .../objectweb/asm/commons/FieldRemapper.java | 2 +- .../asm/commons/GeneratorAdapter.java | 5 +- .../asm/commons/InstructionAdapter.java | 7 ++- .../asm/commons/JSRInlinerAdapter.java | 5 +- .../asm/commons/LocalVariablesSorter.java | 5 +- .../objectweb/asm/commons/MethodRemapper.java | 2 +- .../objectweb/asm/commons/ModuleRemapper.java | 2 +- .../asm/commons/SerialVersionUIDAdder.java | 5 +- .../asm/commons/SignatureRemapper.java | 2 +- .../asm/commons/StaticInitMerger.java | 2 +- .../asm/commons/TryCatchBlockSorter.java | 2 +- .../asm/commons/AdviceAdapterTest.java | 4 +- .../asm/commons/AnalyzerAdapterTest.java | 2 +- .../asm/commons/GeneratorAdapterTest.java | 6 +-- .../asm/commons/LocalVariablesSorterTest.java | 2 +- .../commons/ModuleHashesAttributeTest.java | 2 +- .../ModuleResolutionAttributeTest.java | 2 +- .../commons/ModuleTargetAttributeTest.java | 2 +- .../commons/SerialVersionUIDAdderTest.java | 4 +- .../objectweb/asm/tree/AnnotationNode.java | 9 ++-- .../org/objectweb/asm/tree/ClassNode.java | 48 +++++++---------- .../org/objectweb/asm/tree/FieldNode.java | 4 +- .../asm/tree/LocalVariableAnnotationNode.java | 5 +- .../org/objectweb/asm/tree/MethodNode.java | 14 +++-- .../org/objectweb/asm/tree/ModuleNode.java | 4 +- .../asm/tree/TypeAnnotationNode.java | 5 +- .../org/objectweb/asm/tree/ClassNodeTest.java | 11 ++-- .../org/objectweb/asm/tree/InsnListTest.java | 2 +- .../java/org/objectweb/asm/util/ASMifier.java | 14 ++--- .../asm/util/CheckAnnotationAdapter.java | 2 +- .../objectweb/asm/util/CheckClassAdapter.java | 18 +++---- .../objectweb/asm/util/CheckFieldAdapter.java | 5 +- .../asm/util/CheckMethodAdapter.java | 10 ++-- .../asm/util/CheckModuleAdapter.java | 5 +- .../asm/util/CheckSignatureAdapter.java | 5 +- .../java/org/objectweb/asm/util/Printer.java | 33 ++++-------- .../org/objectweb/asm/util/Textifier.java | 9 ++-- .../asm/util/TraceAnnotationVisitor.java | 2 +- .../objectweb/asm/util/TraceClassVisitor.java | 14 ++--- .../objectweb/asm/util/TraceFieldVisitor.java | 2 +- .../asm/util/TraceMethodVisitor.java | 2 +- .../asm/util/TraceModuleVisitor.java | 2 +- .../asm/util/TraceSignatureVisitor.java | 4 +- .../asm/util/CheckMethodAdapterTest.java | 2 +- .../org/objectweb/asm/util/PrinterTest.java | 2 +- .../org/objectweb/asm/AnnotationVisitor.java | 13 ++--- .../org/objectweb/asm/AnnotationWriter.java | 2 +- .../java/org/objectweb/asm/ClassReader.java | 4 +- .../java/org/objectweb/asm/ClassVisitor.java | 54 ++++++++----------- .../java/org/objectweb/asm/ClassWriter.java | 6 +-- .../org/objectweb/asm/ConstantDynamic.java | 2 - .../java/org/objectweb/asm/FieldVisitor.java | 13 ++--- .../java/org/objectweb/asm/FieldWriter.java | 2 +- .../java/org/objectweb/asm/MethodVisitor.java | 15 ++---- .../java/org/objectweb/asm/MethodWriter.java | 2 +- .../java/org/objectweb/asm/ModuleVisitor.java | 8 +-- .../java/org/objectweb/asm/ModuleWriter.java | 2 +- .../main/java/org/objectweb/asm/Opcodes.java | 17 ++---- .../asm/signature/SignatureVisitor.java | 10 ++-- .../asm/signature/SignatureWriter.java | 2 +- .../org/objectweb/asm/ClassReaderTest.java | 17 +++--- .../org/objectweb/asm/ClassVisitorTest.java | 10 ++-- .../org/objectweb/asm/ClassWriterTest.java | 2 +- .../java/org/objectweb/asm/ConstantsTest.java | 4 +- .../asm/signature/SignatureReaderTest.java | 2 +- .../asm/benchmarks/TypeBenchmark.java | 2 +- build.gradle | 2 +- .../org/objectweb/asm/tools/Retrofitter.java | 2 +- 80 files changed, 220 insertions(+), 312 deletions(-) diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java index a4d4cf5be..65c25e7bf 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java @@ -72,7 +72,7 @@ public class BasicInterpreter extends Interpreter implements Opcodes * * @param api the ASM API version supported by this interpreter. Must be one of {@link * org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. */ protected BasicInterpreter(final int api) { super(api); diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java index 850c3de6a..00027b32b 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java @@ -58,7 +58,7 @@ public class BasicVerifier extends BasicInterpreter { * * @param api the ASM API version supported by this interpreter. Must be one of {@link * org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. */ protected BasicVerifier(final int api) { super(api); diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/Interpreter.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/Interpreter.java index eb8d1bb39..4e9a65e1b 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/Interpreter.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/Interpreter.java @@ -47,7 +47,7 @@ public abstract class Interpreter { /** * The ASM API version supported by this interpreter. The value of this field must be one of * {@link org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. */ protected final int api; @@ -56,7 +56,7 @@ public abstract class Interpreter { * * @param api the ASM API version supported by this interpreter. Must be one of {@link * org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. */ protected Interpreter(final int api) { this.api = api; diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java index 430d0f5d4..e542b6fb8 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java @@ -105,7 +105,7 @@ public class SimpleVerifier extends BasicVerifier { * * @param api the ASM API version supported by this verifier. Must be one of {@link * org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. * @param currentClass the type of the class to be verified. * @param currentSuperClass the type of the super class of the class to be verified. * @param currentClassInterfaces the types of the interfaces directly implemented by the class to diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java index 3aeb01b74..bb5467c5e 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java @@ -62,7 +62,7 @@ public class SourceInterpreter extends Interpreter implements Opcod * * @param api the ASM API version supported by this interpreter. Must be one of {@link * org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. */ protected SourceInterpreter(final int api) { super(api); diff --git a/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/BasicInterpreterTest.java b/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/BasicInterpreterTest.java index 45e56a3ca..60dd8f957 100644 --- a/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/BasicInterpreterTest.java +++ b/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/BasicInterpreterTest.java @@ -89,7 +89,7 @@ public class BasicInterpreterTest extends AsmTest { for (MethodNode methodNode : classNode.methods) { Analyzer analyzer = new Analyzer( - new BasicInterpreter(Opcodes.ASM7_EXPERIMENTAL) { + new BasicInterpreter(Opcodes.ASM7) { @Override public BasicValue merge(final BasicValue value1, final BasicValue value2) { return new BasicValue(super.merge(value1, value2).getType()); diff --git a/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/SimpleVerifierTest.java b/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/SimpleVerifierTest.java index 367bbebf2..4ea7e1482 100644 --- a/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/SimpleVerifierTest.java +++ b/asm-analysis/src/test/java/org/objectweb/asm/tree/analysis/SimpleVerifierTest.java @@ -497,8 +497,7 @@ public class SimpleVerifierTest extends AsmTest implements Opcodes { Type baseType = Type.getObjectType("C"); Type superType = Type.getObjectType("D"); Type interfaceType = Type.getObjectType("I"); - new SimpleVerifier( - ASM7_EXPERIMENTAL, baseType, superType, Arrays.asList(interfaceType), false) { + new SimpleVerifier(ASM7, baseType, superType, Arrays.asList(interfaceType), false) { void test() { assertTrue(isAssignableFrom(baseType, baseType)); @@ -516,7 +515,7 @@ public class SimpleVerifierTest extends AsmTest implements Opcodes { } }.test(); - new SimpleVerifier(ASM7_EXPERIMENTAL, interfaceType, null, null, true) { + new SimpleVerifier(ASM7, interfaceType, null, null, true) { void test() { assertTrue(isAssignableFrom(interfaceType, baseType)); diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/AdviceAdapter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/AdviceAdapter.java index dfc81f17d..fac0a08e2 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/AdviceAdapter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/AdviceAdapter.java @@ -97,8 +97,7 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes * Constructs a new {@link AdviceAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param methodVisitor the method visitor to which this adapter delegates calls. * @param access the method's access flags (see {@link Opcodes}). * @param name the method's name. diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/AnalyzerAdapter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/AnalyzerAdapter.java index b16c151f3..7c4eb330a 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/AnalyzerAdapter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/AnalyzerAdapter.java @@ -116,7 +116,7 @@ public class AnalyzerAdapter extends MethodVisitor { final String name, final String descriptor, final MethodVisitor methodVisitor) { - this(Opcodes.ASM6, owner, access, name, descriptor, methodVisitor); + this(Opcodes.ASM7, owner, access, name, descriptor, methodVisitor); if (getClass() != AnalyzerAdapter.class) { throw new IllegalStateException(); } @@ -126,8 +126,7 @@ public class AnalyzerAdapter extends MethodVisitor { * Constructs a new {@link AnalyzerAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param owner the owner's class name. * @param access the method's access flags (see {@link Opcodes}). * @param name the method's name. diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/AnnotationRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/AnnotationRemapper.java index 12523f0a0..fd86b455a 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/AnnotationRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/AnnotationRemapper.java @@ -49,7 +49,7 @@ public class AnnotationRemapper extends AnnotationVisitor { * @param remapper the remapper to use to remap the types in the visited annotation. */ public AnnotationRemapper(final AnnotationVisitor annotationVisitor, final Remapper remapper) { - this(Opcodes.ASM6, annotationVisitor, remapper); + this(Opcodes.ASM7, annotationVisitor, remapper); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/ClassRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/ClassRemapper.java index 18251dc25..ec75a1d17 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/ClassRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/ClassRemapper.java @@ -59,7 +59,7 @@ public class ClassRemapper extends ClassVisitor { * @param remapper the remapper to use to remap the types in the visited class. */ public ClassRemapper(final ClassVisitor classVisitor, final Remapper remapper) { - this(Opcodes.ASM6, classVisitor, remapper); + this(Opcodes.ASM7, classVisitor, remapper); } /** @@ -67,7 +67,7 @@ public class ClassRemapper extends ClassVisitor { * * @param api the ASM API version supported by this remapper. Must be one of {@link * org.objectweb.asm.Opcodes#ASM4}, {@link org.objectweb.asm.Opcodes#ASM5}, {@link - * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7_EXPERIMENTAL}. + * org.objectweb.asm.Opcodes#ASM6} or {@link org.objectweb.asm.Opcodes#ASM7}. * @param classVisitor the class visitor this remapper must deleted to. * @param remapper the remapper to use to remap the types in the visited class. */ @@ -181,13 +181,13 @@ public class ClassRemapper extends ClassVisitor { } @Override - public void visitNestHostExperimental(final String nestHost) { - super.visitNestHostExperimental(remapper.mapType(nestHost)); + public void visitNestHost(final String nestHost) { + super.visitNestHost(remapper.mapType(nestHost)); } @Override - public void visitNestMemberExperimental(final String nestMember) { - super.visitNestMemberExperimental(remapper.mapType(nestMember)); + public void visitNestMember(final String nestMember) { + super.visitNestMember(remapper.mapType(nestMember)); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/CodeSizeEvaluator.java b/asm-commons/src/main/java/org/objectweb/asm/commons/CodeSizeEvaluator.java index 00be4a1ac..796269708 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/CodeSizeEvaluator.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/CodeSizeEvaluator.java @@ -47,7 +47,7 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes { private int maxSize; public CodeSizeEvaluator(final MethodVisitor methodVisitor) { - this(Opcodes.ASM6, methodVisitor); + this(Opcodes.ASM7, methodVisitor); } protected CodeSizeEvaluator(final int api, final MethodVisitor methodVisitor) { diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/FieldRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/FieldRemapper.java index 1ed80186d..fd1936b62 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/FieldRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/FieldRemapper.java @@ -51,7 +51,7 @@ public class FieldRemapper extends FieldVisitor { * @param remapper the remapper to use to remap the types in the visited field. */ public FieldRemapper(final FieldVisitor fieldVisitor, final Remapper remapper) { - this(Opcodes.ASM6, fieldVisitor, remapper); + this(Opcodes.ASM7, fieldVisitor, remapper); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/GeneratorAdapter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/GeneratorAdapter.java index ad0df6c9e..a0f7f389b 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/GeneratorAdapter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/GeneratorAdapter.java @@ -201,7 +201,7 @@ public class GeneratorAdapter extends LocalVariablesSorter { final int access, final String name, final String descriptor) { - this(Opcodes.ASM6, methodVisitor, access, name, descriptor); + this(Opcodes.ASM7, methodVisitor, access, name, descriptor); if (getClass() != GeneratorAdapter.class) { throw new IllegalStateException(); } @@ -211,8 +211,7 @@ public class GeneratorAdapter extends LocalVariablesSorter { * Constructs a new {@link GeneratorAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param methodVisitor the method visitor to which this adapter delegates calls. * @param access the method's access flags (see {@link Opcodes}). * @param name the method's name. diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/InstructionAdapter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/InstructionAdapter.java index d99cb6a35..f0ee5b8c4 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/InstructionAdapter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/InstructionAdapter.java @@ -53,7 +53,7 @@ public class InstructionAdapter extends MethodVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public InstructionAdapter(final MethodVisitor methodVisitor) { - this(Opcodes.ASM6, methodVisitor); + this(Opcodes.ASM7, methodVisitor); if (getClass() != InstructionAdapter.class) { throw new IllegalStateException(); } @@ -63,8 +63,7 @@ public class InstructionAdapter extends MethodVisitor { * Constructs a new {@link InstructionAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param methodVisitor the method visitor to which this adapter delegates calls. */ protected InstructionAdapter(final int api, final MethodVisitor methodVisitor) { @@ -640,7 +639,7 @@ public class InstructionAdapter extends MethodVisitor { || (value instanceof Type && ((Type) value).getSort() == Type.METHOD))) { throw new UnsupportedOperationException(); } - if (api != Opcodes.ASM7_EXPERIMENTAL && value instanceof ConstantDynamic) { + if (api != Opcodes.ASM7 && value instanceof ConstantDynamic) { throw new UnsupportedOperationException(); } if (value instanceof Integer) { diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/JSRInlinerAdapter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/JSRInlinerAdapter.java index e0177cb45..61e114281 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/JSRInlinerAdapter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/JSRInlinerAdapter.java @@ -97,7 +97,7 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes { final String descriptor, final String signature, final String[] exceptions) { - this(Opcodes.ASM6, methodVisitor, access, name, descriptor, signature, exceptions); + this(Opcodes.ASM7, methodVisitor, access, name, descriptor, signature, exceptions); if (getClass() != JSRInlinerAdapter.class) { throw new IllegalStateException(); } @@ -107,8 +107,7 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes { * Constructs a new {@link JSRInlinerAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param methodVisitor the method visitor to send the resulting inlined method code to, or * null. * @param access the method's access flags (see {@link Opcodes}). This parameter also indicates if diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/LocalVariablesSorter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/LocalVariablesSorter.java index 293ced485..b7494e667 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/LocalVariablesSorter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/LocalVariablesSorter.java @@ -81,7 +81,7 @@ public class LocalVariablesSorter extends MethodVisitor { */ public LocalVariablesSorter( final int access, final String descriptor, final MethodVisitor methodVisitor) { - this(Opcodes.ASM6, access, descriptor, methodVisitor); + this(Opcodes.ASM7, access, descriptor, methodVisitor); if (getClass() != LocalVariablesSorter.class) { throw new IllegalStateException(); } @@ -91,8 +91,7 @@ public class LocalVariablesSorter extends MethodVisitor { * Constructs a new {@link LocalVariablesSorter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param access access flags of the adapted method. * @param descriptor the method's descriptor (see {@link Type}). * @param methodVisitor the method visitor to which this adapter delegates calls. diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java index ce0edcff8..35c2b92b7 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java @@ -53,7 +53,7 @@ public class MethodRemapper extends MethodVisitor { * @param remapper the remapper to use to remap the types in the visited method. */ public MethodRemapper(final MethodVisitor methodVisitor, final Remapper remapper) { - this(Opcodes.ASM6, methodVisitor, remapper); + this(Opcodes.ASM7, methodVisitor, remapper); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/ModuleRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/ModuleRemapper.java index 1511ca344..7792bbdbe 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/ModuleRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/ModuleRemapper.java @@ -49,7 +49,7 @@ public class ModuleRemapper extends ModuleVisitor { * @param remapper the remapper to use to remap the types in the visited module. */ public ModuleRemapper(final ModuleVisitor moduleVisitor, final Remapper remapper) { - this(Opcodes.ASM6, moduleVisitor, remapper); + this(Opcodes.ASM7, moduleVisitor, remapper); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/SerialVersionUIDAdder.java b/asm-commons/src/main/java/org/objectweb/asm/commons/SerialVersionUIDAdder.java index 0fe4d4c51..402d9cfb9 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/SerialVersionUIDAdder.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/SerialVersionUIDAdder.java @@ -149,7 +149,7 @@ public class SerialVersionUIDAdder extends ClassVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public SerialVersionUIDAdder(final ClassVisitor classVisitor) { - this(Opcodes.ASM6, classVisitor); + this(Opcodes.ASM7, classVisitor); if (getClass() != SerialVersionUIDAdder.class) { throw new IllegalStateException(); } @@ -159,8 +159,7 @@ public class SerialVersionUIDAdder extends ClassVisitor { * Constructs a new {@link SerialVersionUIDAdder}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param classVisitor a {@link ClassVisitor} to which this visitor will delegate calls. */ protected SerialVersionUIDAdder(final int api, final ClassVisitor classVisitor) { diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/SignatureRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/SignatureRemapper.java index 74a5599ca..2b472e24e 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/SignatureRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/SignatureRemapper.java @@ -53,7 +53,7 @@ public class SignatureRemapper extends SignatureVisitor { * @param remapper the remapper to use to remap the types in the visited signature. */ public SignatureRemapper(final SignatureVisitor signatureVisitor, final Remapper remapper) { - this(Opcodes.ASM6, signatureVisitor, remapper); + this(Opcodes.ASM7, signatureVisitor, remapper); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/StaticInitMerger.java b/asm-commons/src/main/java/org/objectweb/asm/commons/StaticInitMerger.java index b469a93e0..db1da0497 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/StaticInitMerger.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/StaticInitMerger.java @@ -61,7 +61,7 @@ public class StaticInitMerger extends ClassVisitor { * null. */ public StaticInitMerger(final String prefix, final ClassVisitor classVisitor) { - this(Opcodes.ASM6, prefix, classVisitor); + this(Opcodes.ASM7, prefix, classVisitor); } /** diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/TryCatchBlockSorter.java b/asm-commons/src/main/java/org/objectweb/asm/commons/TryCatchBlockSorter.java index df1a274d0..7388bba4b 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/TryCatchBlockSorter.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/TryCatchBlockSorter.java @@ -56,7 +56,7 @@ public class TryCatchBlockSorter extends MethodNode { final String descriptor, final String signature, final String[] exceptions) { - this(Opcodes.ASM6, methodVisitor, access, name, descriptor, signature, exceptions); + this(Opcodes.ASM7, methodVisitor, access, name, descriptor, signature, exceptions); if (getClass() != TryCatchBlockSorter.class) { throw new IllegalStateException(); } diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/AdviceAdapterTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/AdviceAdapterTest.java index 0aa1202ab..b7989ed3e 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/AdviceAdapterTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/AdviceAdapterTest.java @@ -395,7 +395,7 @@ public class AdviceAdapterTest extends AsmTest { methodGenerator = new MethodGenerator( new AdviceAdapter( - Opcodes.ASM6, methodVisitor, Opcodes.ACC_PUBLIC, "", descriptor) { + Opcodes.ASM7, methodVisitor, Opcodes.ACC_PUBLIC, "", descriptor) { @Override protected void onMethodEnter() { @@ -423,7 +423,7 @@ public class AdviceAdapterTest extends AsmTest { private final boolean expectedClass; MethodGenerator(final MethodVisitor methodVisitor, final boolean expectedClass) { - super(Opcodes.ASM6, methodVisitor); + super(Opcodes.ASM7, methodVisitor); this.expectedClass = expectedClass; } diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/AnalyzerAdapterTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/AnalyzerAdapterTest.java index c7b3f1c0a..fd8a5fbd1 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/AnalyzerAdapterTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/AnalyzerAdapterTest.java @@ -150,7 +150,7 @@ public class AnalyzerAdapterTest extends AsmTest { private boolean hasOriginalFrame; AnalyzedFramesInserter(final MethodVisitor methodVisitor) { - super(Opcodes.ASM7_EXPERIMENTAL, methodVisitor); + super(Opcodes.ASM7, methodVisitor); } void setAnalyzerAdapter(final AnalyzerAdapter analyzerAdapter) { diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/GeneratorAdapterTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/GeneratorAdapterTest.java index 654c75e98..028f20a2f 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/GeneratorAdapterTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/GeneratorAdapterTest.java @@ -811,11 +811,7 @@ public class GeneratorAdapterTest { textifier = new Textifier(); generatorAdapter = new GeneratorAdapter( - Opcodes.ASM7_EXPERIMENTAL, - new TraceMethodVisitor(textifier), - access, - name, - descriptor); + Opcodes.ASM7, new TraceMethodVisitor(textifier), access, name, descriptor); } public String push(final boolean value) { diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java index 9f4f99b0b..7916d1a0d 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/LocalVariablesSorterTest.java @@ -140,7 +140,7 @@ public class LocalVariablesSorterTest extends AsmTest { new ClassReader(new FileInputStream("src/test/resources/Issue317586.class")); ClassWriter classWriter = new ClassWriter(0); ClassVisitor classVisitor = - new ClassVisitor(Opcodes.ASM7_EXPERIMENTAL, classWriter) { + new ClassVisitor(Opcodes.ASM7, classWriter) { @Override public MethodVisitor visitMethod( final int access, diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleHashesAttributeTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleHashesAttributeTest.java index 8fd08b540..e2a66f097 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleHashesAttributeTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleHashesAttributeTest.java @@ -60,7 +60,7 @@ public class ModuleHashesAttributeTest { ModuleHashesAttribute moduleHashesAttribute = new ModuleHashesAttribute(); new ClassReader(classWriter.toByteArray()) .accept( - new ClassVisitor(Opcodes.ASM6) { + new ClassVisitor(Opcodes.ASM7) { @Override public void visitAttribute(final Attribute attribute) { diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleResolutionAttributeTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleResolutionAttributeTest.java index 015667395..288715803 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleResolutionAttributeTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleResolutionAttributeTest.java @@ -51,7 +51,7 @@ public class ModuleResolutionAttributeTest { ModuleResolutionAttribute moduleResolutionAttribute = new ModuleResolutionAttribute(); new ClassReader(classWriter.toByteArray()) .accept( - new ClassVisitor(Opcodes.ASM6) { + new ClassVisitor(Opcodes.ASM7) { @Override public void visitAttribute(final Attribute attribute) { diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleTargetAttributeTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleTargetAttributeTest.java index 06423a56c..4ca7de87f 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleTargetAttributeTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/ModuleTargetAttributeTest.java @@ -51,7 +51,7 @@ public class ModuleTargetAttributeTest { ModuleTargetAttribute moduleTargetAttribute = new ModuleTargetAttribute(); new ClassReader(classWriter.toByteArray()) .accept( - new ClassVisitor(Opcodes.ASM6) { + new ClassVisitor(Opcodes.ASM7) { @Override public void visitAttribute(final Attribute attribute) { diff --git a/asm-commons/src/test/java/org/objectweb/asm/commons/SerialVersionUIDAdderTest.java b/asm-commons/src/test/java/org/objectweb/asm/commons/SerialVersionUIDAdderTest.java index 9d6b01cf3..17d6206c3 100644 --- a/asm-commons/src/test/java/org/objectweb/asm/commons/SerialVersionUIDAdderTest.java +++ b/asm-commons/src/test/java/org/objectweb/asm/commons/SerialVersionUIDAdderTest.java @@ -51,7 +51,7 @@ public class SerialVersionUIDAdderTest extends AsmTest { long[] svuid = new long[1]; new ClassReader(className) .accept( - new SerialVersionUIDAdder(Opcodes.ASM6, null) { + new SerialVersionUIDAdder(Opcodes.ASM7, null) { @Override protected long computeSVUID() throws IOException { svuid[0] = super.computeSVUID(); @@ -109,7 +109,7 @@ public class SerialVersionUIDAdderTest extends AsmTest { final PrecompiledClass classParameter, final Api apiParameter) { ClassReader classReader = new ClassReader(classParameter.getBytes()); ClassWriter classWriter = new ClassWriter(0); - classReader.accept(new SerialVersionUIDAdder(Opcodes.ASM7_EXPERIMENTAL, classWriter) {}, 0); + classReader.accept(new SerialVersionUIDAdder(classWriter), 0); if ((classReader.getAccess() & Opcodes.ACC_ENUM) == 0) { assertThatClass(classWriter.toByteArray()).contains("serialVersionUID"); } diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/AnnotationNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/AnnotationNode.java index 6b0e29739..485df785f 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/AnnotationNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/AnnotationNode.java @@ -60,7 +60,7 @@ public class AnnotationNode extends AnnotationVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public AnnotationNode(final String descriptor) { - this(Opcodes.ASM6, descriptor); + this(Opcodes.ASM7, descriptor); if (getClass() != AnnotationNode.class) { throw new IllegalStateException(); } @@ -70,8 +70,7 @@ public class AnnotationNode extends AnnotationVisitor { * Constructs a new {@link AnnotationNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param descriptor the class descriptor of the annotation class. */ public AnnotationNode(final int api, final String descriptor) { @@ -85,7 +84,7 @@ public class AnnotationNode extends AnnotationVisitor { * @param values where the visited values must be stored. */ AnnotationNode(final List values) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); this.values = values; } @@ -174,7 +173,7 @@ public class AnnotationNode extends AnnotationVisitor { * introduced in more recent versions of the ASM API than the given version. * * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5}, - * {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public void check(final int api) { // nothing to do diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/ClassNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/ClassNode.java index 766feabb9..f54225615 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/ClassNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/ClassNode.java @@ -120,19 +120,11 @@ public class ClassNode extends ClassVisitor { /** The inner classes of this class. */ public List innerClasses; - /** - * Experimental, use at your own risk. This field will be renamed when it becomes stable, this - * will break existing code using it. The internal name of the nest host class of this class. - * May be {@literal null}. - */ - public String nestHostClassExperimental; + /** The internal name of the nest host class of this class. May be {@literal null}. */ + public String nestHostClass; - /** - * Experimental, use at your own risk. This field will be renamed when it becomes stable, this - * will break existing code using it. The internal names of the nest members of this class. - * May be {@literal null}. - */ - public List nestMembersExperimental; + /** The internal names of the nest members of this class. May be {@literal null}. */ + public List nestMembers; /** The fields of this class. */ public List fields; @@ -147,7 +139,7 @@ public class ClassNode extends ClassVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public ClassNode() { - this(Opcodes.ASM6); + this(Opcodes.ASM7); if (getClass() != ClassNode.class) { throw new IllegalStateException(); } @@ -157,8 +149,7 @@ public class ClassNode extends ClassVisitor { * Constructs a new {@link ClassNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public ClassNode(final int api) { super(api); @@ -201,8 +192,8 @@ public class ClassNode extends ClassVisitor { } @Override - public void visitNestHostExperimental(final String nestHost) { - this.nestHostClassExperimental = nestHost; + public void visitNestHost(final String nestHost) { + this.nestHostClass = nestHost; } @Override @@ -256,11 +247,11 @@ public class ClassNode extends ClassVisitor { } @Override - public void visitNestMemberExperimental(final String nestMember) { - if (nestMembersExperimental == null) { - nestMembersExperimental = new ArrayList(); + public void visitNestMember(final String nestMember) { + if (nestMembers == null) { + nestMembers = new ArrayList(); } - nestMembersExperimental.add(nestMember); + nestMembers.add(nestMember); } @Override @@ -309,11 +300,10 @@ public class ClassNode extends ClassVisitor { * in more recent versions of the ASM API than the given version. * * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5}, - * {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public void check(final int api) { - if (api < Opcodes.ASM7_EXPERIMENTAL - && (nestHostClassExperimental != null || nestMembersExperimental != null)) { + if (api < Opcodes.ASM7 && (nestHostClass != null || nestMembers != null)) { throw new UnsupportedClassVersionException(); } if (api < Opcodes.ASM6 && module != null) { @@ -375,8 +365,8 @@ public class ClassNode extends ClassVisitor { module.accept(classVisitor); } // Visit the nest host class. - if (nestHostClassExperimental != null) { - classVisitor.visitNestHostExperimental(nestHostClassExperimental); + if (nestHostClass != null) { + classVisitor.visitNestHost(nestHostClass); } // Visit the outer class. if (outerClass != null) { @@ -418,9 +408,9 @@ public class ClassNode extends ClassVisitor { } } // Visit the nest members. - if (nestMembersExperimental != null) { - for (int i = 0, n = nestMembersExperimental.size(); i < n; ++i) { - classVisitor.visitNestMemberExperimental(nestMembersExperimental.get(i)); + if (nestMembers != null) { + for (int i = 0, n = nestMembers.size(); i < n; ++i) { + classVisitor.visitNestMember(nestMembers.get(i)); } } // Visit the inner classes. diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/FieldNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/FieldNode.java index 978ea6d6d..a0b9a4d1c 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/FieldNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/FieldNode.java @@ -100,7 +100,7 @@ public class FieldNode extends FieldVisitor { final String descriptor, final String signature, final Object value) { - this(Opcodes.ASM6, access, name, descriptor, signature, value); + this(Opcodes.ASM7, access, name, descriptor, signature, value); if (getClass() != FieldNode.class) { throw new IllegalStateException(); } @@ -197,7 +197,7 @@ public class FieldNode extends FieldVisitor { * in more recent versions of the ASM API than the given version. * * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5}, - * {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public void check(final int api) { if (api == Opcodes.ASM4) { diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/LocalVariableAnnotationNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/LocalVariableAnnotationNode.java index 42b9826b4..e22033c14 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/LocalVariableAnnotationNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/LocalVariableAnnotationNode.java @@ -84,15 +84,14 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode { final LabelNode[] end, final int[] index, final String descriptor) { - this(Opcodes.ASM6, typeRef, typePath, start, end, index, descriptor); + this(Opcodes.ASM7, typeRef, typePath, start, end, index, descriptor); } /** * Constructs a new {@link LocalVariableAnnotationNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param typeRef a reference to the annotated type. See {@link org.objectweb.asm.TypeReference}. * @param start the fist instructions corresponding to the continuous ranges that make the scope * of this local variable (inclusive). diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/MethodNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/MethodNode.java index a3f080b88..1e45816bf 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/MethodNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/MethodNode.java @@ -155,7 +155,7 @@ public class MethodNode extends MethodVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public MethodNode() { - this(Opcodes.ASM6); + this(Opcodes.ASM7); if (getClass() != MethodNode.class) { throw new IllegalStateException(); } @@ -165,8 +165,7 @@ public class MethodNode extends MethodVisitor { * Constructs an uninitialized {@link MethodNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public MethodNode(final int api) { super(api); @@ -192,7 +191,7 @@ public class MethodNode extends MethodVisitor { final String descriptor, final String signature, final String[] exceptions) { - this(Opcodes.ASM6, access, name, descriptor, signature, exceptions); + this(Opcodes.ASM7, access, name, descriptor, signature, exceptions); if (getClass() != MethodNode.class) { throw new IllegalStateException(); } @@ -202,8 +201,7 @@ public class MethodNode extends MethodVisitor { * Constructs a new {@link MethodNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param access the method's access flags (see {@link Opcodes}). This parameter also indicates if * the method is synthetic and/or deprecated. * @param name the method's name. @@ -606,7 +604,7 @@ public class MethodNode extends MethodVisitor { * in more recent versions of the ASM API than the given version. * * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5}, - * {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public void check(final int api) { if (api == Opcodes.ASM4) { @@ -661,7 +659,7 @@ public class MethodNode extends MethodVisitor { throw new UnsupportedClassVersionException(); } } - if (api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM7) { for (int i = instructions.size() - 1; i >= 0; --i) { AbstractInsnNode insn = instructions.get(i); if (insn instanceof LdcInsnNode) { diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/ModuleNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/ModuleNode.java index 600c9f3c2..16b0fd77a 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/ModuleNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/ModuleNode.java @@ -84,7 +84,7 @@ public class ModuleNode extends ModuleVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public ModuleNode(final String name, final int access, final String version) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); if (getClass() != ModuleNode.class) { throw new IllegalStateException(); } @@ -98,7 +98,7 @@ public class ModuleNode extends ModuleVisitor { * Constructs a {@link ModuleNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link Opcodes#ASM6} - * or {@link Opcodes#ASM7_EXPERIMENTAL}. + * or {@link Opcodes#ASM7}. * @param name the fully qualified name (using dots) of the module. * @param access the module access flags, among {@code ACC_OPEN}, {@code ACC_SYNTHETIC} and {@code * ACC_MANDATED}. diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/TypeAnnotationNode.java b/asm-tree/src/main/java/org/objectweb/asm/tree/TypeAnnotationNode.java index c7d23d03f..8634828ba 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/TypeAnnotationNode.java +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/TypeAnnotationNode.java @@ -59,7 +59,7 @@ public class TypeAnnotationNode extends AnnotationNode { * @throws IllegalStateException If a subclass calls this constructor. */ public TypeAnnotationNode(final int typeRef, final TypePath typePath, final String descriptor) { - this(Opcodes.ASM6, typeRef, typePath, descriptor); + this(Opcodes.ASM7, typeRef, typePath, descriptor); if (getClass() != TypeAnnotationNode.class) { throw new IllegalStateException(); } @@ -69,8 +69,7 @@ public class TypeAnnotationNode extends AnnotationNode { * Constructs a new {@link AnnotationNode}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param typeRef a reference to the annotated type. See {@link org.objectweb.asm.TypeReference}. * @param typePath the path to the annotated type argument, wildcard bound, array element type, or * static inner type within 'typeRef'. May be {@literal null} if the annotation targets diff --git a/asm-tree/src/test/java/org/objectweb/asm/tree/ClassNodeTest.java b/asm-tree/src/test/java/org/objectweb/asm/tree/ClassNodeTest.java index 4bf967220..c216f95ac 100644 --- a/asm-tree/src/test/java/org/objectweb/asm/tree/ClassNodeTest.java +++ b/asm-tree/src/test/java/org/objectweb/asm/tree/ClassNodeTest.java @@ -80,10 +80,9 @@ public class ClassNodeTest extends AsmTest implements Opcodes { assertEquals("1.0", moduleNode.version); ModuleNode otherModuleNode = - new ModuleNode( - Opcodes.ASM7_EXPERIMENTAL, "otherModule", 456, "2.0", null, null, null, null, null); + new ModuleNode(Opcodes.ASM7, "otherModule", 456, "2.0", null, null, null, null, null); moduleNode.accept( - new ClassVisitor(Opcodes.ASM7_EXPERIMENTAL) { + new ClassVisitor(Opcodes.ASM7) { @Override public ModuleVisitor visitModule( final String name, final int access, final String version) { @@ -150,7 +149,7 @@ public class ClassNodeTest extends AsmTest implements Opcodes { assertEquals("value", annotationNode.values.get(17)); annotationNode.accept( - new AnnotationVisitor(Opcodes.ASM7_EXPERIMENTAL) { + new AnnotationVisitor(Opcodes.ASM7) { @Override public AnnotationVisitor visitAnnotation(final String name, final String descriptor) { @@ -501,10 +500,10 @@ public class ClassNodeTest extends AsmTest implements Opcodes { } @Override - public void visitNestHostExperimental(final String nestHost) {} + public void visitNestHost(final String nestHost) {} @Override - public void visitNestMemberExperimental(final String nestMember) {} + public void visitNestMember(final String nestMember) {} @Override public void visitAttribute(final Attribute attribute) {} diff --git a/asm-tree/src/test/java/org/objectweb/asm/tree/InsnListTest.java b/asm-tree/src/test/java/org/objectweb/asm/tree/InsnListTest.java index e1e06b72d..6e0df8f5f 100644 --- a/asm-tree/src/test/java/org/objectweb/asm/tree/InsnListTest.java +++ b/asm-tree/src/test/java/org/objectweb/asm/tree/InsnListTest.java @@ -741,7 +741,7 @@ public class InsnListTest { final InsnList insnList = new InsnList(); list1.accept( - new MethodVisitor(Opcodes.ASM7_EXPERIMENTAL) { + new MethodVisitor(Opcodes.ASM7) { @Override public void visitInsn(final int opcode) { insnList.add(new InsnNode(opcode)); diff --git a/asm-util/src/main/java/org/objectweb/asm/util/ASMifier.java b/asm-util/src/main/java/org/objectweb/asm/util/ASMifier.java index 6cc004216..349fa558d 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/ASMifier.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/ASMifier.java @@ -100,7 +100,7 @@ public class ASMifier extends Printer { * @throws IllegalStateException If a subclass calls this constructor. */ public ASMifier() { - this(Opcodes.ASM6, "classWriter", 0); + this(Opcodes.ASM7, "classWriter", 0); if (getClass() != ASMifier.class) { throw new IllegalStateException(); } @@ -110,7 +110,7 @@ public class ASMifier extends Printer { * Constructs a new {@link ASMifier}. * * @param api the ASM API version implemented by this class. Must be one of {@link Opcodes#ASM4}, - * {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param visitorVariableName the name of the visitor variable in the produced code. * @param annotationVisitorId identifier of the annotation visitor variable in the produced code. */ @@ -239,9 +239,9 @@ public class ASMifier extends Printer { } @Override - public void visitNestHostExperimental(final String nestHost) { + public void visitNestHost(final String nestHost) { stringBuilder.setLength(0); - stringBuilder.append("classWriter.visitNestHostExperimental("); + stringBuilder.append("classWriter.visitNestHost("); appendConstant(nestHost); stringBuilder.append(");\n\n"); text.add(stringBuilder.toString()); @@ -277,9 +277,9 @@ public class ASMifier extends Printer { } @Override - public void visitNestMemberExperimental(final String nestMember) { + public void visitNestMember(final String nestMember) { stringBuilder.setLength(0); - stringBuilder.append("classWriter.visitNestMemberExperimental("); + stringBuilder.append("classWriter.visitNestMember("); appendConstant(nestMember); stringBuilder.append(");\n\n"); text.add(stringBuilder.toString()); @@ -1194,7 +1194,7 @@ public class ASMifier extends Printer { */ protected ASMifier createASMifier( final String visitorVariableName, final int annotationVisitorId) { - return new ASMifier(Opcodes.ASM6, visitorVariableName, annotationVisitorId); + return new ASMifier(Opcodes.ASM7, visitorVariableName, annotationVisitorId); } /** diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckAnnotationAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckAnnotationAdapter.java index 9b5f6b0a7..6a868f367 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckAnnotationAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckAnnotationAdapter.java @@ -52,7 +52,7 @@ public class CheckAnnotationAdapter extends AnnotationVisitor { } CheckAnnotationAdapter(final AnnotationVisitor annotationVisitor, final boolean useNamedValues) { - super(Opcodes.ASM6, annotationVisitor); + super(Opcodes.ASM7, annotationVisitor); this.useNamedValue = useNamedValues; } diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckClassAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckClassAdapter.java index ae985fcec..575a600c0 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckClassAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckClassAdapter.java @@ -127,7 +127,7 @@ public class CheckClassAdapter extends ClassVisitor { /** Whether the {@link #visitOuterClass} method has been called. */ private boolean visitOuterClassCalled; - /** Whether the {@link #visitNestHostExperimental} method has been called. */ + /** Whether the {@link #visitNestHost} method has been called. */ private boolean visitNestHostCalled; /** @@ -200,8 +200,7 @@ public class CheckClassAdapter extends ClassVisitor { final PrintWriter printWriter) { ClassNode classNode = new ClassNode(); classReader.accept( - new CheckClassAdapter(Opcodes.ASM7_EXPERIMENTAL, classNode, false) {}, - ClassReader.SKIP_DEBUG); + new CheckClassAdapter(Opcodes.ASM7, classNode, false) {}, ClassReader.SKIP_DEBUG); Type syperType = classNode.superName == null ? null : Type.getObjectType(classNode.superName); List methods = classNode.methods; @@ -307,7 +306,7 @@ public class CheckClassAdapter extends ClassVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public CheckClassAdapter(final ClassVisitor classVisitor, final boolean checkDataFlow) { - this(Opcodes.ASM6, classVisitor, checkDataFlow); + this(Opcodes.ASM7, classVisitor, checkDataFlow); if (getClass() != CheckClassAdapter.class) { throw new IllegalStateException(); } @@ -317,8 +316,7 @@ public class CheckClassAdapter extends ClassVisitor { * Constructs a new {@link CheckClassAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param classVisitor the class visitor to which this adapter must delegate calls. * @param checkDataFlow {@literal true} to perform basic data flow checks, or {@literal false} to * not perform any data flow check (see {@link CheckMethodAdapter}). This option requires @@ -423,7 +421,7 @@ public class CheckClassAdapter extends ClassVisitor { } @Override - public void visitNestHostExperimental(final String nestHost) { + public void visitNestHost(final String nestHost) { checkState(); CheckMethodAdapter.checkInternalName(version, nestHost, "nestHost"); if (visitNestHostCalled) { @@ -433,11 +431,11 @@ public class CheckClassAdapter extends ClassVisitor { throw new IllegalStateException("visitNestHost and visitNestMember are mutually exclusive."); } visitNestHostCalled = true; - super.visitNestHostExperimental(nestHost); + super.visitNestHost(nestHost); } @Override - public void visitNestMemberExperimental(final String nestMember) { + public void visitNestMember(final String nestMember) { checkState(); CheckMethodAdapter.checkInternalName(version, nestMember, "nestMember"); if (visitNestHostCalled) { @@ -451,7 +449,7 @@ public class CheckClassAdapter extends ClassVisitor { throw new IllegalStateException( "nest member " + nestMember + " should be in the package " + nestMemberPackageName); } - super.visitNestMemberExperimental(nestMember); + super.visitNestMember(nestMember); } @Override diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckFieldAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckFieldAdapter.java index ce08fa2e0..205d94845 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckFieldAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckFieldAdapter.java @@ -52,7 +52,7 @@ public class CheckFieldAdapter extends FieldVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public CheckFieldAdapter(final FieldVisitor fieldVisitor) { - this(Opcodes.ASM6, fieldVisitor); + this(Opcodes.ASM7, fieldVisitor); if (getClass() != CheckFieldAdapter.class) { throw new IllegalStateException(); } @@ -62,8 +62,7 @@ public class CheckFieldAdapter extends FieldVisitor { * Constructs a new {@link CheckFieldAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param fieldVisitor the field visitor to which this adapter must delegate calls. */ protected CheckFieldAdapter(final int api, final FieldVisitor fieldVisitor) { diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java index da2e4de9c..981a1dd7f 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java @@ -366,7 +366,7 @@ public class CheckMethodAdapter extends MethodVisitor { */ public CheckMethodAdapter( final MethodVisitor methodVisitor, final Map labelInsnIndices) { - this(Opcodes.ASM6, methodVisitor, labelInsnIndices); + this(Opcodes.ASM7, methodVisitor, labelInsnIndices); if (getClass() != CheckMethodAdapter.class) { throw new IllegalStateException(); } @@ -377,8 +377,7 @@ public class CheckMethodAdapter extends MethodVisitor { * data flow check (see {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). * * @param api the ASM API version implemented by this CheckMethodAdapter. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param methodVisitor the method visitor to which this adapter must delegate calls. * @param labelInsnIndices the index of the instruction designated by each visited label so far * (in other methods). This map is updated with the labels from the visited method. @@ -413,7 +412,7 @@ public class CheckMethodAdapter extends MethodVisitor { final String descriptor, final MethodVisitor methodVisitor, final Map labelInsnIndices) { - this(Opcodes.ASM6, access, name, descriptor, methodVisitor, labelInsnIndices); + this(Opcodes.ASM7, access, name, descriptor, methodVisitor, labelInsnIndices); if (getClass() != CheckMethodAdapter.class) { throw new IllegalStateException(); } @@ -425,8 +424,7 @@ public class CheckMethodAdapter extends MethodVisitor { * instruction IRETURN, or the invalid sequence IADD L2I will be detected. * * @param api the ASM API version implemented by this CheckMethodAdapter. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param access the method's access flags. * @param name the method's name. * @param descriptor the method's descriptor (see {@link Type}). diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckModuleAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckModuleAdapter.java index a94f5f8d2..a964d6f37 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckModuleAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckModuleAdapter.java @@ -71,7 +71,7 @@ public class CheckModuleAdapter extends ModuleVisitor { * @throws IllegalStateException If a subclass calls this constructor. */ public CheckModuleAdapter(final ModuleVisitor moduleVisitor, final boolean isOpen) { - this(Opcodes.ASM6, moduleVisitor, isOpen); + this(Opcodes.ASM7, moduleVisitor, isOpen); if (getClass() != CheckModuleAdapter.class) { throw new IllegalStateException(); } @@ -81,8 +81,7 @@ public class CheckModuleAdapter extends ModuleVisitor { * Constructs a new {@link CheckModuleAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param moduleVisitor the module visitor to which this adapter must delegate calls. * @param isOpen whether the visited module is open. Open modules have their {@link * Opcodes#ACC_OPEN} access flag set in {@link org.objectweb.asm.ClassVisitor#visitModule}. diff --git a/asm-util/src/main/java/org/objectweb/asm/util/CheckSignatureAdapter.java b/asm-util/src/main/java/org/objectweb/asm/util/CheckSignatureAdapter.java index b64f780aa..edf61ca0e 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/CheckSignatureAdapter.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/CheckSignatureAdapter.java @@ -123,15 +123,14 @@ public class CheckSignatureAdapter extends SignatureVisitor { * null}. */ public CheckSignatureAdapter(final int type, final SignatureVisitor signatureVisitor) { - this(Opcodes.ASM6, type, signatureVisitor); + this(Opcodes.ASM7, type, signatureVisitor); } /** * Constructs a new {@link CheckSignatureAdapter}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param type the type of signature to be checked. See {@link #CLASS_SIGNATURE}, {@link * #METHOD_SIGNATURE} and {@link #TYPE_SIGNATURE}. * @param signatureVisitor the visitor to which this adapter must delegate calls. May be {@literal diff --git a/asm-util/src/main/java/org/objectweb/asm/util/Printer.java b/asm-util/src/main/java/org/objectweb/asm/util/Printer.java index 1153ffe1d..a633e8618 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/Printer.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/Printer.java @@ -290,7 +290,7 @@ public abstract class Printer { /** * The ASM API version implemented by this class. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -324,8 +324,7 @@ public abstract class Printer { * Constructs a new {@link Printer}. * * @param api the ASM API version implemented by this printer. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected Printer(final int api) { this.api = api; @@ -387,11 +386,7 @@ public abstract class Printer { } /** - * Experimental, use at your own risk. This method will be renamed when it becomes stable, this - * will break existing code using it. Nest host class. See {@link - * org.objectweb.asm.ClassVisitor#visitNestHostExperimental}. - * - *

Visits the nest host class of the class. A nest is a set of classes of the same package that + * Visits the nest host class of the class. A nest is a set of classes of the same package that * share access to their private members. One of these classes, called the host, lists the other * members of the nest, which in turn should link to the host of their nest. This method must be * called only once and only if the visited class is a non-host member of a nest. A class is @@ -399,10 +394,8 @@ public abstract class Printer { * argument. * * @param nestHost the internal name of the host class of the nest. - * @deprecated This API is experimental. */ - @Deprecated - public void visitNestHostExperimental(final String nestHost) { + public void visitNestHost(final String nestHost) { throw new UnsupportedOperationException(UNSUPPORTED_OPERATION); } @@ -454,21 +447,15 @@ public abstract class Printer { public abstract void visitClassAttribute(Attribute attribute); /** - * Experimental, use at your own risk. This method will be renamed when it becomes stable, this - * will break existing code using it. Nest member name. See {@link - * org.objectweb.asm.ClassVisitor#visitNestMemberExperimental}. - * - *

Visits a member of the nest. A nest is a set of classes of the same package that share - * access to their private members. One of these classes, called the host, lists the other members - * of the nest, which in turn should link to the host of their nest. This method must be called - * only if the visited class is the host of a nest. A nest host is implicitly a member of its own - * nest, so it's invalid to call this method with the visited class name as argument. + * Visits a member of the nest. A nest is a set of classes of the same package that share access + * to their private members. One of these classes, called the host, lists the other members of the + * nest, which in turn should link to the host of their nest. This method must be called only if + * the visited class is the host of a nest. A nest host is implicitly a member of its own nest, so + * it's invalid to call this method with the visited class name as argument. * * @param nestMember the internal name of a nest member. - * @deprecated This API is experimental. */ - @Deprecated - public void visitNestMemberExperimental(final String nestMember) { + public void visitNestMember(final String nestMember) { throw new UnsupportedOperationException(UNSUPPORTED_OPERATION); } diff --git a/asm-util/src/main/java/org/objectweb/asm/util/Textifier.java b/asm-util/src/main/java/org/objectweb/asm/util/Textifier.java index 0e45a5b8f..b02218b02 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/Textifier.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/Textifier.java @@ -108,7 +108,7 @@ public class Textifier extends Printer { * @throws IllegalStateException If a subclass calls this constructor. */ public Textifier() { - this(Opcodes.ASM6); + this(Opcodes.ASM7); if (getClass() != Textifier.class) { throw new IllegalStateException(); } @@ -118,8 +118,7 @@ public class Textifier extends Printer { * Constructs a new {@link Textifier}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected Textifier(final int api) { super(api); @@ -237,7 +236,7 @@ public class Textifier extends Printer { } @Override - public void visitNestHostExperimental(final String nestHost) { + public void visitNestHost(final String nestHost) { stringBuilder.setLength(0); stringBuilder.append(tab).append("NESTHOST "); appendDescriptor(INTERNAL_NAME, nestHost); @@ -279,7 +278,7 @@ public class Textifier extends Printer { } @Override - public void visitNestMemberExperimental(final String nestMember) { + public void visitNestMember(final String nestMember) { stringBuilder.setLength(0); stringBuilder.append(tab).append("NESTMEMBER "); appendDescriptor(INTERNAL_NAME, nestMember); diff --git a/asm-util/src/main/java/org/objectweb/asm/util/TraceAnnotationVisitor.java b/asm-util/src/main/java/org/objectweb/asm/util/TraceAnnotationVisitor.java index d74220c1d..1cc9621a6 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/TraceAnnotationVisitor.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/TraceAnnotationVisitor.java @@ -57,7 +57,7 @@ public final class TraceAnnotationVisitor extends AnnotationVisitor { * @param printer the printer to convert the visited annotation into text. */ public TraceAnnotationVisitor(final AnnotationVisitor annotationVisitor, final Printer printer) { - super(Opcodes.ASM7_EXPERIMENTAL, annotationVisitor); + super(Opcodes.ASM7, annotationVisitor); this.printer = printer; } diff --git a/asm-util/src/main/java/org/objectweb/asm/util/TraceClassVisitor.java b/asm-util/src/main/java/org/objectweb/asm/util/TraceClassVisitor.java index 74541cd69..d0f89b1de 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/TraceClassVisitor.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/TraceClassVisitor.java @@ -117,7 +117,7 @@ public final class TraceClassVisitor extends ClassVisitor { */ public TraceClassVisitor( final ClassVisitor classVisitor, final Printer printer, final PrintWriter printWriter) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); this.printWriter = printWriter; this.p = printer; } @@ -147,9 +147,9 @@ public final class TraceClassVisitor extends ClassVisitor { } @Override - public void visitNestHostExperimental(final String nestHost) { - p.visitNestHostExperimental(nestHost); - super.visitNestHostExperimental(nestHost); + public void visitNestHost(final String nestHost) { + p.visitNestHost(nestHost); + super.visitNestHost(nestHost); } @Override @@ -180,9 +180,9 @@ public final class TraceClassVisitor extends ClassVisitor { } @Override - public void visitNestMemberExperimental(final String nestMember) { - p.visitNestMemberExperimental(nestMember); - super.visitNestMemberExperimental(nestMember); + public void visitNestMember(final String nestMember) { + p.visitNestMember(nestMember); + super.visitNestMember(nestMember); } @Override diff --git a/asm-util/src/main/java/org/objectweb/asm/util/TraceFieldVisitor.java b/asm-util/src/main/java/org/objectweb/asm/util/TraceFieldVisitor.java index 11f532bdf..78590ed5f 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/TraceFieldVisitor.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/TraceFieldVisitor.java @@ -59,7 +59,7 @@ public final class TraceFieldVisitor extends FieldVisitor { * @param printer the printer to convert the visited field into text. */ public TraceFieldVisitor(final FieldVisitor fieldVisitor, final Printer printer) { - super(Opcodes.ASM7_EXPERIMENTAL, fieldVisitor); + super(Opcodes.ASM7, fieldVisitor); this.p = printer; } diff --git a/asm-util/src/main/java/org/objectweb/asm/util/TraceMethodVisitor.java b/asm-util/src/main/java/org/objectweb/asm/util/TraceMethodVisitor.java index 0cff0f830..49e46b934 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/TraceMethodVisitor.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/TraceMethodVisitor.java @@ -61,7 +61,7 @@ public final class TraceMethodVisitor extends MethodVisitor { * @param printer the printer to convert the visited method into text. */ public TraceMethodVisitor(final MethodVisitor methodVisitor, final Printer printer) { - super(Opcodes.ASM7_EXPERIMENTAL, methodVisitor); + super(Opcodes.ASM7, methodVisitor); this.p = printer; } diff --git a/asm-util/src/main/java/org/objectweb/asm/util/TraceModuleVisitor.java b/asm-util/src/main/java/org/objectweb/asm/util/TraceModuleVisitor.java index 55f574197..32bb06115 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/TraceModuleVisitor.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/TraceModuleVisitor.java @@ -56,7 +56,7 @@ public final class TraceModuleVisitor extends ModuleVisitor { * @param printer the printer to convert the visited module into text. */ public TraceModuleVisitor(final ModuleVisitor moduleVisitor, final Printer printer) { - super(Opcodes.ASM7_EXPERIMENTAL, moduleVisitor); + super(Opcodes.ASM7, moduleVisitor); this.p = printer; } diff --git a/asm-util/src/main/java/org/objectweb/asm/util/TraceSignatureVisitor.java b/asm-util/src/main/java/org/objectweb/asm/util/TraceSignatureVisitor.java index ffab3ac73..79b142e59 100644 --- a/asm-util/src/main/java/org/objectweb/asm/util/TraceSignatureVisitor.java +++ b/asm-util/src/main/java/org/objectweb/asm/util/TraceSignatureVisitor.java @@ -90,13 +90,13 @@ public final class TraceSignatureVisitor extends SignatureVisitor { * @param accessFlags for class type signatures, the access flags of the class. */ public TraceSignatureVisitor(final int accessFlags) { - super(Opcodes.ASM7_EXPERIMENTAL); + super(Opcodes.ASM7); this.isInterface = (accessFlags & Opcodes.ACC_INTERFACE) != 0; this.declaration = new StringBuilder(); } private TraceSignatureVisitor(final StringBuilder stringBuilder) { - super(Opcodes.ASM7_EXPERIMENTAL); + super(Opcodes.ASM7); this.isInterface = false; this.declaration = stringBuilder; } diff --git a/asm-util/src/test/java/org/objectweb/asm/util/CheckMethodAdapterTest.java b/asm-util/src/test/java/org/objectweb/asm/util/CheckMethodAdapterTest.java index 528336983..77277409f 100644 --- a/asm-util/src/test/java/org/objectweb/asm/util/CheckMethodAdapterTest.java +++ b/asm-util/src/test/java/org/objectweb/asm/util/CheckMethodAdapterTest.java @@ -253,7 +253,7 @@ public class CheckMethodAdapterTest extends AsmTest implements Opcodes { ClassReader classReader = new ClassReader("java.lang.Object"); ClassWriter classWriter = new ClassWriter(classReader, ClassWriter.COMPUTE_MAXS); ClassVisitor classVisitor = - new ClassVisitor(Opcodes.ASM7_EXPERIMENTAL, classWriter) { + new ClassVisitor(Opcodes.ASM7, classWriter) { @Override public MethodVisitor visitMethod( final int access, diff --git a/asm-util/src/test/java/org/objectweb/asm/util/PrinterTest.java b/asm-util/src/test/java/org/objectweb/asm/util/PrinterTest.java index 65468f89a..b9471589f 100644 --- a/asm-util/src/test/java/org/objectweb/asm/util/PrinterTest.java +++ b/asm-util/src/test/java/org/objectweb/asm/util/PrinterTest.java @@ -269,7 +269,7 @@ public class PrinterTest { @Test public void testUnsupportedOperations() { - Printer printer = new StubPrinter(Opcodes.ASM7_EXPERIMENTAL); + Printer printer = new StubPrinter(Opcodes.ASM7); assertThrows(UnsupportedOperationException.class, () -> printer.visitModule(null, 0, null)); assertThrows(UnsupportedOperationException.class, () -> printer.visitModule(null, 0, null)); assertThrows( diff --git a/asm/src/main/java/org/objectweb/asm/AnnotationVisitor.java b/asm/src/main/java/org/objectweb/asm/AnnotationVisitor.java index 7ce7ffea1..1f173b3a2 100644 --- a/asm/src/main/java/org/objectweb/asm/AnnotationVisitor.java +++ b/asm/src/main/java/org/objectweb/asm/AnnotationVisitor.java @@ -39,7 +39,7 @@ public abstract class AnnotationVisitor { /** * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -50,8 +50,7 @@ public abstract class AnnotationVisitor { * Constructs a new {@link AnnotationVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public AnnotationVisitor(final int api) { this(api, null); @@ -61,16 +60,12 @@ public abstract class AnnotationVisitor { * Constructs a new {@link AnnotationVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param annotationVisitor the annotation visitor to which this visitor must delegate method * calls. May be null. */ public AnnotationVisitor(final int api, final AnnotationVisitor annotationVisitor) { - if (api != Opcodes.ASM6 - && api != Opcodes.ASM5 - && api != Opcodes.ASM4 - && api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4 && api != Opcodes.ASM7) { throw new IllegalArgumentException(); } this.api = api; diff --git a/asm/src/main/java/org/objectweb/asm/AnnotationWriter.java b/asm/src/main/java/org/objectweb/asm/AnnotationWriter.java index 318ee00c6..0c19ad738 100644 --- a/asm/src/main/java/org/objectweb/asm/AnnotationWriter.java +++ b/asm/src/main/java/org/objectweb/asm/AnnotationWriter.java @@ -112,7 +112,7 @@ final class AnnotationWriter extends AnnotationVisitor { final boolean useNamedValues, final ByteVector annotation, final AnnotationWriter previousAnnotation) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); this.symbolTable = symbolTable; this.useNamedValues = useNamedValues; this.annotation = annotation; diff --git a/asm/src/main/java/org/objectweb/asm/ClassReader.java b/asm/src/main/java/org/objectweb/asm/ClassReader.java index 3a0ee789f..d946997d7 100644 --- a/asm/src/main/java/org/objectweb/asm/ClassReader.java +++ b/asm/src/main/java/org/objectweb/asm/ClassReader.java @@ -520,7 +520,7 @@ public class ClassReader { // Visit the NestHost attribute. if (nestHostClass != null) { - classVisitor.visitNestHostExperimental(nestHostClass); + classVisitor.visitNestHost(nestHostClass); } // Visit the EnclosingMethod attribute. @@ -630,7 +630,7 @@ public class ClassReader { int numberOfNestMembers = readUnsignedShort(nestMembersOffset); int currentNestMemberOffset = nestMembersOffset + 2; while (numberOfNestMembers-- > 0) { - classVisitor.visitNestMemberExperimental(readClass(currentNestMemberOffset, charBuffer)); + classVisitor.visitNestMember(readClass(currentNestMemberOffset, charBuffer)); currentNestMemberOffset += 2; } } diff --git a/asm/src/main/java/org/objectweb/asm/ClassVisitor.java b/asm/src/main/java/org/objectweb/asm/ClassVisitor.java index 93e3f2e1f..aebead2e4 100644 --- a/asm/src/main/java/org/objectweb/asm/ClassVisitor.java +++ b/asm/src/main/java/org/objectweb/asm/ClassVisitor.java @@ -40,7 +40,7 @@ public abstract class ClassVisitor { /** * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -51,8 +51,7 @@ public abstract class ClassVisitor { * Constructs a new {@link ClassVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public ClassVisitor(final int api) { this(api, null); @@ -62,16 +61,12 @@ public abstract class ClassVisitor { * Constructs a new {@link ClassVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param classVisitor the class visitor to which this visitor must delegate method calls. May be * null. */ public ClassVisitor(final int api, final ClassVisitor classVisitor) { - if (api != Opcodes.ASM6 - && api != Opcodes.ASM5 - && api != Opcodes.ASM4 - && api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4 && api != Opcodes.ASM7) { throw new IllegalArgumentException(); } this.api = api; @@ -141,24 +136,21 @@ public abstract class ClassVisitor { } /** - * Experimental, use at your own risk. This method will be renamed when it becomes stable, this - * will break existing code using it. Visits the nest host class of the class. A nest is a set - * of classes of the same package that share access to their private members. One of these - * classes, called the host, lists the other members of the nest, which in turn should link to the - * host of their nest. This method must be called only once and only if the visited class is a - * non-host member of a nest. A class is implicitly its own nest, so it's invalid to call this - * method with the visited class name as argument. + * Visits the nest host class of the class. A nest is a set of classes of the same package that + * share access to their private members. One of these classes, called the host, lists the other + * members of the nest, which in turn should link to the host of their nest. This method must be + * called only once and only if the visited class is a non-host member of a nest. A class is + * implicitly its own nest, so it's invalid to call this method with the visited class name as + * argument. * * @param nestHost the internal name of the host class of the nest. - * @deprecated This API is experimental. */ - @Deprecated - public void visitNestHostExperimental(final String nestHost) { - if (api < Opcodes.ASM7_EXPERIMENTAL) { + public void visitNestHost(final String nestHost) { + if (api < Opcodes.ASM7) { throw new UnsupportedOperationException(); } if (cv != null) { - cv.visitNestHostExperimental(nestHost); + cv.visitNestHost(nestHost); } } @@ -231,24 +223,20 @@ public abstract class ClassVisitor { } /** - * Experimental, use at your own risk. This method will be renamed when it becomes stable, this - * will break existing code using it. Visits a member of the nest. A nest is a set of classes - * of the same package that share access to their private members. One of these classes, called - * the host, lists the other members of the nest, which in turn should link to the host of their - * nest. This method must be called only if the visited class is the host of a nest. A nest host - * is implicitly a member of its own nest, so it's invalid to call this method with the visited - * class name as argument. + * Visits a member of the nest. A nest is a set of classes of the same package that share access + * to their private members. One of these classes, called the host, lists the other members of the + * nest, which in turn should link to the host of their nest. This method must be called only if + * the visited class is the host of a nest. A nest host is implicitly a member of its own nest, so + * it's invalid to call this method with the visited class name as argument. * * @param nestMember the internal name of a nest member. - * @deprecated This API is experimental. */ - @Deprecated - public void visitNestMemberExperimental(final String nestMember) { - if (api < Opcodes.ASM7_EXPERIMENTAL) { + public void visitNestMember(final String nestMember) { + if (api < Opcodes.ASM7) { throw new UnsupportedOperationException(); } if (cv != null) { - cv.visitNestMemberExperimental(nestMember); + cv.visitNestMember(nestMember); } } diff --git a/asm/src/main/java/org/objectweb/asm/ClassWriter.java b/asm/src/main/java/org/objectweb/asm/ClassWriter.java index 4931b6e43..6d3341f5f 100644 --- a/asm/src/main/java/org/objectweb/asm/ClassWriter.java +++ b/asm/src/main/java/org/objectweb/asm/ClassWriter.java @@ -234,7 +234,7 @@ public class ClassWriter extends ClassVisitor { * maximum stack size nor the stack frames will be computed for these methods. */ public ClassWriter(final ClassReader classReader, final int flags) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); symbolTable = classReader == null ? new SymbolTable(this) : new SymbolTable(this, classReader); if ((flags & COMPUTE_FRAMES) != 0) { this.compute = MethodWriter.COMPUTE_ALL_FRAMES; @@ -298,7 +298,7 @@ public class ClassWriter extends ClassVisitor { } @Override - public void visitNestHostExperimental(final String nestHost) { + public void visitNestHost(final String nestHost) { nestHostClassIndex = symbolTable.addConstantClass(nestHost).index; } @@ -355,7 +355,7 @@ public class ClassWriter extends ClassVisitor { } @Override - public void visitNestMemberExperimental(final String nestMember) { + public void visitNestMember(final String nestMember) { if (nestMemberClasses == null) { nestMemberClasses = new ByteVector(); } diff --git a/asm/src/main/java/org/objectweb/asm/ConstantDynamic.java b/asm/src/main/java/org/objectweb/asm/ConstantDynamic.java index 77cc7cfcd..7173e6d1f 100644 --- a/asm/src/main/java/org/objectweb/asm/ConstantDynamic.java +++ b/asm/src/main/java/org/objectweb/asm/ConstantDynamic.java @@ -33,9 +33,7 @@ import java.util.Arrays; * A constant whose value is computed at runtime, with a bootstrap method. * * @author Remi Forax - * @deprecated This API is experimental. */ -@Deprecated public final class ConstantDynamic { /** The constant name (can be arbitrary). */ diff --git a/asm/src/main/java/org/objectweb/asm/FieldVisitor.java b/asm/src/main/java/org/objectweb/asm/FieldVisitor.java index 39d18221f..5682d9e66 100644 --- a/asm/src/main/java/org/objectweb/asm/FieldVisitor.java +++ b/asm/src/main/java/org/objectweb/asm/FieldVisitor.java @@ -38,7 +38,7 @@ public abstract class FieldVisitor { /** * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -49,8 +49,7 @@ public abstract class FieldVisitor { * Constructs a new {@link FieldVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public FieldVisitor(final int api) { this(api, null); @@ -60,16 +59,12 @@ public abstract class FieldVisitor { * Constructs a new {@link FieldVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param fieldVisitor the field visitor to which this visitor must delegate method calls. May be * null. */ public FieldVisitor(final int api, final FieldVisitor fieldVisitor) { - if (api != Opcodes.ASM6 - && api != Opcodes.ASM5 - && api != Opcodes.ASM4 - && api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4 && api != Opcodes.ASM7) { throw new IllegalArgumentException(); } this.api = api; diff --git a/asm/src/main/java/org/objectweb/asm/FieldWriter.java b/asm/src/main/java/org/objectweb/asm/FieldWriter.java index 3d43d9e6b..b167c6742 100644 --- a/asm/src/main/java/org/objectweb/asm/FieldWriter.java +++ b/asm/src/main/java/org/objectweb/asm/FieldWriter.java @@ -124,7 +124,7 @@ final class FieldWriter extends FieldVisitor { final String descriptor, final String signature, final Object constantValue) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); this.symbolTable = symbolTable; this.accessFlags = access; this.nameIndex = symbolTable.addConstantUtf8(name); diff --git a/asm/src/main/java/org/objectweb/asm/MethodVisitor.java b/asm/src/main/java/org/objectweb/asm/MethodVisitor.java index 658b80686..f6d95d4d3 100644 --- a/asm/src/main/java/org/objectweb/asm/MethodVisitor.java +++ b/asm/src/main/java/org/objectweb/asm/MethodVisitor.java @@ -52,7 +52,7 @@ public abstract class MethodVisitor { /** * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -63,8 +63,7 @@ public abstract class MethodVisitor { * Constructs a new {@link MethodVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public MethodVisitor(final int api) { this(api, null); @@ -74,16 +73,12 @@ public abstract class MethodVisitor { * Constructs a new {@link MethodVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. * @param methodVisitor the method visitor to which this visitor must delegate method calls. May * be null. */ public MethodVisitor(final int api, final MethodVisitor methodVisitor) { - if (api != Opcodes.ASM6 - && api != Opcodes.ASM5 - && api != Opcodes.ASM4 - && api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4 && api != Opcodes.ASM7) { throw new IllegalArgumentException(); } this.api = api; @@ -543,7 +538,7 @@ public abstract class MethodVisitor { || (value instanceof Type && ((Type) value).getSort() == Type.METHOD))) { throw new UnsupportedOperationException(REQUIRES_ASM5); } - if (api != Opcodes.ASM7_EXPERIMENTAL && value instanceof ConstantDynamic) { + if (api != Opcodes.ASM7 && value instanceof ConstantDynamic) { throw new UnsupportedOperationException("This feature requires ASM7"); } if (mv != null) { diff --git a/asm/src/main/java/org/objectweb/asm/MethodWriter.java b/asm/src/main/java/org/objectweb/asm/MethodWriter.java index bc2d296ef..34e875484 100644 --- a/asm/src/main/java/org/objectweb/asm/MethodWriter.java +++ b/asm/src/main/java/org/objectweb/asm/MethodWriter.java @@ -593,7 +593,7 @@ final class MethodWriter extends MethodVisitor { final String signature, final String[] exceptions, final int compute) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); this.symbolTable = symbolTable; this.accessFlags = "".equals(name) ? access | Constants.ACC_CONSTRUCTOR : access; this.nameIndex = symbolTable.addConstantUtf8(name); diff --git a/asm/src/main/java/org/objectweb/asm/ModuleVisitor.java b/asm/src/main/java/org/objectweb/asm/ModuleVisitor.java index 796ad5ba9..415a43c2b 100644 --- a/asm/src/main/java/org/objectweb/asm/ModuleVisitor.java +++ b/asm/src/main/java/org/objectweb/asm/ModuleVisitor.java @@ -38,7 +38,7 @@ package org.objectweb.asm; public abstract class ModuleVisitor { /** * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -49,7 +49,7 @@ public abstract class ModuleVisitor { * Constructs a new {@link ModuleVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link Opcodes#ASM6} - * or {@link Opcodes#ASM7_EXPERIMENTAL}. + * or {@link Opcodes#ASM7}. */ public ModuleVisitor(final int api) { this(api, null); @@ -59,12 +59,12 @@ public abstract class ModuleVisitor { * Constructs a new {@link ModuleVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link Opcodes#ASM6} - * or {@link Opcodes#ASM7_EXPERIMENTAL}. + * or {@link Opcodes#ASM7}. * @param moduleVisitor the module visitor to which this visitor must delegate method calls. May * be null. */ public ModuleVisitor(final int api, final ModuleVisitor moduleVisitor) { - if (api != Opcodes.ASM6 && api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM6 && api != Opcodes.ASM7) { throw new IllegalArgumentException(); } this.api = api; diff --git a/asm/src/main/java/org/objectweb/asm/ModuleWriter.java b/asm/src/main/java/org/objectweb/asm/ModuleWriter.java index aa5bd1767..7658734db 100644 --- a/asm/src/main/java/org/objectweb/asm/ModuleWriter.java +++ b/asm/src/main/java/org/objectweb/asm/ModuleWriter.java @@ -94,7 +94,7 @@ final class ModuleWriter extends ModuleVisitor { private int mainClassIndex; ModuleWriter(final SymbolTable symbolTable, final int name, final int access, final int version) { - super(Opcodes.ASM6); + super(Opcodes.ASM7); this.symbolTable = symbolTable; this.moduleNameIndex = name; this.moduleFlags = access; diff --git a/asm/src/main/java/org/objectweb/asm/Opcodes.java b/asm/src/main/java/org/objectweb/asm/Opcodes.java index d179706f3..d0834ad84 100644 --- a/asm/src/main/java/org/objectweb/asm/Opcodes.java +++ b/asm/src/main/java/org/objectweb/asm/Opcodes.java @@ -45,14 +45,7 @@ public interface Opcodes { int ASM4 = 4 << 16 | 0 << 8; int ASM5 = 5 << 16 | 0 << 8; int ASM6 = 6 << 16 | 0 << 8; - - /** - * Experimental, use at your own risk. This field will be renamed when it becomes stable, this - * will break existing code using it. - * - * @deprecated This API is experimental. - */ - @Deprecated int ASM7_EXPERIMENTAL = 1 << 24 | 7 << 16 | 0 << 8; + int ASM7 = 1 << 24 | 7 << 16 | 0 << 8; // Java ClassFile versions (the minor version is stored in the 16 most // significant bits, and the @@ -74,12 +67,10 @@ public interface Opcodes { /** * Version flag indicating that the class is using 'preview' features. * - *

{@code version & V_PREVIEW_EXPERIMENTAL == V_PREVIEW_EXPERIMENTAL} tests if a version is - * flagged with {@code V_PREVIEW_EXPERIMENTAL}. - * - * @deprecated This API is experimental. + *

{@code version & V_PREVIEW == V_PREVIEW} tests if a version is flagged with {@code + * V_PREVIEW}. */ - @Deprecated int V_PREVIEW_EXPERIMENTAL = 0xFFFF0000; + int V_PREVIEW = 0xFFFF0000; // Access flags values, defined in // - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1-200-E.1 diff --git a/asm/src/main/java/org/objectweb/asm/signature/SignatureVisitor.java b/asm/src/main/java/org/objectweb/asm/signature/SignatureVisitor.java index db0ed0ca7..3ae9fe31e 100644 --- a/asm/src/main/java/org/objectweb/asm/signature/SignatureVisitor.java +++ b/asm/src/main/java/org/objectweb/asm/signature/SignatureVisitor.java @@ -61,7 +61,7 @@ public abstract class SignatureVisitor { /** * The ASM API version implemented by this visitor. The value of this field must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ protected final int api; @@ -69,14 +69,10 @@ public abstract class SignatureVisitor { * Constructs a new {@link SignatureVisitor}. * * @param api the ASM API version implemented by this visitor. Must be one of {@link - * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link - * Opcodes#ASM7_EXPERIMENTAL}. + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. */ public SignatureVisitor(final int api) { - if (api != Opcodes.ASM6 - && api != Opcodes.ASM5 - && api != Opcodes.ASM4 - && api != Opcodes.ASM7_EXPERIMENTAL) { + if (api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4 && api != Opcodes.ASM7) { throw new IllegalArgumentException(); } this.api = api; diff --git a/asm/src/main/java/org/objectweb/asm/signature/SignatureWriter.java b/asm/src/main/java/org/objectweb/asm/signature/SignatureWriter.java index 433a3e9c2..7a87ed716 100644 --- a/asm/src/main/java/org/objectweb/asm/signature/SignatureWriter.java +++ b/asm/src/main/java/org/objectweb/asm/signature/SignatureWriter.java @@ -70,7 +70,7 @@ public class SignatureWriter extends SignatureVisitor { /** Constructs a new {@link SignatureWriter}. */ public SignatureWriter() { - super(Opcodes.ASM6); + super(Opcodes.ASM7); } // ----------------------------------------------------------------------------------------------- diff --git a/asm/src/test/java/org/objectweb/asm/ClassReaderTest.java b/asm/src/test/java/org/objectweb/asm/ClassReaderTest.java index 51683b9f8..396775bbe 100644 --- a/asm/src/test/java/org/objectweb/asm/ClassReaderTest.java +++ b/asm/src/test/java/org/objectweb/asm/ClassReaderTest.java @@ -223,7 +223,7 @@ public class ClassReaderTest extends AsmTest implements Opcodes { assertThat(() -> classReader.accept(classVisitor, 0)) .succeedsOrThrows(RuntimeException.class) .when( - (hasNestHostOrMembers && apiParameter.value() < ASM7_EXPERIMENTAL) + (hasNestHostOrMembers && apiParameter.value() < ASM7) || (hasModules && apiParameter.value() < ASM6) || (hasTypeAnnotations && apiParameter.value() < ASM5)); } @@ -389,10 +389,10 @@ public class ClassReaderTest extends AsmTest implements Opcodes { } @Override - public void visitNestHostExperimental(final String nestHost) {} + public void visitNestHost(final String nestHost) {} @Override - public void visitNestMemberExperimental(final String nestMember) {} + public void visitNestMember(final String nestMember) {} }; classReader.accept(classVisitor, 0); } @@ -402,7 +402,7 @@ public class ClassReaderTest extends AsmTest implements Opcodes { final AtomicBoolean success = new AtomicBoolean(false); ClassReader classReader = new ClassReader(PrecompiledClass.JDK5_LOCAL_CLASS.getBytes()); classReader.accept( - new ClassVisitor(Opcodes.ASM7_EXPERIMENTAL) { + new ClassVisitor(Opcodes.ASM7) { @Override public MethodVisitor visitMethod( final int access, @@ -431,7 +431,7 @@ public class ClassReaderTest extends AsmTest implements Opcodes { public void testPreviewMinorVersion() { ClassReader classReader = new ClassReader(PrecompiledClass.JDK11_ALL_INSTRUCTIONS.getBytes()); classReader.accept( - new ClassVisitor(Opcodes.ASM7_EXPERIMENTAL) { + new ClassVisitor(Opcodes.ASM7) { @Override public void visit( int version, @@ -440,8 +440,7 @@ public class ClassReaderTest extends AsmTest implements Opcodes { String signature, String superName, String[] interfaces) { - assertTrue( - (version & Opcodes.V_PREVIEW_EXPERIMENTAL) == Opcodes.V_PREVIEW_EXPERIMENTAL); + assertTrue((version & Opcodes.V_PREVIEW) == Opcodes.V_PREVIEW); } }, 0); @@ -461,11 +460,11 @@ public class ClassReaderTest extends AsmTest implements Opcodes { || invalidClass == InvalidClass.INVALID_BYTECODE_OFFSET) { assertThrows( ArrayIndexOutOfBoundsException.class, - () -> classReader.accept(new EmptyClassVisitor(ASM7_EXPERIMENTAL), 0)); + () -> classReader.accept(new EmptyClassVisitor(ASM7), 0)); } else { assertThrows( IllegalArgumentException.class, - () -> classReader.accept(new EmptyClassVisitor(ASM7_EXPERIMENTAL), 0)); + () -> classReader.accept(new EmptyClassVisitor(ASM7), 0)); } } } diff --git a/asm/src/test/java/org/objectweb/asm/ClassVisitorTest.java b/asm/src/test/java/org/objectweb/asm/ClassVisitorTest.java index 84406fd3f..0e89c10f4 100644 --- a/asm/src/test/java/org/objectweb/asm/ClassVisitorTest.java +++ b/asm/src/test/java/org/objectweb/asm/ClassVisitorTest.java @@ -366,7 +366,7 @@ public class ClassVisitorTest extends AsmTest { private static class ChangeExceptionAdapter extends ClassVisitor { ChangeExceptionAdapter(final ClassVisitor classVisitor) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); } @Override @@ -388,7 +388,7 @@ public class ClassVisitorTest extends AsmTest { private final int newVersion; ChangeVersionAdapter(final ClassVisitor classVisitor, final int newVersion) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); this.newVersion = newVersion; } @@ -409,7 +409,7 @@ public class ClassVisitorTest extends AsmTest { private final int accessFlags; ChangeAccessAdapter(final ClassVisitor classVisitor, final int accessFlags) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); this.accessFlags = accessFlags; } @@ -430,7 +430,7 @@ public class ClassVisitorTest extends AsmTest { private final boolean visibilityValue; RemoveAnnotationAdapter(final ClassVisitor classVisitor, final boolean visibilityValue) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); this.visibilityValue = visibilityValue; } @@ -571,7 +571,7 @@ public class ClassVisitorTest extends AsmTest { private static class AddParameterAdapter extends ClassVisitor { public AddParameterAdapter(final ClassVisitor classVisitor) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); } @Override diff --git a/asm/src/test/java/org/objectweb/asm/ClassWriterTest.java b/asm/src/test/java/org/objectweb/asm/ClassWriterTest.java index 0ba9d8cd1..0dff255f5 100644 --- a/asm/src/test/java/org/objectweb/asm/ClassWriterTest.java +++ b/asm/src/test/java/org/objectweb/asm/ClassWriterTest.java @@ -511,7 +511,7 @@ public class ClassWriterTest extends AsmTest { ClassReader classReader = new ClassReader(classFile); ClassWriter classWriter = new ClassWriter(0); ClassVisitor classVisitor = - new ClassVisitor(Opcodes.ASM7_EXPERIMENTAL, classWriter) { + new ClassVisitor(Opcodes.ASM7, classWriter) { @Override public ModuleVisitor visitModule( diff --git a/asm/src/test/java/org/objectweb/asm/ConstantsTest.java b/asm/src/test/java/org/objectweb/asm/ConstantsTest.java index 4d72416cc..81ee07b1b 100644 --- a/asm/src/test/java/org/objectweb/asm/ConstantsTest.java +++ b/asm/src/test/java/org/objectweb/asm/ConstantsTest.java @@ -63,11 +63,11 @@ public class ConstantsTest { case "ASM4": case "ASM5": case "ASM6": - case "ASM7_EXPERIMENTAL": + case "ASM7": assertFalse(asmVersions.contains(field.getInt(null))); asmVersions.add(field.getInt(null)); break; - case "V_PREVIEW_EXPERIMENTAL": + case "V_PREVIEW": case "V1_1": case "V1_2": case "V1_3": diff --git a/asm/src/test/java/org/objectweb/asm/signature/SignatureReaderTest.java b/asm/src/test/java/org/objectweb/asm/signature/SignatureReaderTest.java index d44d48795..584058494 100644 --- a/asm/src/test/java/org/objectweb/asm/signature/SignatureReaderTest.java +++ b/asm/src/test/java/org/objectweb/asm/signature/SignatureReaderTest.java @@ -103,6 +103,6 @@ public class SignatureReaderTest extends AsmTest { public void testReadInvalidSignature() { assertThrows( IllegalArgumentException.class, - () -> new SignatureReader("-").accept(new SignatureVisitor(Opcodes.ASM7_EXPERIMENTAL) {})); + () -> new SignatureReader("-").accept(new SignatureVisitor(Opcodes.ASM7) {})); } } diff --git a/benchmarks/src/jmh/java/org/objectweb/asm/benchmarks/TypeBenchmark.java b/benchmarks/src/jmh/java/org/objectweb/asm/benchmarks/TypeBenchmark.java index d7107c19f..dc631cf17 100644 --- a/benchmarks/src/jmh/java/org/objectweb/asm/benchmarks/TypeBenchmark.java +++ b/benchmarks/src/jmh/java/org/objectweb/asm/benchmarks/TypeBenchmark.java @@ -88,7 +88,7 @@ public class TypeBenchmark extends AbstractBenchmark { }; CollectTypesVisitor() { - super(Opcodes.ASM6); + super(Opcodes.ASM7); } @Override diff --git a/build.gradle b/build.gradle index 730bddbdd..4d5c2c63e 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ subprojects { apply plugin: 'jacoco' def snapshotSuffix = rootProject.hasProperty('release') ? '' : '-SNAPSHOT' group = 'org.ow2.asm' - version = '6.2.1' + snapshotSuffix + version = '7.0-beta' + snapshotSuffix sourceCompatibility = '1.6' targetCompatibility = '1.6' test { useJUnitPlatform() } diff --git a/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java b/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java index f76ef2ef1..604170113 100644 --- a/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java +++ b/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java @@ -154,7 +154,7 @@ public class Retrofitter { static class ClassRetrofitter extends ClassVisitor { public ClassRetrofitter(ClassVisitor classVisitor) { - super(Opcodes.ASM7_EXPERIMENTAL, classVisitor); + super(Opcodes.ASM7, classVisitor); } @Override -- GitLab From 485be1c9ed5598c4d3946facff4c9596af12feb4 Mon Sep 17 00:00:00 2001 From: Eric Bruneton Date: Thu, 6 Sep 2018 21:18:03 +0200 Subject: [PATCH 2/3] Update last references to ASM6. --- .../java/org/objectweb/asm/tree/analysis/BasicInterpreter.java | 2 +- .../java/org/objectweb/asm/tree/analysis/BasicVerifier.java | 2 +- .../java/org/objectweb/asm/tree/analysis/SimpleVerifier.java | 2 +- .../java/org/objectweb/asm/tree/analysis/SourceInterpreter.java | 2 +- asm-tree/src/main/java/org/objectweb/asm/tree/package.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java index 65c25e7bf..e82b29136 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicInterpreter.java @@ -61,7 +61,7 @@ public class BasicInterpreter extends Interpreter implements Opcodes * version. */ public BasicInterpreter() { - super(ASM6); + super(ASM7); if (getClass() != BasicInterpreter.class) { throw new IllegalStateException(); } diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java index 00027b32b..b9a1ac192 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/BasicVerifier.java @@ -47,7 +47,7 @@ public class BasicVerifier extends BasicInterpreter { * use this constructor. Instead, they must use the {@link #BasicVerifier(int)} version. */ public BasicVerifier() { - super(ASM6); + super(ASM7); if (getClass() != BasicVerifier.class) { throw new IllegalStateException(); } diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java index e542b6fb8..1cea23799 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SimpleVerifier.java @@ -93,7 +93,7 @@ public class SimpleVerifier extends BasicVerifier { final Type currentSuperClass, final List currentClassInterfaces, final boolean isInterface) { - this(ASM6, currentClass, currentSuperClass, currentClassInterfaces, isInterface); + this(ASM7, currentClass, currentSuperClass, currentClassInterfaces, isInterface); if (getClass() != SimpleVerifier.class) { throw new IllegalStateException(); } diff --git a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java index bb5467c5e..6a765e2ac 100644 --- a/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java +++ b/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java @@ -51,7 +51,7 @@ public class SourceInterpreter extends Interpreter implements Opcod * version. */ public SourceInterpreter() { - super(ASM6); + super(ASM7); if (getClass() != SourceInterpreter.class) { throw new IllegalStateException(); } diff --git a/asm-tree/src/main/java/org/objectweb/asm/tree/package.html b/asm-tree/src/main/java/org/objectweb/asm/tree/package.html index 9756a76cf..ab295acd9 100644 --- a/asm-tree/src/main/java/org/objectweb/asm/tree/package.html +++ b/asm-tree/src/main/java/org/objectweb/asm/tree/package.html @@ -77,7 +77,7 @@ In this example MethodNode is acting as a buffer that is flushed out at visitEnd

   ClassReader classReader = new ClassReader(source);
   ClassWriter classWriter = new ClassWriter(0);
-  ClassVisitor classVisitor = new ClassVisitor(ASM6, classWriter) {
+  ClassVisitor classVisitor = new ClassVisitor(ASM7, classWriter) {
     public MethodVisitor visitMethod(int access, String name,
         String desc, String signature, String[] exceptions) {
       final MethodVisitor methodVisitor = 
-- 
GitLab


From 7440fa7c521e730ee0220d75292736f19ab01a9f Mon Sep 17 00:00:00 2001
From: Eric Bruneton 
Date: Thu, 6 Sep 2018 21:42:28 +0200
Subject: [PATCH 3/3] Fix ASM7 value, following code review.

---
 asm-test/src/main/java/org/objectweb/asm/test/AsmTest.java     | 2 +-
 asm-test/src/test/java/org/objectweb/asm/test/AsmTestTest.java | 2 +-
 asm/src/main/java/org/objectweb/asm/Opcodes.java               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/asm-test/src/main/java/org/objectweb/asm/test/AsmTest.java b/asm-test/src/main/java/org/objectweb/asm/test/AsmTest.java
index 8514a8dde..8f83a18e9 100644
--- a/asm-test/src/main/java/org/objectweb/asm/test/AsmTest.java
+++ b/asm-test/src/main/java/org/objectweb/asm/test/AsmTest.java
@@ -235,7 +235,7 @@ public abstract class AsmTest {
     ASM4("ASM4", 4 << 16),
     ASM5("ASM5", 5 << 16),
     ASM6("ASM6", 6 << 16),
-    ASM7("ASM7", 1 << 24 | 7 << 16);
+    ASM7("ASM7", 7 << 16);
 
     private final String name;
     private final int value;
diff --git a/asm-test/src/test/java/org/objectweb/asm/test/AsmTestTest.java b/asm-test/src/test/java/org/objectweb/asm/test/AsmTestTest.java
index 35ecb3c30..d92606d7b 100644
--- a/asm-test/src/test/java/org/objectweb/asm/test/AsmTestTest.java
+++ b/asm-test/src/test/java/org/objectweb/asm/test/AsmTestTest.java
@@ -73,7 +73,7 @@ public class AsmTestTest extends AsmTest {
   @MethodSource(ALL_CLASSES_AND_LATEST_API)
   public void testGetBytes(final PrecompiledClass classParameter, final Api apiParameter) {
     assertEquals(Api.ASM7, apiParameter);
-    assertEquals(0x01070000, apiParameter.value());
+    assertEquals(0x70000, apiParameter.value());
     assertEquals("ASM7", apiParameter.toString());
     byte[] classContent = classParameter.getBytes();
     assertThatClass(classContent).contains(classParameter.getInternalName());
diff --git a/asm/src/main/java/org/objectweb/asm/Opcodes.java b/asm/src/main/java/org/objectweb/asm/Opcodes.java
index d0834ad84..652db8667 100644
--- a/asm/src/main/java/org/objectweb/asm/Opcodes.java
+++ b/asm/src/main/java/org/objectweb/asm/Opcodes.java
@@ -45,7 +45,7 @@ public interface Opcodes {
   int ASM4 = 4 << 16 | 0 << 8;
   int ASM5 = 5 << 16 | 0 << 8;
   int ASM6 = 6 << 16 | 0 << 8;
-  int ASM7 = 1 << 24 | 7 << 16 | 0 << 8;
+  int ASM7 = 7 << 16 | 0 << 8;
 
   // Java ClassFile versions (the minor version is stored in the 16 most
   // significant bits, and the
-- 
GitLab