Bug 114077

Summary: No NLS Warning if unnecessary nls tag before declaration
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benno Baumgartner CLA 2005-10-28 05:29:06 EDT
Version: 3.1.0
Build id: I20051025-0800

Having Non externalized strings set to warning and having the code:

public void foo() {
	String s1= null; //$NON-NLS-1$
	String s2= "";
}

Then no warning is shown for s2. Also having:

public class E1 {
	private String s1= null; //$NON-NLS-1$
	
	public void foo() {
		String s2= "";
	}
}

No warning is shown for s2. It seams as if the compiler thinks that the non nls
tag for s1 belongs to s2.
Comment 1 Olivier Thomann CLA 2005-10-28 12:31:15 EDT
Fixed and released in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.compiler.regression.ExternalizeStringLiteralsTest.test015/016.
Comment 2 Frederic Fusier CLA 2005-10-31 05:57:12 EST
Verified for 3.2 M3 using build I20051031-0010