Skip to content

Commit

Permalink
[kotlin2cpg] Fix assertion error by locking descriptorRenderer options (
Browse files Browse the repository at this point in the history
#4998)

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 authored Oct 18, 2024
1 parent d879a89 commit 11f92c0
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 11f92c0

Please sign in to comment.