Skip to content

Commit

Permalink
[kotlin2cpg] Fix assertion error by locking descriptorRenderer options
Browse files Browse the repository at this point in the history
DescriptorRendererImpl asserts that the options are locked upon init. This means that the type rendering will fail anywhere with assertions enabled (`-ea`) as the options weren't being locked after setup.
  • Loading branch information
tajobe committed Oct 11, 2024
1 parent e0e493d commit d52a96e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion joern-cli/frontends/kotlin2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ libraryDependencies ++= Seq(

enablePlugins(JavaAppPackaging, LauncherJarPlugin)
trapExit := false
Test / fork := false
Test / fork := true
Test / javaOptions ++= Seq("-ea")
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class TypeRenderer(val keepTypeArguments: Boolean = false) {
case _: ErrorType => cpgUnresolvedType
case t => t
}
opts.lock()
new DescriptorRendererImpl(opts)
}

Expand Down

0 comments on commit d52a96e

Please sign in to comment.