FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
It is possible to annotate the outer type of a receiver type even if the inner type is not parameterized.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached code and look into the class file where the outer type is treated like a owner type of a parameterized type.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
javac emitts a compiler error.
ACTUAL -
javac writes the type annotation into the class file.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Foo {
class Bar {
void qux(@TypeAnnotation Foo.@TypeAnnotation Bar this) { } // Foo is treated as owner type.
}
}
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
@interface TypeAnnotation { }
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
It is possible to annotate the outer type of a receiver type even if the inner type is not parameterized.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached code and look into the class file where the outer type is treated like a owner type of a parameterized type.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
javac emitts a compiler error.
ACTUAL -
javac writes the type annotation into the class file.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Foo {
class Bar {
void qux(@TypeAnnotation Foo.@TypeAnnotation Bar this) { } // Foo is treated as owner type.
}
}
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
@interface TypeAnnotation { }
---------- END SOURCE ----------