-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed issue #2909 + improved general test #2928
Conversation
* | ||
* @param className the class name (case-sensitive) | ||
*/ | ||
public List<ClassOrInterfaceDeclaration> getLocalDeclarationFromClassname(String className) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this public method is an API change -- is there a way to avoid removing it?
Preferably we would deprecate the method first, with javadoc to explain that it does not work in some cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course no problem with it, I thought that it has no purpose anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where there's an alternative preferred way to do it, deprecate it and explain what the alternative is please :)
(perhaps rewrite the content of the method to use the alternative technique too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem. So I will revert the commits with method deletion, and add javadoc to the new method.
if (parent instanceof ObjectCreationExpr && !((ObjectCreationExpr) parent).getArguments().contains(node)) { | ||
return parent; | ||
|
||
protected TypeDeclaration<?> findContainingTypeDecl(Node node, String className) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The javadoc for both findContainingTypeDecl
and findContainingTypeDeclOrObjectCreationExpr
has been removed - is that deliberate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, maybe we can keep the removed method with its java docs, and add java docs to both new methods.
Thanks @deadlocklogic ! ❤️ Seeing so many parameters and nested if/else if/else blocks raises an eyebrow. I'm really not sure how else it could be written though, so don't really have a suggestion of my own! What are your thoughts? :) |
6d04356
to
045575a
Compare
Your welcome man! Thanks for all your efforts and the community for maintaining this awesome library. Lines 240 to 260 in 045575a
I had few questions about few things in general, is the gitter chat quite active?
Actually I am finding many more room for improvements, and still there is a tons of TODOS/empty stubs in the solver module. |
On behalf of all the folk who put in MASSIVE amounts of work to get it this far, we appreciate the kind comments! ❤️
Gitter seems to ebb and flow. We all try to chip in when we can. Personally I struggle to keep up when things are threaded (especially on the mobile app!). For substantive questions that need a bit of investigation/thought, the issue tracker here is probably best -- and for shorter/simpler questions, try gitter 👍 As for the numbered questions:
Yep, the parsing side of things is pretty solid! Symbol solving is the impressive work of @ftomassetti who built it nearly single handedly!! Since bringing it into the main project a bunch of us have helped to build it up and fill in bits here/there ( @jlerbsc has been doing a LOT of work with JavaParser recently), but it's a tricky beast with lots of moving parts -- necessarily so, given that references can be resolved via reflection/jars/source code etc, each with slightly different features/behaviours! All help to put together test cases and fix any gaps in coverage/functionality is very much welcomed! 👍 |
Yes of course, and since I am building a java transpiler based on this library I guess I can provide huge feedback on the solving part especially because the parsing part so far is pretty robust. I can even create a dedicated folder for all my tests which will include all combinations of syntax nesting/order I will ever face probably. |
So just to be 100% sure: following your reasoning on my first question, when invoking package test;
class Program {
class OuterClass {
class InnerClass {
InnerClass() {
OuterClass outer = OuterClass.this;
}
}
}
} In current implementation it doesn't, in fact it is as broke as Maybe because using a typeName before these expressions is not so common anyway unless there are identifier names clashing and we need finer control to invoke enclosing class members. |
Short answer: I don't know! With the disclaimer that this is all from memory (I'm on mobile)... I think that If Not sure how this applies to the test cases (I'll take another look in a while when I'm back on computer), but hope this helps to clarify things! :) |
Need to bring out the big guns on this one! Maybe some other time I will ask it on gitter if I couldn't find out myself. Thanks anyway! |
I added this comment on #2931 so I'll leave it here too for comment.
|
The thing is that we use |
I will close this PR hoping #2931 fixes the issue as it looks like. |
Fixes #2909.