Make EngineUrlStreamHandlerFactory safe wrt to changes in JDK15+ #2676
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.
TreeMap implementation has been changed in Java 15 to optimize some functions. As a result running embedded service executions concurrently in the same JVM can now throw concurrent modification exceptions when running on JVM 15 onwards.
Note that TreeMap has never been threadsafe - just that exceptions are now thrown on Java 15 onwards.
Switching to a threadsafe map implementation to avoid exceptions being thrown for concurrent executions of the same service on the same JVM.
References:
https://www.oracle.com/java/technologies/javase/15-relnote-issues.html
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8227666
https://hg.openjdk.org/jdk/jdk/rev/65b345254ca3