-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix FQN regression in FQN mode #1052
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ith an or instead of an and. Now the test is failing, proof that the assertion is checked :)
… a local variable in the same block or by a field (or a variable in another block). First detection implemented but patch not satisfying.
Solve in using version of inria/master
…er to only consider name collision in the scope to do imports. WiP.
surli
commented
Dec 19, 2016
/** | ||
* Determine if the ImportScanner should work in a FQN mode or in auto import mode. | ||
*/ | ||
private boolean fqnMode; |
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.
handle with polymorphism
surli
commented
Dec 19, 2016
@@ -10,11 +10,16 @@ | |||
import spoon.reflect.declaration.CtElement; | |||
import spoon.reflect.declaration.CtType; | |||
import spoon.reflect.visitor.Filter; | |||
import spoon.reflect.visitor.PrettyPrinter; |
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.
don't touch this test
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previously implemented
MinimalImportScanner
was only comparing FQN against list of previously explored variables, which means all variables were considered even those which were not on the scope of the current variable. It fixes issue #1045.The proposed implementation now only check the current scope to search name collisions.
Moreover, now the ImportScanner is recreated in DefaultJavaPrettyPrinter when
calculate
method is called: it avoids the scanner to test collision names against another class variable names, but it should also fix #1041 (to be tested).