-
Bug
-
Resolution: Duplicate
-
P4
-
8u66, 9
-
generic
-
generic
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
As shown in the code sample, a receiver type is always resolved as a raw annotated type what makes it impossible to query for parameter type annotations.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A receiver type is parameterized.
ACTUAL -
A receiver type is not parameterized.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Foo<T> {
void foo(Foo<@Bar T> this) {}
}
assert Foo.class.getDeclaredMethod("foo")
.getAnnotatedReceiverType()
instanceof AnnotatedParameterizedType;
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
As shown in the code sample, a receiver type is always resolved as a raw annotated type what makes it impossible to query for parameter type annotations.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A receiver type is parameterized.
ACTUAL -
A receiver type is not parameterized.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Foo<T> {
void foo(Foo<@Bar T> this) {}
}
assert Foo.class.getDeclaredMethod("foo")
.getAnnotatedReceiverType()
instanceof AnnotatedParameterizedType;
---------- END SOURCE ----------
- duplicates
-
JDK-8202471 (ann) Cannot read type annotations on generic receiver type's type variables
- Resolved