-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Fix: fix pretty-printing of imports for static methods #3716
Conversation
Thanks @danglotb ! Are you trying to fix it? |
Hi @monperrus, I'll investigate how to. Does the test seem correct? Do you think I can use it as a base to fix the issue? |
Hi, @monperrus. Here my attempt. This pull-request closes #3214 and maybe it closes #3618. |
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.
Thanks a lot for the fix. LGTM, see mino comments.
Plus we have a no CI run, see #3600
@@ -85,7 +85,7 @@ protected void handleTargetedExpression(CtTargetedExpression<?, ?> targetedExpre | |||
return; | |||
} | |||
|
|||
if (target != null && target.isImplicit()) { | |||
if (target.isImplicit()) { |
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.
What about keeping target != null
to avoid crashing with NPE on target.isImplicit
?
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.
This check is redundant with the check just above(here):
if (target == null) {
...
return;
}
If target == null
, the condition target.isImplicit()
will not be hit, isn't?
OK for me. Unwip? Ready for merge? |
Thanks a lot @danglotb |
Hello,
I'm opening this pull-request that contains a test to reproduce the bug reported in #3618 and #3214.
Thank you