Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(no intention to merge)
This is my attempt to see if cross-file j2d/refs would work by using
SymbolSolverCollectionStrategy
as shown in https://javaparser.org/setting-up-for-analysing-a-whole-project/It currently doesn't work, and I seem to have hit a roadblock. Take for example this call to
postIndex
:https://github.com/sourcegraph/lsif-java/blob/4cf52ba51fb1439afbb61e393c4e4cfafc3cd378/src/main/java/ProjectIndexer.java#L57
When I print out the value of
System.out.println(n.resolve());
, wheren
is aMethodCallExpr
forpostIndex
, I get:instead of a
JavaParserMethodDeclaration
. This is problematic because:From https://static.javadoc.io/com.github.javaparser/javaparser-core/3.13.2/com/github/javaparser/resolution/declarations/AssociableToAST.html#toAst--
ReflectionMethodDeclaration
cannot be cast toJavaParserMethodDeclaration
. That means I can't callgetWrappedNode
on it.I did a bunch of GitHub code searches for other uses of
SymbolSolverCollectionStrategy
,getWrappedNode
, etc. and haven't found any workaround. It seems thatReflection*
classes come from jars:https://github.com/opensathishrtskumar/StaticAnalyzer/blob/cd889d4b9fd631ba13dccce1fce340005ea76e86/src/com/analyzer/visitor/GeneralVisitor.java#L75-L82