Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
dirkaudaz
@dirkaudaz
Hi Everyone. Just starting playing with Javaparser but I would like to ask if this is the right tool for the task I need to accomplish. I need to be able to query for some type of visitable node and build a directed graph/sequence while backtracking up to the root. The idea is to identify the paths affected by a change in the queried node.
2 replies
dirkaudaz
@dirkaudaz
Where should we report issues/bugs found in the book?
1 reply
Jonathan Locke
@jonathanlocke
hello, anyone home? :)
i'm wondering if anyone knows what happened to JreTypeSolver
it doesn't seem to be in the latest javaparser-symbol-solver-core
4 replies
Danny van Bruggen
@matozoid
Wicket! I knew I heard your name before @jonathanlocke :-)
Jonathan Locke
@jonathanlocke
Guilty as charged :)
Jonathan Locke
@jonathanlocke
BTW, thanks for JavaParser, it's really making this job a lot easier.
I guess I should say @matozoid or you won't see this :)
I might have another open source project soon. We'll see if my company goes for it
Danny van Bruggen
@matozoid
Okay, let us know, always good to see what people are doing with it!
Jonathan Locke
@jonathanlocke
WIll do
With your project I created an automatic UML generator that's annotation driven
I might open source that too if they'll let me :)
without the type solvers, it would be impossible. that was a good idea.
ascopes
@ascopes
is javaparser compatible with the javax.annotation.processing API?
4 replies
aiddroid
@aiddroid
Is there anyway to create a methods call CFG via javaparser?
2 replies
Alexander Kardapolov
@akardapolov
Hi everyone! How to build source code in IDEA IDE? Couldn't find any info on the site (step by step). I can build the whole project using mvn clean install but have problems (for example with ParseException.class in JavaParserTest (javaparser-core-testing module) - error message "Cannot resolve symbol 'ParseException'".
6 replies
jessechen09
@jessechen09
image.png
I am an undergrad student using javaparser for a research project. I was just wondering if I did something wrong because many classes seem to be missing. E.g., I cannot find GeneratedJavaParser anywhere. Is this supposed to be a class somewhere?
13 replies
Thanks
Roger Howell
@MysterAitch
image.png
mdproctor
@mdproctor
I saw this, to update antlr grammar, as it's till stuck at java 9. I thought it might interest the group - but cannot sell if actual progress was made though :( https://summerofcode.withgoogle.com/archive/2020/projects/4999687213416448/
looks like the student didn't do it ;( https://github.com/search?q=user%3ANickCuso+antlr
mdproctor
@mdproctor
hmm he's added it to his linkedin https://www.linkedin.com/in/nick-mancuso-961352170/ maybe it's not public. will ping him.
Danny van Bruggen
@matozoid
It really shouldn't be hard to upgrade it to the latest. It's getting people to keep it up to date that is the problem :-)
Danny van Bruggen
@matozoid
Hey @jessechen09 - since you have checked out the source code of JavaParser, are you going to modify it? Maybe it is interesting for the JavaParser project?
jessechen09
@jessechen09

Hey @jessechen09 - since you have checked out the source code of JavaParser, are you going to modify it? Maybe it is interesting for the JavaParser project?

I'm using javaparser to create ASTs, as we need ASTs for our research project. That said I don't think I'll modify it, unless there is a feature that's missing and is an easy fix.

jessechen09
@jessechen09
In the Node class's toString() method, it prints out the node AND its children, so if I toString() a CompilationUnit, it should print out the whole AST, right? However, I am only getting the original class's code. Did I misunderstand something or did I do something wrong? Thanks
3 replies
image.png
TY
@CTY-git

I cant seem to find this in any documentation but how do you add java.lang.* and javax.* Type Declarations to the compilation unit?
or is there a way to check if a type, found by parsing source code, extends a java.lang.* and javax.* class?

I did set the ReflectionTypeSolver for my parser but java.lang.* and javax.* classes are unresolvable. This prevents me from using isAssignable to determine inheritance.

Thiago Henrique Hüpner
@Thihup
Hi all! I'd like to know if it is possible to parse some Expression Language using the JavaParser. While most of the SimpleJavaParse.parseExpression() would work just fine, they have added some changes to the change, like enabling using "eq" instead of "==", and they have added a new syntax for Lists and Sets ([1,2,3,4], {1,2,3}) and for Map ({"key":"value"}).
In this case it is still possible to use the JavaParser?
Roger Howell
@MysterAitch
@Thihup -- it wouldn't work as-is, instead you'd need to work with a forked version of the grammar/program
Thiago Henrique Hüpner
@Thihup
@MysterAitch Thanks
Roger Howell
@MysterAitch
if you do go for it, let us know - it sounds interesting! :)
antlr sounds like it could potentially be a good option too, though I think the latest java grammar isn't very recent
Thiago Henrique Hüpner
@Thihup
Yeah, is it a little outdated, but I only need to parse expressions, not a full class ;)
I have a prototype using ANTLR, but I'd like to reuse other code instead of implementing the Lexer, parser and stuff
Peeradon Sukkasem
@littleheart005
Hi. there! I have been using JavaParser and SymbolSolver for a while. Now I facing a problem (UnsolvedSymbolException) when I try to solve a method call in java class. These are part of my code.
Screen Shot 2564-04-07 at 16.06.46.png
Roger Howell
@MysterAitch
@littleheart005 -- double check your source value -- this is usually the source root (i.e. the place where the default package files would be)
e.g. if Duck is in the package headfirst.strategy, the source root will be the folder above headfirst(i.e. the src directory)
1 reply
aiddroid
@aiddroid
Here's a demo for callgraph: https://github.com/aiddroid/java-callgraph
aiddroid
@aiddroid
alt
Danny van Bruggen
@matozoid
Hey, nice work @aiddroid !
Shall I put it on Twitter?
aiddroid
@aiddroid

Shall I put it on Twitter?

ok

Danny van Bruggen
@matozoid
Several people asked if JP has data flow graph/diagram/analysis support, and I wondered how much effort it would be to build it. It's now in a state that the design is right - lots of stuff still missing though - so I thought I would make it public: https://github.com/matozoid/data_flow_analyser_with_javaparser