Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Roger Howell
@MysterAitch
I saw a few comments recently about IDE support being generally in place for annotations with that name even if they're not one of the "standard" few provided by tools, and it got me thinking! :)
Danny van Bruggen
@matozoid
Only a side note there: JP is a library that really LOVES Optional. I introduced that a few years back, and I often wondered if it was a good decision. I think, by now, that I would prefer to replace all Optionals with some kind of annotation. The only drawback is that you can't do fancy map/ifpresent stuff anymore.
But, to show the good side too: introducing consistent Optional usage and parameter null-checks did completely, 100% stamp out all null-pointer related issues. And there were a lot!
Roger Howell
@MysterAitch
Yep - there are places where optional isn't (yet) used, and the annotation would be one way to report where it hasn't yet happened and verify that we've not missed any / accidentally re-introduced any
I'm also asking for personal projects too :)
Roger Howell
@MysterAitch
In other news, I've just pushed up a gradle sample project :)
Danny van Bruggen
@matozoid
Oh wow, the junit from the sample projects is really outdated!
But good!
That comment seems to be from the time when ifBinaryExpr didn't exist yet: // Figure out what to get and what to cast simply by looking at the AST in a debugger!
Betty-Wong
@Betty-Wong

I did not answer it because I did not make a technical analysis of that project for the reasons I explained.

Yes, so you say, but I'm still trying to make sense of it. You say that Mr. Revusky, the main developer of JavaCC21, sent you insulting emails, he was obviously infuriated at you, that seems clear enough, and according to you, this took place for absolutely no reason. "Totally unprovoked" was the term you used, and as a consequence, you make no "technical analysis" of the JavaCC21 project and also tell other people not do so. I have to be totally honest and say that your story just makes no sense. You know, actually, it seems like a trivial exercise in critical thinking to realize what really happened. More or less, anyway. You were adamantly ignoring Revusky's work and telling other people to do the same, and Revusky realized what you were doing, and as a consequence became infuriated at you. Surely that's what really happened, no? So, your version of events is inverting cause and effect. You claim that you are ignoring Revusky's work because he got infuriated at you. I mean, that makes no sense and the opposite direction of causality gives us a story that roughly makes sense. Revusky gets infuriated at you because you are ignoring his work and encouraging others to ignore it. I mean, c'mon. Even as famously irascible person as Mr. Revusky does not get that angry at people for absolutely no reason! So, that's my honest reaction to what you are saying. Though the other question is why we should care anyway. I mean, look, it's a rough and tumble world out there. For me and the other people on my team to care that Mr. Revusky flamed you, what, 6 months ago? Look, why don't you take it as a badge of honor? I see that far more worthy people than you have been flamed by Revusky. You should be proud! Besides, my woman's intuition tells me that you probably deserved to get flamed and you might as well take your lumps and not whine about it. Nobody likes a whiner, you know. I can tell you that women find it unattractive in a man.

Betty-Wong
@Betty-Wong

(I am inclined to think of this being analogous to boycotting a clothing company because of the vile views of it's owners re: oppressing LGBT rights or promoting child labour or bullying or some other horrid and offensive behaviour ---- even if the quality of the clothing (software) is technically amazing, I'm not going to shop there (use the software)... and if I feel particularly strongly I'll spread the word and encourage others to boycott that particular range of products (software) irrespective of how technically awesome it is)

Well, well, young man! Correct me if I'm wrong, but you're some kind of naive student who has never really lived in the real world. Now, granted, I'm not in favour of oppressing LGBT people or anybody else, but I don't go to a clothing shop to get preached to about so-called gay rights or preach to other people about such things. Like any normal person, I go there to buy clothes. Most ordinary people are in a constant struggle to get to the end of the month, pay their bills, put food on the table and so on, and shopping in one place or another based on the politically incorrect views of the business's owner is a luxury they can't afford. It's really the kind of stuff that naive, idealistic students or academicians who never really grew up talk about.

Finally, though, I don't think that's the main point. You see, I have a fiduciary responsibility to my client to serve his/her/their best interest, right? That would mean recommending the best technical solutions, no? Or put it this way: even if I felt so strongly about "LGBT rights" or whatever social justice stuff, would it be right to saddle my client or employer with a technically inferior solution because of that? Far more likely than not, my client or employer does not give a hoot about so-called "gay rights" and just wants the best technical solution. So how do you resolve that inherent contradiction? I guess you could argue that you should only work for clients or companies that share the same beliefs as you, like just how important "gay rights" are, so that you are attuned on that question. But again, frankly, this is a concept typical of naive students who've never lived in the real world.

Maybe what it really gets down to is the concept of "due diligence". Mr. Tomassetti is suggesting that I dispense with any due diligence in terms of evaluating JavaCC21 because he doesn't like the tool's main author, Mr. Revusky. Suppose somebody asks me why I did not consider using JavaCC21, since it is pretty clearly the best tool in its space. So, did I doe due diligence when making that decision? And my answer is that there was no need for any such due diligence because somebody on the Internet told me he doesn't like Mr. Revusky... Mr. Revusky said some nasty things to him for absolutely not reason, so he says. But this is where it gets very weird. You guys don't like Mr. Revusky but it's pretty safe to say that Mr. Revusky doesn't like you guys very much. So, if I should not use his work because you guys don't like him, by the same logic, I should not use your work because he doesn't like you! And then there's always somebody who doesn't like somebody else, so pretty soon, I can hardly use any software product out there!

I don't know about you but my way of resolving these quandaries this is: I just ignore personal spats between people and do a proper technical evaluation of the various options in the space. That way, I meet the fiduciary obligation to my client and I can do work that I take pride in, to the best of my ability.

Roger Howell
@MysterAitch

Well.. I'm not sure where to start... It seems we are going around in the exact same circles as before, just with a little less explicit profanity...

With respect to "Betty-Wong" -- On the balance of probabilities it appears that this is a puppet account created for the sole purpose of arguing about/for the fork of javacc. For that reason, I have banned this account. The "Betty Wong" account is brand new ("Joined yesterday"), has no projects and no activity on github, is coincidentally created just moments after the real "revusky" account got banned from this gitter channel (following the most recent spate of hostile emails).

This channel is public, which means you'll still be able to read this without being logged into the banned account - If I am wrong, then I do truly apologise. If you would like to contribute to or discuss javaparser, do feel free to message me directly about removing the ban.

For now, however, we really must draw a line under this, and return to javaparser-related chat.

Federico Tomassetti
@ftomassetti
Thank you. I hope we can go back to helping people. I am sorry for those who got annoyed by this
Roger Howell
@MysterAitch

Oh wow, the junit from the sample projects is really outdated!

Oops, yeah.. that's the version intellij inputted by default when creating a gradle project!

re: the comments / the content of the sample project, I was lazy and just copied across the maven sample :wink:

both could probably use an update though :)

