Bug 120870

Summary: Spurious NLS tag warnings on code with syntax errors
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2005-12-14 09:48:33 EST
20051214-0010

1. enable to warn abou unecessary NLS tags
2. In the following code, all //$NON-NLS-1$ are marked with warnings, but as soon you fix the problem ('int modifiers= ;' to 'int modifiers= 1;') they go away again.

package p;
public class Bar {
	private String constructSimpleTypeStub() {
		int modifiers= ;
		String type= ""; //$NON-NLS-1$
		switch (modifiers) {
			case 1: 
				type= "class ";  //$NON-NLS-1$
				break;
			case 2: 
				type= "interface "; //$NON-NLS-1$
				break; 
			case 3: 
				type= "enum "; //$NON-NLS-1$
				break;
			case 4: 
				type= "@interface "; //$NON-NLS-1$
				break;
		}
		return buf.toString();
	}
}
Comment 1 Olivier Thomann CLA 2005-12-14 09:59:27 EST
I can disable to validation of nls tags in case of syntax errors.
Comment 2 Olivier Thomann CLA 2005-12-14 10:00:00 EST
But ideally we should filter out the nls tags related to the current methods and continue to report the other ones.
Comment 3 Jerome Lanneluc CLA 2005-12-14 10:28:13 EST
David, you might want to look at this case as part of the robust AST work.
Comment 4 David Audel CLA 2006-02-08 11:27:39 EST

*** This bug has been marked as a duplicate of 42253 ***
Comment 5 Frederic Fusier CLA 2006-02-15 12:01:08 EST
Verified for 3.2 M5 using build I20060215-0010.