View | Details | Raw Unified | Return to bug 66216 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/compiler/SourceElementParser.java (-20 / +8 lines)
Lines 255-271 Link Here
255
	// the scanner is located after the comma or the semi-colon.
255
	// the scanner is located after the comma or the semi-colon.
256
	// we want to include the comma or the semi-colon
256
	// we want to include the comma or the semi-colon
257
	super.consumeExitVariableWithInitialization();
257
	super.consumeExitVariableWithInitialization();
258
	if (isLocalDeclaration() || ((currentToken != TokenNameCOMMA) && (currentToken != TokenNameSEMICOLON)))
258
	if ((currentToken == TokenNameCOMMA || currentToken == TokenNameSEMICOLON)
259
		return;
259
			&& astStack[astPtr] instanceof SourceFieldDeclaration) {
260
	((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1;
260
		((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1;
261
	}
261
}
262
}
262
protected void consumeExitVariableWithoutInitialization() {
263
protected void consumeExitVariableWithoutInitialization() {
263
	// ExitVariableWithoutInitialization ::= $empty
264
	// ExitVariableWithoutInitialization ::= $empty
264
	// do nothing by default
265
	// do nothing by default
265
	super.consumeExitVariableWithoutInitialization();
266
	super.consumeExitVariableWithoutInitialization();
266
	if (isLocalDeclaration() || ((currentToken != TokenNameCOMMA) && (currentToken != TokenNameSEMICOLON)))
267
	if ((currentToken == TokenNameCOMMA || currentToken == TokenNameSEMICOLON)
267
		return;
268
			&& astStack[astPtr] instanceof SourceFieldDeclaration) {
268
	((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1;
269
		((SourceFieldDeclaration) astStack[astPtr]).fieldEndPosition = scanner.currentPosition - 1;
270
	}
269
}
271
}
270
/*
272
/*
271
 *
273
 *
Lines 580-599 Link Here
580
		this.addUnknownRef(ref);
582
		this.addUnknownRef(ref);
581
	}
583
	}
582
	return ref;
584
	return ref;
583
}
584
/*
585
 *
586
 * INTERNAL USE-ONLY
587
 */
588
private boolean isLocalDeclaration() {
589
	int nestedDepth = nestedType;
590
	while (nestedDepth >= 0) {
591
		if (nestedMethod[nestedDepth] != 0) {
592
			return true;
593
		}
594
		nestedDepth--;
595
	}
596
	return false;
597
}
585
}
598
/*
586
/*
599
 * Update the bodyStart of the corresponding parse node
587
 * Update the bodyStart of the corresponding parse node

Return to bug 66216