Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Federico Tomassetti
    @ftomassetti
    but you can disable the whole thing if you are not interested in comments
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    that would mean that for those refactoring guys we should stick to the NameExpr and try to get rid of the String names
    Federico Tomassetti
    @ftomassetti
    mmm
    it could help maybe have a Node instead of a String (to know also the position), however I would not use NameExpr. To me NameExpr should be used for names inside expressions (like a variable name).
    I mean, I am not sure exactly what NameExpr is supposed to be but that suffix definitely confuse me. I guess a node named Name would make more sense to me
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    Well, you just hit another inconsistency I feel
    NameExpr is oftentimes used when not dealing with an expression
    Federico Tomassetti
    @ftomassetti
    this sounds bad to me, it could be worthy to fix this
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    I mean, it can technically only be a java identifier
    or, via its subclass QualifiedNameExpr, a concatenation of java identifiers
    which is no "expression" after all
    Federico Tomassetti
    @ftomassetti
    I guess so but, for example, looking for all nodes which implements Expression it would be found, and this is based
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    or, rather, it is no statement... wait
    I'm mising things up
    mxing
    mixing, goddammit
    Federico Tomassetti
    @ftomassetti
    no worries :)
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    should better go to bed ;)
    Federico Tomassetti
    @ftomassetti
    we can also talk about that tomorrow, no hurry (I guess you are on the Berlin timezone, right?)
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    yes I am...
    Dublin, is that correct? It's 22:15 there?
    Federico Tomassetti
    @ftomassetti
    exactly :)
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    nice... more time for you still :)
    OK, NameExpr makes sense for statements like int a = b;
    so b is a NameExpr
    Federico Tomassetti
    @ftomassetti
    that would make sense to me
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    it could also be 1 + 1
    Federico Tomassetti
    @ftomassetti
    but a should not be a NameExpr
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    which would be a UnaryExpression or something, don't pin me down
    that's where we need a NameExpr
    yeah, a is a VariableDeclaratorId
    Federico Tomassetti
    @ftomassetti
    guess so, and it makes sense to have a NameExpr because to understand what is really is (a reference to a local variable or a field) we should need to do names resolution, which we do not do
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    which has a private String name
    currently, this makes the most sense to me
    If we wanted to have the positioning information, we should not use NameExpr, but come up with another node
    like Identifier or something
    Federico Tomassetti
    @ftomassetti
    agreed
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    which it technically is... it may not sound so charming
    Federico Tomassetti
    @ftomassetti
    in this way comments could be also associate directly to the name in some cases (corner cases, definitely a minor benefit)
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    that would mean we would need to adapt the .jj file and practically all the files that are NamedNodes
    nice
    Federico Tomassetti
    @ftomassetti
    that could take a while :) Luckily we have a good number of tests I think
    however we can do that in steps maybe
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    yeah, this .jj stuff is a real fun
    So as part of this issue?
    Federico Tomassetti
    @ftomassetti
    it could make sense, maybe I could start publishing a first draft of the pull request after changing a few cases, assess it and proceed from there
    Sebastian Kirsch (@skirsch79)
    @sebastiankirsch
    sounds good
    Federico Tomassetti
    @ftomassetti
    cool
    7602
    @7602
    Hi , I'm working in a code with javaparser, I have to calculate the maximum length from the node to the root of a tree(AST), I'm thinking to use getAllAncestors but it's not a good idea because I want a value of this length,... I'm thinking also to use getParents and { c=myNode.getParents(); if (c != null) { c.getParents().get(); value++}} ... but it doesn't work . Also I'm pretty new to use javaparser.
    Finn Bauer
    @bauefi
    Hi Guys, I have just started working with javaparser and its really awesome. However, since yesterday your javadocs are not reachable anymore. The link your website does not work anymore: https://www.javadoc.io/doc/com.github.javaparser/javaparser-core/