-
Notifications
You must be signed in to change notification settings - Fork 278
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
Replace javasrc2cpg ReflectionTypeSolver with JdkJarTypeSolver at java home #3006
Conversation
combinedTypeSolver.add(new CachingReflectionTypeSolver()) | ||
val jdkPath = config.jdkPath.getOrElse { | ||
val javaHome = System.getProperty("java.home") | ||
logger.debug("No explicit jdkPath set in config, so using system java.home at $javaHome") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is definitely worth logging as INFO
} | ||
} | ||
|
||
enum JavaSrcEnvVar(val name: String, val description: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perhaps excessive for a single environment variabl, but I also think that, if environment variables are going to be used for configuration, they should be documented somehow and easily discoverable. I plan to extend this idea to the rest of joern (I know at least php2cpg uses some environment variables as well), but put this here since it's currently limited to javasrc.
Unit tests are running into |
// This should really be a print-and-exit but, with the current scopt setup, input paths | ||
// are still required, so for now `javasrc2cpg --show-env <inputs>` is less confusing | ||
// than `javasrc2cpg --show-env <dummy input to keep scopt happy>` | ||
.text("print information about environment variables used by javasrc2cpg prior to analysis") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to the comment that this prevents the frontend from doing its actual task.
Running just the |
76cadb7
to
700fe37
Compare
Running tests from different subprojects in parallel seems to bring us to the limits...
3bb01e4
to
cacd5cf
Compare
Using the
ReflectionTypeSolver
and theJdkJarTypeSolver
with jars from the current runtime java home give similar, but not identical results. This is problematic for getting consistent results, particularly when updating expectations for SP tests. This PR switches to theJdkJarTypeSolver
as the single "java stdlib" type solver for the sake of consistency.