RFR: JDK-8323684: TypeMirror.{getAnnotationsByType, getAnnotation} return uninformative results [v3]
Joe Darcy
darcy at openjdk.org
Thu Jan 18 19:07:29 UTC 2024
On Thu, 18 Jan 2024 01:19:41 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> With my `javadoc` hat on, I would hope that `Element` is never `sealed`. But that's a separate issue.
>
> If we had sealed types when JSR 269 was in development, there are at least a few places in the API I would have liked to use them, in particular to seal javax.lang.model.UnknownEntityException to only have in-API subclasses.
>
> Given that the javax.lang.model.{element, type} packages were intended to allow multiple independent implementations, the root interfaces like element couldn't be sealed while achieving that goal.
>
> Inside javac, Type and Symbol could also be declared to be sealed rather than non-sealed, possibly at the cost of listed out all the subclasses.
> @lahodaj or @vicente-romero-oracle , any thoughts on using sealed/non-sealed in javac in this way?
>
> If I don't here back from you on this point, I'll revert use of sealed/non-sealed before pushing. Thanks.
Reverted sealed/non-sealed changes to get the rest of the fix in and filed JDK-8324167: Use sealed/non-sealed in javac implementation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17410#discussion_r1457867646
More information about the compiler-dev
mailing list