Community
Participate
Working Groups
Using HEAD stream... In following example: public class Test { public String foo(){ return "";} //$NON-NLS-1$ } the end position of MethodDeclaration for foo is on ';' character in source although its body correctly ends at '}' character. This is really anoying as method declaration ends before its body child... One impact of this is that trailing comment can be associated neither to the method declaration nor to the body. Note that it works with 3.0 => seems to be a regression while merging JDK_1_5 stream. Looking at code, ASTConverter.retrieveRightBraceOrSemiColonPosition(int, int) method now returns now scanner.currentPosition-1 instead of previously scanner.currentPosition when brace is found. Note also that method declaration end position is correct with following example: public class Test { public String foo(){ return ""; } //$NON-NLS-1$ }
I will investigate.
I think that retrieveRightBraceOrSemiColonPosition should be called with bodyEnd + 1 instead of bodyEnd for the first argument. Otherwise the ; is found and its position is returned.
Created attachment 12982 [details] Patch to apply on HEAD Let me know what you think. All tests passed with this patch.
Fixed and released in HEAD. Regression tests added.