RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2]

Joe Darcy darcy at openjdk.org
Fri Jan 12 07:32:33 UTC 2024


On Wed, 3 Jan 2024 23:26:22 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

>> Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Update visitor; all langtools regression tests pass.
>>  - Merge branch 'master' into JDK-8042981
>>  - JDK-8042981: Strip type annotations in Types' utility methods
>
> I cleaned up the approach described in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798 and have a draft with those changes applied on top of the work in this PR: https://github.com/openjdk/jdk/pull/17256. It passes the tests added in this PR, with the disabled cases re-enabled.
> 
> @jddarcy what do you think of that approach?

After adding some code from @cushon to get past a roadblock, the PR is back on track. Thanks @cushon!

Please (re)review the API and implementation changes.

The testing seems to have uncovered a bug where the methods

getAnnotation(Class<A> annotationType)
getAnnotationsByType(Class<A> annotationType) getAnnotationsByType(Class<A> annotationType)

when called on a TypeMirror always return an empty result even when annotations are present. Commenting out the overrides in Type and using the code from AnnoConstruct seems to fix this and all regression tests pass. I can file a separate bug for that issue however and remove the portions of TestAnnotationStripping that would fail without that fix.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/8984#issuecomment-1888564131


More information about the compiler-dev mailing list