Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kotlin2cpg] Fix assertion error by locking descriptorRenderer options #4998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tajobe
Copy link

@tajobe tajobe commented Oct 11, 2024

DescriptorRendererImpl asserts that the options are locked upon init. This means that the type rendering will fail anywhere with assertions enabled (-ea JVM option) as the options weren't being locked after setup.

In order to test this, I added -ea to the test javaOptions (which requires Test/fork to be true) and things fail. With the addition of opts.lock(), they pass. I'm not sure if there's a reason the tests were explicitly set to not fork or if there's a desire to keep the javaOpts "clean", but this was the easiest way to illustrate the error and fix.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant