google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.31k stars 1.15k forks source link

java.util.ConcurrentModificationException while compiling via Java #4174

Open efMss24 opened 1 week ago

efMss24 commented 1 week ago

I use the Function com.google.javascript.jscomp.Compiler#compile(java.util.List, java.util.List, com.google.javascript.jscomp.CompilerOptions) for compiling dynamic JS-Files before delivering them to the client.

There, the following ConcurrentModificationException occurs:

Caused by: java.util.ConcurrentModificationException: null at java.base/java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1521) at java.base/java.util.TreeMap$KeyIterator.next(TreeMap.java:1575) at com.google.javascript.jscomp.ComposeWarningsGuard.disables(ComposeWarningsGuard.java:144) at com.google.javascript.jscomp.ComposeWarningsGuard.mustRunChecks(ComposeWarningsGuard.java:127) at com.google.javascript.jscomp.CompilerOptions.enables(CompilerOptions.java:1453) at com.google.javascript.jscomp.DefaultPassConfig.getChecks(DefaultPassConfig.java:309) at com.google.javascript.jscomp.Compiler.check(Compiler.java:1296) at com.google.javascript.jscomp.Compiler.performChecks(Compiler.java:1085) at com.google.javascript.jscomp.Compiler.lambda$stage1Passes$6(Compiler.java:994) at com.google.javascript.jscomp.CompilerExecutor.lambda$runInCompilerThread$0(CompilerExecutor.java:100)

Its independent of the used options in CompilerOptions. Version: [v20240317] (https://mvnrepository.com/artifact/com.google.javascript/closure-compiler/v20240317)