Index: model/org/eclipse/jdt/internal/compiler/SourceElementParser.java =================================================================== RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java,v retrieving revision 1.1 diff -u -r1.1 SourceElementParser.java --- model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 10 Mar 2004 10:06:53 -0000 1.1 +++ model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 9 Jun 2004 18:15:02 -0000 @@ -255,17 +255,19 @@ // the scanner is located after the comma or the semi-colon. // we want to include the comma or the semi-colon super.consumeExitVariableWithInitialization(); - if (isLocalDeclaration() || ((currentToken != TokenNameCOMMA) && (currentToken != TokenNameSEMICOLON))) - return; - ((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1; + if ((currentToken == TokenNameCOMMA || currentToken == TokenNameSEMICOLON) + && astStack[astPtr] instanceof SourceFieldDeclaration) { + ((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1; + } } protected void consumeExitVariableWithoutInitialization() { // ExitVariableWithoutInitialization ::= $empty // do nothing by default super.consumeExitVariableWithoutInitialization(); - if (isLocalDeclaration() || ((currentToken != TokenNameCOMMA) && (currentToken != TokenNameSEMICOLON))) - return; - ((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1; + if ((currentToken == TokenNameCOMMA || currentToken == TokenNameSEMICOLON) + && astStack[astPtr] instanceof SourceFieldDeclaration) { + ((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1; + } } /* * @@ -580,20 +582,6 @@ this.addUnknownRef(ref); } return ref; -} -/* - * - * INTERNAL USE-ONLY - */ -private boolean isLocalDeclaration() { - int nestedDepth = nestedType; - while (nestedDepth >= 0) { - if (nestedMethod[nestedDepth] != 0) { - return true; - } - nestedDepth--; - } - return false; } /* * Update the bodyStart of the corresponding parse node