Questions tagged [javasymbolsolver]

The Java Symbol Solver that accompanies the Java Parser from javaparser.org

11 questions
2
votes
1 answer

Resolve a type in a context

I have a Spring boot project and I want to parse it and file the dependencies between classes I am using the JavaSymbolSolver to find out the Class Name public static void main(String[] args) throws Exception { Set
2
votes
0 answers

Unsolved method call expression reference in case of enum statements

I'm facing a problem when trying to solve a method call expression which reference a declaration in a enum statement. Following, I leave a detail of my code. public enum EscapeMode { ... some code ... EscapeMode(String file, int size) { …
2
votes
1 answer

JavaSymbolSolver: get field's fully qualified name

I use JavaParser (from javaparser.org) and javasymbolsolver to parse Java. I have a simple Java source that accesses File.separator (see the multi-line string in the source); I want my program to print java.io.File.fileseparator. Instead, it prints…
18446744073709551615
  • 16,368
  • 4
  • 94
  • 127
1
vote
1 answer

How to resolve a Maven project?

I have a Maven project using lombok and other external dependencies. I would like to add it to the resolver so that I can work on any of the generated Java files. So far I have tried JavaParserTypeSolver and JarTypeSolver and even tried delomboking…
Saif
  • 2,530
  • 3
  • 27
  • 45
1
vote
1 answer

JavaParser and SymbolSolver for Eclipse Scout

I want to analyze dependencies among classes which I have started using JavaParser and it's SymbolResolver for. But it keeps failing when resolving several of the method references on a sample project from Eclipse Scout. Scout uses it's own BEAN…
jofroe
  • 431
  • 1
  • 5
  • 14
1
vote
0 answers

Exception in thread "main" java.lang.IllegalStateException: No data of this type found. Use containsData to check for this first

i tried to get the inherited methods and fields from java source code but i have this problem : i tried to find inherited methods and fields from each class in my file which contained java code source , the syntax is correct but i have some errors…
1
vote
1 answer

How to Parse static level variable from the JAVA file?

I'm trying to Parse the static variable value from the JAVA file. But couldn't be able to parse the variable. I've used JavaParser to Parse the code and fetch the value of variable. I got success in fetching all other class level variable and value…
Joshi Yogesh
  • 142
  • 1
  • 12
0
votes
0 answers

JavaParser SymbolSolver and JGit to find method qualified name for a given commit

Consider the following code: mt.resolve().getQualifiedSignature(); Here mt is of type MethodDeclaration, and it might come from a MethodCallExpr. Now in order it to work accurately, I need to set the following: CombinedTypeSolver…
0
votes
1 answer

How to use JavaParser to walk over all the nodes of AST (abstract syntax tree) of some Java source code?

I am trying to build a translator of Java source code to other object-oriented programming languages. For this I want to traverse the whole AST (generated by JavaParser) and gather each and every component of the Java source code and then…
0
votes
1 answer

How to get the variable real type using JavaSymbolSolver

The code is here, class Bar { private int a; void aMethod() { while (true) { String a = "0"; a = a + "1"; } } } I want to get the real type of a. I tried to use the code below, public class…
heshuguo
  • 21
  • 4
0
votes
1 answer

javaparser Symbol solver: I can resolve inherited classes of a class but cannot resolve anything else

I have setup the JavaSymbolSolver like below: Instance Variables: private CombinedTypeSolver combinedTypeSolver = new CombinedTypeSolver(); private JavaSymbolSolver symbolSolver; private ParserConfiguration parserConfiguration = new…
nfountou
  • 11
  • 4