RFR: 8296010: AssertionError in annotationTargetType [v2]

Manu Sridharan duke at openjdk.org
Tue Jan 31 17:35:25 UTC 2023

On Tue, 31 Jan 2023 17:18:56 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> test/langtools/tools/javac/annotations/crashOnUnknownAttr/CrashOnUnknownTargetTypeTest.java line 10:
>>> 8: 
>>> 9: public class CrashOnUnknownTargetTypeTest {
>>> 10:     @A Object o;
>> I wonder if it's worth testing the case where the annotation appears on a method as well?  We observed crashes before due to that placement as well.  It's possible the relevant code paths are shared so an additional test is unnecessary
> @msridhar  thanks for your feedback. Yes we could do that for completeness, probably won't add too much value as the code path is shared, but will take a look at this. Side: did you file any bug on the issue you found? Could you please try this fix on your code base and see if the issue gets fixed? Thanks!

I originally reported https://bugs.openjdk.org/browse/JDK-8295314, which is a bug on JDK 8 triggered when an annotation targets `MODULE`.  Then, through discussions with @cushon we realized the same issue is present on the latest JDK when the annotation target is unknown, at which point he reported https://bugs.openjdk.org/browse/JDK-8296010.

Trying this patch on my own example may be a bit tricky, since that was related to JDK 8 and I don't have a lot of cycles to look into it right now.  If I get time to try something out, I will report back here.


PR: https://git.openjdk.org/jdk/pull/12241

More information about the compiler-dev mailing list