Repository navigation
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
…d of removeIf A name defined in several source sets is registered with a list built by List.of or Stream.toList(); those lists cannot be changed, so removeIf threw UnsupportedOperationException. JavaInspectorImpl.invalidateAllSources() stopped at its first line and left the javac file managers and shared jar archives open. Seen on the refactor server when dropping hibernate-orm (60 source sets). Test: TestRemoveAllSourcesWithOneNameInTwoSourceSets.
tomtourwe
force-pushed
the
fix/remove-all-sources-immutable-lists
branch
from
November 13, 2026 17:12
f3ef25f to
cbbc5aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dropping the project hibernate-orm on the refactor server logs:
multiTypeByFqnholds the names defined in more than one source set. Its lists are built withList.ofandStream.toList(), which cannot be changed, solist.removeIf(...)inremoveAllSources()throws.removeType()in the same class already rebuilds these lists for this reason.Consequence:
invalidateAllSources()stops at its first line, so the javac file managers and the shared jar archives it should close stay open. This happens on every drop and every reload-after-write of a project where a class name exists in several source sets (hibernate-orm: 60 source sets). Results are not affected: the server builds a new inspector for the next model.Change
The next line,
multiTypeByFqn.values().removeIf(List::isEmpty), then drops the names left without a type.Test
TestRemoveAllSourcesWithOneNameInTwoSourceSets:a.Helperis defined in the source setscore/mainandcore/test, andlib.Thingcomes from a library jar. AfterremoveAllSources()no copy ofa.Helperis left andlib.Thingis still registered.UnsupportedOperationException.maddi-inspection-openjdktest suite: 175 tests, 0 failures, 1 skipped (as before).