Danny van Bruggen
@matozoid
Yeah, I'm aware I made the errors in the comments ;-)
Roger Howell
@MysterAitch
haha, sorry -- I didn't mean it like that! my bad!
Danny van Bruggen
@matozoid
Just kidding
(I made worse errors :-# )
mdproctor
@mdproctor
@MysterAitch @Betty-Wong @ftomasse_twitter my general concern here is less about finding random people and telling them to be nice (because people can do what they want in their own space) but more about the risk assessment on adoption any technology within my organization. By risk I mean does it have a healthy community, beyond a single person - we do not want to be on the hook to owning and maintain something ourselves if the lead developer stops doing it. In the case of JacaCC21 it's a single person project with no community, so that's potentially a huge risk for us. So then I had to evaluate on whether this technology is potentially interesting, if we could grow that community. In the case of JavaCC21, I saw the potential, but the behaviour was extreme and this would mean the community will not grow. I tried to coach, it made things worse. So without a current path forward to growing a community, the risk is too high for us. Now maybe he makes enough progress that people find his work interesting (he needs to get recovery and LSP working to be of real interest) and with that confidence he starts to calm down... I dunno. for now I'll avoid wasting time there. I think it's a shame, the project clearly has a lot to offer, and he has a lot of passion. but he's fighting shadow demons of his own imagination.
Danny van Bruggen
@matozoid
From the viewpoint of me, having maintained this project for five years, and having been in IT consultancy for twenty: I learned that often the smartest people find it hardest to work with other people. They may be right most of the time, but what will happen is that this person will start to dominate the project, making other contributors feel unappreciated. Eventually everyone will stop contributing except for the smartest one. He/she gets bored, starts working on something else and oops, project is dead. Smart people lacking social skills kill projects. A painful truth :-(
(One reason I quit is because I felt I was scaring contributors off with my behvaiour :-D )
MarcosCosmos
@MarcosCosmos
Yeah... that checks out.
tpavel-aspose
@tpavel-aspose
Hi. Can I normalize braces? Per line. And restore missing braces.
2 replies
andrey49
@andrey49
Hi. I try to format the signature of the method according to the template as follows method.getSignature().getParameterTypes()
.forEach(type -> {
type.setData(Node.LINE_SEPARATOR_KEY, LineSeparator.CRLF);
});, but it does not work. I will be grateful if you help or tell me how to do it.
The template that should come out looks like this: method (
String str,
Integer i,
Double d
) {
4 replies
fahd
@debbicce_gitlab
Navigator.findNodeOfGivenClass is this deprecated ? it does not seem so in the documentation, is there an alternative ?
2 replies
jean pierre Lerbscher
@jlerbsc

Navigator.findNodeOfGivenClass is this deprecated ? it does not seem so in the documentation, is there an alternative ?

Depending of what you want to do you can use for example cu.findFirst/findAll(<your expression or class>)

sunilhyd
@sunilhyd
I was trying to print out a Whole Java Program using the Void visitor. I was getting errors. Does anyone have a sample to print out a Java program with comments? Kindly share. Thanks
2 replies
tpavel-aspose
@tpavel-aspose
I need it to keep code convention in review code
sunilhyd
@sunilhyd
Same idea, to refactor code, not just pretty print. Some modification to method signatures at times.
johnicesea
@johnicesea
how can i get the parameter type full name?
3 replies
Danny van Bruggen
@matozoid
To apply a set of formatting rules to code after a change, a tool like Spotless is useful: https://github.com/diffplug/spotless/
lossend
@lossend
how can i get parametertypes from a method declaration string, for example, a method declaration string:"enrichAtmosphereIcon(CartItemComponentInput input,final ICartItemResultCO iCartItemResultCO)", i wish the result is "enrichAtmosphereIcon(CartItemComponentInput,ICartItemResultCO)"
1 reply
NARASIMHA RAO
@_sunkara_twitter
HI am using Static Java parser and in method visitor would like omit the method parameters from methodexpr ( example : entityStatuses.get(i).getDataSourceTimeStamp().get(dataSource) --> entityStatuses.get.getDataSourceTimeStamp.get ) is it possibel ?
5 replies
Danny van Bruggen
@matozoid
Hey, happy holidays, christmas, new year, and everything everone!
Federico Tomassetti
@ftomassetti
Happy holidays to everyone!
NARASIMHA RAO
@_sunkara_twitter
Hi which expression catches this kind of statement -- vCatType.getId() == 4 ? cGSTINN : vGSTINN
2 replies
jean pierre Lerbscher
@jlerbsc
Merry christmas to everyone
Ryan Warren
@ryantbwarren
Hi everyone, I hope you are all having a wonderful holidays :) I am new here (both to gitter and the JavaParser community) so I do apologise if this has been asked before.. I wanted to know if there is any way to see how many potential compilation units exist within each SourceRoot for a given ProjectRoot before parsing them? The ProjectRoot I have contains 26 SourceRoots but I can't seem to figure out how to check how many potential compilation units there will be other than potentially performing an addition parse to collect the compilation units first, however I'd rather avoid having to do this as there are many compilation units in the projects and caching all of them might not be a possibility? Any advice is greatly appreciated!
3 replies
greggers123
@greggers123

Hi, Happy New Year everyone - I think I've found a new issue, I tried searching but didn't find anything that looked similar.

I encountered this when running against some code that makes use of log4j and has a call like this - logger.traceEntry("" + fee) - The fee variable is a double.

The log4j library has two trace methods that take a String and optional values, in this scenario javaparser throws an IndexOutOfBoundsException.

I've created a simple test - this class throws the exception:
`
public class AParserTest {

public void log() {
    double fee = 0.1;

    doSomething("" + fee);
}

private void doSomething(String string, Supplier<?>... supplier) {

}

private void doSomething(String format, Object... params) {

}

}
This doesn't:
public class AParserTest {

public void log() {
    double fee = 0.1;

    doSomething("" + fee);
}

private void doSomething(String string, Supplier<?>... supplier) {

}

}
`
Javaparser is expecting to find a second argument in MethodResolutionLogic.isExactMatch but doesn't find one, because it's optional. I'm not doing anything fancy in the javaparser call, just calling resolve() on the MethodCallExpr.

2 replies
Roger Howell
@MysterAitch
Wow, @jlerbsc is on a roll with the super fast turnarounds on bug fixes!! 😵😵😵
Danny van Bruggen
@matozoid
If @jlerbsc has a kofi account, I'll buy him a coffee :-)
Danny van Bruggen
@matozoid
greggers123
@greggers123

Hi all - I think I have found an issue... java.io.File contains the overloaded method 'listFiles', one takes a FileFilter and the other a FilenameFilter, both of which are functional interfaces, the former taking a single File argument and the later taking File and String arguments.

When the parser sees a call like this, it struggles to work out which method is being called and throws a MethodAmbiguityException:

File[] newFilesToRegister = directory.listFiles((dir, name) -> {
...
}

The two arguments in the argument list for the lambda expression should allow the parser to determine which method is being called.

I see a closed issue #2775 that talks of a similar thing but was deployed in 3.16.2 - I'm using 3.18

2 replies
jean pierre Lerbscher
@jlerbsc

If @jlerbsc has a kofi account, I'll buy him a coffee :-)

If @jlerbsc has a kofi account, I'll buy him a coffee :-)

Thank you. I'm just using JP in my work and I'm just trying here to spend some time to get to the community what this project brings. I think that's the spirit of open source. For the moment I am spending a few days of family vacation in Martinique (in the sun). I'm going to do a little pose ;-)

Danny van Bruggen
@matozoid
Yes, I think that is the spirit too. Good of you to follow it! Enjoy the island :-)
kauron
@kauron:matrix.org
[m]
Does anyone here know how to turn a ResolvedReferenceTypeDeclaration into a ResolvedReferenceType or viceversa? If this question is more suitable as an issue, I can file one.
kauron
@kauron:matrix.org
[m]
my current approach is new ReferenceTypeImpl(resolvedReferenceTypeDeclaration, typeSolver), where typeSolver is the CombinedTypeSolver used to setup javaparser's configuration