@ -29,20 +29,20 @@ package org.springframework.asm;
@@ -29,20 +29,20 @@ package org.springframework.asm;
/ * *
* A visitor to visit a Java method . The methods of this class must be called in the following
* order : ( < tt > visitParameter < / tt > ) * [ < tt > visitAnnotationDefault < / tt > ] (
* < tt > visitAnnotation < / tt > | < tt > visitAnnotableParameterCount < / tt > |
* < tt > visitParameterAnnotation < / tt > < tt > visitTypeAnnotation < / tt > | < tt > visitAttribute < / tt > ) * [
* < tt > visitCode < / tt > ( < tt > visitFrame < / tt > | < tt > visit < i > X < / i > Insn < / tt > | < tt > visitLabel < / tt > |
* < tt > visitInsnAnnotation < / tt > | < tt > visitTryCatchBlock < / tt > | < tt > visitTryCatchAnnotation < / tt > |
* < tt > visitLocalVariable < / tt > | < tt > visitLocalVariableAnnotation < / tt > | < tt > visitLineNumber < / tt > ) *
* < tt > visitMaxs < / tt > ] < tt > visitEnd < / tt > . In addition , the < tt > visit < i > X < / i > Insn < / tt > and
* < tt > visitLabel < / tt > methods must be called in the sequential order of the bytecode instructions
* of the visited code , < tt > visitInsnAnnotation < / tt > must be called < i > after < / i > the annotated
* instruction , < tt > visitTryCatchBlock < / tt > must be called < i > before < / i > the labels passed as
* arguments have been visited , < tt > visitTryCatchBlockAnnotation < / tt > must be called < i > after < / i >
* the corresponding try catch block has been visited , and the < tt > visitLocalVariable < / tt > ,
* < tt > visitLocalVariableAnnotation < / tt > and < tt > visitLineNumber < / tt > methods must be called
* < i > after < / i > the labels passed as arguments have been visited .
* order : ( { @code visitParameter } ) * [ { @code visitAnnotationDefault } ] ( { @code visitAnnotation } |
* { @code visitAnnotableParameterCount } | { @code visitParameterAnnotation } { @code
* visitTypeAnnotation } | { @code visitAttribute } ) * [ { @code visitCode } ( { @code visitFrame } |
* { @code visit < i > X < / i > Insn } | { @code visitLabel } | { @code visitInsnAnnotation } | { @code
* visitTryCatchBlock } | { @code visitTryCatchAnnotation } | { @code visitLocalVariable } | { @code
* visitLocalVariableAnnotation } | { @code visitLineNumber } ) * { @code visitMaxs } ] { @code visitEnd } .
* In addition , the { @code visit < i > X < / i > Insn } and { @code visitLabel } methods must be called in the
* sequential order of the bytecode instructions of the visited code , { @code visitInsnAnnotation }
* must be called < i > after < / i > the annotated instruction , { @code visitTryCatchBlock } must be called
* < i > before < / i > the labels passed as arguments have been visited , { @code
* visitTryCatchBlockAnnotation } must be called < i > after < / i > the corresponding try catch block has
* been visited , and the { @code visitLocalVariable } , { @code visitLocalVariableAnnotation } and { @code
* visitLineNumber } methods must be called < i > after < / i > the labels passed as arguments have been
* visited .
*
* @author Eric Bruneton
* /
@ -52,7 +52,7 @@ public abstract class MethodVisitor {
@@ -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 {
@@ -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 {
@@ -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 ;
@ -98,8 +93,8 @@ public abstract class MethodVisitor {
@@ -98,8 +93,8 @@ public abstract class MethodVisitor {
* Visits a parameter of this method .
*
* @param name parameter name or null if none is provided .
* @param access the parameter ' s access flags , only < tt > ACC_FINAL < / tt > , < tt > ACC_SYNTHETIC < / tt >
* or / and < tt > ACC_MANDATED < / tt > are allowed ( see { @link Opcodes } ) .
* @param access the parameter ' s access flags , only { @code ACC_FINAL } , { @code ACC_SYNTHETIC }
* or / and { @code ACC_MANDATED } are allowed ( see { @link Opcodes } ) .
* /
public void visitParameter ( final String name , final int access ) {
if ( api < Opcodes . ASM5 ) {
@ -114,9 +109,9 @@ public abstract class MethodVisitor {
@@ -114,9 +109,9 @@ public abstract class MethodVisitor {
* Visits the default value of this annotation interface method .
*
* @return a visitor to the visit the actual default value of this annotation interface method , or
* < tt > null < / tt > if this visitor is not interested in visiting this default value . The ' name '
* parameters passed to the methods of this annotation visitor are ignored . Moreover , exacly
* one visit method must be called on this annotation visitor , followed by visitEnd .
* { @literal null } if this visitor is not interested in visiting this default value . The
* ' name ' parameters passed to the methods of this annotation visitor are ignored . Moreover ,
* exacly one visit method must be called on this annotation visitor , followed by visitEnd .
* /
public AnnotationVisitor visitAnnotationDefault ( ) {
if ( mv ! = null ) {
@ -129,8 +124,8 @@ public abstract class MethodVisitor {
@@ -129,8 +124,8 @@ public abstract class MethodVisitor {
* Visits an annotation of this method .
*
* @param descriptor the class descriptor of the annotation class .
* @param visible < tt > true < / tt > if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or < tt > null < / tt > if this visitor is not
* @param visible { @literal true } if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or { @literal null } if this visitor is not
* interested in visiting this annotation .
* /
public AnnotationVisitor visitAnnotation ( final String descriptor , final boolean visible ) {
@ -149,11 +144,11 @@ public abstract class MethodVisitor {
@@ -149,11 +144,11 @@ public abstract class MethodVisitor {
* TypeReference # METHOD_RECEIVER } , { @link TypeReference # METHOD_FORMAL_PARAMETER } or { @link
* TypeReference # THROWS } . See { @link TypeReference } .
* @param typePath the path to the annotated type argument , wildcard bound , array element type , or
* static inner type within ' typeRef ' . May be < tt > null < / tt > if the annotation targets
* static inner type within ' typeRef ' . May be { @literal null } if the annotation targets
* ' typeRef ' as a whole .
* @param descriptor the class descriptor of the annotation class .
* @param visible < tt > true < / tt > if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or < tt > null < / tt > if this visitor is not
* @param visible { @literal true } if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or { @literal null } if this visitor is not
* interested in visiting this annotation .
* /
public AnnotationVisitor visitTypeAnnotation (
@ -177,8 +172,8 @@ public abstract class MethodVisitor {
@@ -177,8 +172,8 @@ public abstract class MethodVisitor {
* be strictly less when a method has synthetic parameters and when these parameters are
* ignored when computing parameter indices for the purpose of parameter annotations ( see
* https : //docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
* @param visible < tt > true < / tt > to define the number of method parameters that can have
* annotations visible at runtime , < tt > false < / tt > to define the number of method parameters
* @param visible { @literal true } to define the number of method parameters that can have
* annotations visible at runtime , { @literal false } to define the number of method parameters
* that can have annotations invisible at runtime .
* /
public void visitAnnotableParameterCount ( final int parameterCount , final boolean visible ) {
@ -197,8 +192,8 @@ public abstract class MethodVisitor {
@@ -197,8 +192,8 @@ public abstract class MethodVisitor {
* descriptor < / i > , in particular in case of synthetic parameters ( see
* https : //docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
* @param descriptor the class descriptor of the annotation class .
* @param visible < tt > true < / tt > if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or < tt > null < / tt > if this visitor is not
* @param visible { @literal true } if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or { @literal null } if this visitor is not
* interested in visiting this annotation .
* /
public AnnotationVisitor visitParameterAnnotation (
@ -532,7 +527,7 @@ public abstract class MethodVisitor {
@@ -532,7 +527,7 @@ public abstract class MethodVisitor {
*
* @param value the constant to be loaded on the stack . This parameter must be a non null { @link
* Integer } , a { @link Float } , a { @link Long } , a { @link Double } , a { @link String } , a { @link
* Type } of OBJECT or ARRAY sort for < tt > . class < / tt > constants , for classes whose version is
* Type } of OBJECT or ARRAY sort for { @code . class } constants , for classes whose version is
* 49 , a { @link Type } of METHOD sort for MethodType , a { @link Handle } for MethodHandle
* constants , for classes whose version is 51 or a { @link ConstantDynamic } for a constant
* dynamic for classes whose version is 55 .
@ -543,7 +538,7 @@ public abstract class MethodVisitor {
@@ -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 ) {
@ -569,8 +564,8 @@ public abstract class MethodVisitor {
@@ -569,8 +564,8 @@ public abstract class MethodVisitor {
* @param min the minimum key value .
* @param max the maximum key value .
* @param dflt beginning of the default handler block .
* @param labels beginnings of the handler blocks . < tt > labels [ i ] < / tt > is the beginning of the
* handler block for the < tt > min + i < / tt > key .
* @param labels beginnings of the handler blocks . { @code labels [ i ] } is the beginning of the
* handler block for the { @code min + i } key .
* /
public void visitTableSwitchInsn (
final int min , final int max , final Label dflt , final Label . . . labels ) {
@ -584,8 +579,8 @@ public abstract class MethodVisitor {
@@ -584,8 +579,8 @@ public abstract class MethodVisitor {
*
* @param dflt beginning of the default handler block .
* @param keys the values of the keys .
* @param labels beginnings of the handler blocks . < tt > labels [ i ] < / tt > is the beginning of the
* handler block for the < tt > keys [ i ] < / tt > key .
* @param labels beginnings of the handler blocks . { @code labels [ i ] } is the beginning of the
* handler block for the { @code keys [ i ] } key .
* /
public void visitLookupSwitchInsn ( final Label dflt , final int [ ] keys , final Label [ ] labels ) {
if ( mv ! = null ) {
@ -617,11 +612,11 @@ public abstract class MethodVisitor {
@@ -617,11 +612,11 @@ public abstract class MethodVisitor {
* TypeReference # CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT } , or { @link
* TypeReference # METHOD_REFERENCE_TYPE_ARGUMENT } . See { @link TypeReference } .
* @param typePath the path to the annotated type argument , wildcard bound , array element type , or
* static inner type within ' typeRef ' . May be < tt > null < / tt > if the annotation targets
* static inner type within ' typeRef ' . May be { @literal null } if the annotation targets
* ' typeRef ' as a whole .
* @param descriptor the class descriptor of the annotation class .
* @param visible < tt > true < / tt > if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or < tt > null < / tt > if this visitor is not
* @param visible { @literal true } if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or { @literal null } if this visitor is not
* interested in visiting this annotation .
* /
public AnnotationVisitor visitInsnAnnotation (
@ -645,8 +640,8 @@ public abstract class MethodVisitor {
@@ -645,8 +640,8 @@ public abstract class MethodVisitor {
* @param start the beginning of the exception handler ' s scope ( inclusive ) .
* @param end the end of the exception handler ' s scope ( exclusive ) .
* @param handler the beginning of the exception handler ' s code .
* @param type the internal name of the type of exceptions handled by the handler , or
* < tt > null < / tt > to catch any exceptions ( for "finally" blocks ) .
* @param type the internal name of the type of exceptions handled by the handler , or { @literal
* null } to catch any exceptions ( for "finally" blocks ) .
* @throws IllegalArgumentException if one of the labels has already been visited by this visitor
* ( by the { @link # visitLabel } method ) .
* /
@ -665,11 +660,11 @@ public abstract class MethodVisitor {
@@ -665,11 +660,11 @@ public abstract class MethodVisitor {
* @param typeRef a reference to the annotated type . The sort of this type reference must be
* { @link TypeReference # EXCEPTION_PARAMETER } . See { @link TypeReference } .
* @param typePath the path to the annotated type argument , wildcard bound , array element type , or
* static inner type within ' typeRef ' . May be < tt > null < / tt > if the annotation targets
* static inner type within ' typeRef ' . May be { @literal null } if the annotation targets
* ' typeRef ' as a whole .
* @param descriptor the class descriptor of the annotation class .
* @param visible < tt > true < / tt > if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or < tt > null < / tt > if this visitor is not
* @param visible { @literal true } if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or { @literal null } if this visitor is not
* interested in visiting this annotation .
* /
public AnnotationVisitor visitTryCatchAnnotation (
@ -688,7 +683,7 @@ public abstract class MethodVisitor {
@@ -688,7 +683,7 @@ public abstract class MethodVisitor {
*
* @param name the name of a local variable .
* @param descriptor the type descriptor of this local variable .
* @param signature the type signature of this local variable . May be < tt > null < / tt > if the local
* @param signature the type signature of this local variable . May be { @literal null } if the local
* variable type does not use generic types .
* @param start the first instruction corresponding to the scope of this local variable
* ( inclusive ) .
@ -716,7 +711,7 @@ public abstract class MethodVisitor {
@@ -716,7 +711,7 @@ public abstract class MethodVisitor {
* { @link TypeReference # LOCAL_VARIABLE } or { @link TypeReference # RESOURCE_VARIABLE } . See { @link
* TypeReference } .
* @param typePath the path to the annotated type argument , wildcard bound , array element type , or
* static inner type within ' typeRef ' . May be < tt > null < / tt > if the annotation targets
* static inner type within ' typeRef ' . May be { @literal null } if the annotation targets
* ' typeRef ' as a whole .
* @param start the fist instructions corresponding to the continuous ranges that make the scope
* of this local variable ( inclusive ) .
@ -725,8 +720,8 @@ public abstract class MethodVisitor {
@@ -725,8 +720,8 @@ public abstract class MethodVisitor {
* @param index the local variable ' s index in each range . This array must have the same size as
* the ' start ' array .
* @param descriptor the class descriptor of the annotation class .
* @param visible < tt > true < / tt > if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or < tt > null < / tt > if this visitor is not
* @param visible { @literal true } if the annotation is visible at runtime .
* @return a visitor to visit the annotation values , or { @literal null } if this visitor is not
* interested in visiting this annotation .
* /
public AnnotationVisitor visitLocalVariableAnnotation (
@ -753,7 +748,7 @@ public abstract class MethodVisitor {
@@ -753,7 +748,7 @@ public abstract class MethodVisitor {
* @param line a line number . This number refers to the source file from which the class was
* compiled .
* @param start the first instruction corresponding to this line number .
* @throws IllegalArgumentException if < tt > start < / tt > has not already been visited by this visitor
* @throws IllegalArgumentException if { @code start } has not already been visited by this visitor
* ( by the { @link # visitLabel } method ) .
* /
public void visitLineNumber ( final int line , final Label start ) {