analyze-java-code-examples icon indicating copy to clipboard operation
analyze-java-code-examples copied to clipboard

Use of this examples in conjuntion with javasymbolsolver to filter specific variables delcarations.

Open TheTechOddBug opened this issue 8 years ago • 2 comments

Hi @ftomassetti ,

First of all, thank you very much for your explanations in your blog and your examples here. I'm trying to use JavaParser and JavaSymbolSolver to find all the declarations of variables belonging to specific classes (although project-defined ones) and I've started using this example and trying to combine with examples of JavaSymbolSolver in JavaSymbolSolverExamples, but using the build.gradle in this example and adding the dependency for JavaSymbolSolver found the build.gradle of that JavaSymbolSolver examples, I obtain one non-relevant error with node.getBeginLine() and node.getEndLine() methods. The important thing that I'm not able to solve is the use of ReflectionTypeSolver.

As I said before, I'm trying to find the way to search inside all code of one project to obtain all variables of one type. For example, finding all the variables of type javax.swing.JFrame. I would be grateful if you could help me.

TheTechOddBug avatar Jan 29 '17 22:01 TheTechOddBug

Hi, what I could do is to write a post on this subject in coming weeks. I should probably also release a new version of JavaSymbolSolver because the last version currently released works with an older version of JavaParser.

ftomassetti avatar Jan 30 '17 07:01 ftomassetti

Thank you very much for your answer. I'll review your new post when available. In the meantime, could you tell me which versions of the both libraries should I use and how can I include (if it is possible) ReflectionTypeSolver in my CombinedTypeSolver instance? Again, thank you very much in advance for your help and answers.

TheTechOddBug avatar Jan 30 '17 12:01 TheTechOddBug