-
-
Notifications
You must be signed in to change notification settings - Fork 351
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 regression #2846 #2842 #2848
Conversation
ready. |
@@ -539,9 +538,6 @@ private void setModifiersPosition(CtModifiable e, int start, int end) { | |||
} | |||
start = o2; | |||
} | |||
if (explicitModifiersByName.size() > 0) { | |||
throw new SpoonException("Position of CtExtendedModifiers: [" + String.join(", ", explicitModifiersByName.keySet()) + "] not found in " + String.valueOf(contents, start, end - start)); | |||
} |
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.
Is there a legitimate reason why final
modifier would remain in explicitModifiersByName
here?
To be more clear: If I understand correctly, in some/all cases, final
modifiers are left in explicitModifiersByName
and therefor trigger an exception. Am I correct? And if yes, is it a false negative (a wrongfully thrown exception) or are you just allowing AST build to pass with slightly incomplete position information?
because the position information is not perfect in all cases.
|
OK. Works for me! |
This PR was not a fix, it was a workaround. There is indeed a bug in the implementation of positionbuilder and this PR will complexify the implementation of the sniper mode. The bug was that there was no whitespace before or after the modifier and consequently the positionBuilder did not find it and trigger an exception. |
#2854 is good, thanks. Yet, there is a philosophical argument here:
|
fix #2846
fix #2842