Idea throws ConcurrentModificationException for the "Kotlin scripting examples" repo
I wanted to try out custom Kotlin scripting, as described here.
When I open the kotlin-script-examples Github Repo with Idea-2022.1 (Ubuntu-21.10, Java-17) and view the Idea log file, I see the following exceptions:
2022-04-30 21:25:27,007 [ 737775] WARN - #o.j.k.i.script - [KOTLIN_SCRIPTING] java.util.ConcurrentModificationException
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:997)
at kotlin.script.experimental.dependencies.maven.impl.AetherResolveSession$remotes$2.invoke(aether.kt:277)
at kotlin.script.experimental.dependencies.maven.impl.AetherResolveSession$remotes$2.invoke(aether.kt:52)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at kotlin.script.experimental.dependencies.maven.impl.AetherResolveSession.getRemotes(aether.kt:52)
at kotlin.script.experimental.dependencies.maven.impl.AetherResolveSession.request(aether.kt:177)
at kotlin.script.experimental.dependencies.maven.impl.AetherResolveSession.resolveDependencies(aether.kt:138)
at kotlin.script.experimental.dependencies.maven.impl.AetherResolveSession.resolve(aether.kt:131)
at kotlin.script.experimental.dependencies.maven.MavenDependenciesResolver.resolve(MavenDependenciesResolver.kt:69)
at kotlin.script.experimental.dependencies.CompoundDependenciesResolver.resolve(CompoundDependenciesResolver.kt:68)
at kotlin.script.experimental.dependencies.AnnotationsKt.resolveFromScriptSourceAnnotations(annotations.kt:70)
at org.jetbrains.kotlin.mainKts.MainKtsConfigurator$processAnnotations$resolveResult$1.invokeSuspend(scriptDef.kt:201)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
The exception occurs when I click on jvm/main-kts/scripts/kotlin-shell.main.kts in Idea.
I also noticed some warnings like this:
WARN - #o.j.k.i.script - [KOTLIN_SCRIPTING] Script configuration for file file:///.../kotlin-script-examples/jvm/main-kts/scripts/kotlin-shell.main.kts was not loaded
I am able to run the scripts, however Idea does not highlight errors or understand the types or support navigating to the definitions found in the scripts.
I'm looking for an example of using custom scripts in a way that allows navigating the scripts with Idea in the usual way.
请先登录再写评论。
I was able to get Idea to recognize the dependencies for the *.simplescript.kts files by adding en empty file named
after invalidating caches, restarting Idea and rebuilding the project. The same method did not work for the example with maven dependencies and the Idea log showed these errors:
Please, file an issue and attach your idea.log. Thank you!