class C {
@java.lang.annotation.Target(java.lang.annotation.ElementType.CONSTRUCTOR)
@interface A {}
@A
C() { throw new RuntimeException(); }
}
Save the code above as C.java; compile and extract annotations.
$ javac -g C.java
$ extract-annotations C.class
If the result, given below, is successfully inserted into a source file, it will generate a syntax error due to the use of @C$A in place of the expected @A.
package :
annotation @C$A: @java.lang.annotation.Target(value={CONSTRUCTOR})
package :
class C:
method <init>()V: @C$A
return: