JDK 13 RFR of JDK-8224687: Add clarifying overrides of Element.asType to more specific subinterfaces

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu May 30 17:15:34 UTC 2019



On 05/29/2019 05:24 PM, Joe Darcy wrote:
> Hello,
>
> Please review the webrev and CSR for:
>
>     JDK-8224687: Add clarifying overrides of Element.asType to more 
> specific subinterfaces
>     webrev: http://cr.openjdk.java.net/~darcy/8224687.2/
>     CSR: https://bugs.openjdk.java.net/browse/JDK-8225027
>
> Thanks,
>
> -Joe
>

Joe,

CSR Reviewed.

In the new test, I don't understand lines 119, 128, regarding 
ElementKind.FIELD.
Either the code is a copy-paste error, or the description elsewhere of 
DeclaredType
and TypeKind.DECLARED is incorrect, since these only refer to declared types
(class, interface, etc) and not fields.

Surprising or maybe not, the test actually passes, suggesting that this 
is the
current behavior even if it is unexpected.  That being said, the output 
from the
test would be easier to understand if it included the ElementKind and 
simple name
of the element, as well as the typeMirror, typeMirror class and typeKind.

-- Jon


More information about the compiler-dev mailing list