Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java =================================================================== RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v retrieving revision 1.123 diff -u -r1.123 Parser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 8 Apr 2003 14:22:41 -0000 1.123 +++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 8 Apr 2003 19:15:28 -0000 @@ -1730,10 +1730,8 @@ cd.constructorCall.sourceStart = cd.sourceStart; } - //watch for } that could be given as a unicode ! ( u007D is '}' ) - // store the endPosition (position just before the '}') in case there is - // a trailing comment behind the end of the method - cd.bodyEnd = endPosition; + // store the ending position of the closing '}' + cd.bodyEnd = endStatementPosition; cd.declarationSourceEnd = flushAnnotationsDefinedPriorTo(endStatementPosition); } @@ -1742,7 +1740,7 @@ // now we know that the top of stack is a constructorDeclaration ConstructorDeclaration cd = (ConstructorDeclaration) astStack[astPtr]; - cd.bodyEnd = endPosition; // position just before the trailing semi-colon + cd.bodyEnd = endStatementPosition; // position of the end of the trailing semi-colon cd.declarationSourceEnd = flushAnnotationsDefinedPriorTo(endStatementPosition); // report the problem and continue the parsing - narrowing the problem onto the method } @@ -2494,9 +2492,8 @@ if (!isNotAbstract) { //remember the fact that the method has a semicolon body md.modifiers |= AccSemicolonBody; } - // store the endPosition (position just before the '}') in case there is - // a trailing comment behind the end of the method - md.bodyEnd = endPosition; + // store the ending position of the closing '}' + md.bodyEnd = endStatementPosition; md.declarationSourceEnd = flushAnnotationsDefinedPriorTo(endStatementPosition); } protected void consumeMethodHeader() { @@ -6536,7 +6533,8 @@ //watch for } that could be given as a unicode ! ( u007D is '}' ) MethodDeclaration md = (MethodDeclaration) astStack[astPtr]; - md.bodyEnd = endPosition; + // store the ending position of the closing '}' + md.bodyEnd = endStatementPosition; md.declarationSourceEnd = flushAnnotationsDefinedPriorTo(endStatementPosition); // report the problem and continue the parsing - narrowing the problem onto the method @@ -6916,7 +6914,7 @@ referenceContext = cd; compilationUnit = unit; - scanner.resetTo(cd.sourceEnd + 1, cd.declarationSourceEnd); + scanner.resetTo(cd.sourceEnd + 1, cd.bodyEnd); try { parse(); } catch (AbortCompilation ex) { @@ -7062,7 +7060,7 @@ referenceContext = md; compilationUnit = unit; - scanner.resetTo(md.sourceEnd + 1, md.declarationSourceEnd); + scanner.resetTo(md.sourceEnd + 1, md.bodyEnd); // reset the scanner to parser from { down to } try { parse();