Community
Participate
Working Groups
class A { public void foo() { int i= 0; switch(i) { } } } Range of switch statement in source [48,63], but source end of switch node is 62. To be consistent with a block the sourceEnd should include the trailing }. Same is true for a try statement.
Agreed
Do we want to fix it in the actual parser or do we want to wait for the new AST nodes?
We have a work around for this in the current refactorings. Its ok to fix it in the new AST
I wanted to prevent from changing the positions inside the compiler AST nodes, but I discovered some inconsistencies for the end position of if statements. Then I update the positions of switch, try, if statements and the right start positions for parameters (void foo(final String s) now starts on the f of final). I will send you an updated parser and you can try it. Let me know asap if this is fine for you.
I will release changes that set the right positions for the try and switch statements. It fixes also inconsistencies in the if statements positions and fixes the source start of the argument. It will be up to you to fix the refactoring according to these changes. Let me know before end of today if you have any problem with that.
Fixed and released in HEAD.