Conversation
|
ready. |
| } | ||
| 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.
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