Repository navigation
Sanitize erroneous package annotations before index generation - #9777
Conversation
|
potentially RC3 candidate. But needs eyes and testing first. |
lahodaj
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
|
@mvanhorn to get this last minute change into NB 32 we would have to fix two things:
thanks for working on this fix btw! |
VanillaCompileWorker now sanitizes package annotations through the existing clearAnnotations logic when a package symbol is present. The regression test covers unresolved annotation types, class literals, and nested annotations, checking that signature generation succeeds, valid @deprecated annotations remain, and source errors are still recorded. Fixes apache#9740 Assisted-by: AI
fe4c0cf to
b54928f
Compare
|
Thanks. The branch is now a single commit on top of VanillaCompileWorkerTest passes on the rebased tree locally on JDK 21, 63 tests with 0 failures. CI on the new head has only just started, so I'll leave that to report on its own. |
|
Small correction to my note above: CI has not started on the new head. The workflow run is waiting on a maintainer to approve it (action_required). |
|
CI has now run on b54928f. Two jobs failed, Java Hints batch1 on JDK 21 and on JDK 27, both on the same test: I don't know the cause yet. The same job passed on both JDKs on the earlier master-based head (fe4c0cf), and on JDK 21 on the Could someone re-run those two jobs? I can't re-run them myself, and that would show whether this is a flake or something the PR needs to fix. |
|
running two test loops in parallel:
lets see what happens |
mbien
left a comment
There was a problem hiding this comment.
lets book this under "CI gremlins"
seems good now. Ran the indexer smoke test locally indexing all ~860 modules and it indexed them all without exceptions.
|
Many thanks for the review and merge, @ebarboni. Sanitizing erroneous package annotations should keep Java indexing from tripping over unresolved types. |
LLMs, Commit messages and PR description:
Java indexing can fail with an AssertionError when a package annotation contains an unresolved type, preventing index signature generation. The annotation sanitization pass skipped package symbol metadata. Erroneous package annotations could therefore reach javac's class writer, which cannot generate signatures for error types.
VanillaCompileWorker now sanitizes package annotations through the existing clearAnnotations logic when a package symbol is present. The regression test covers unresolved annotation types, class literals, and nested annotations, checking that signature generation succeeds, valid @deprecated annotations remain, and source errors are still recorded.
jvm_tests found no Maven or Gradle build owning the touched files, so it ran no tests.
ant $OPTS -f java/debugger.jpda.truffle test was invoked, but the transcript reports no result.
The tests in
java/java.source.base/test/unit/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorkerTest.javafail without the fix in the netbeans VanillaCompileWorker change (checked by reverting the source changes).Fixes #9740
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)
AI was used for assistance.