Bug 148352

Summary: NLS warning shows up on incomplete code
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Martin Aeschlimann CLA 2006-06-23 03:50:20 EDT
3.2

- create a project and set 'NLS problems' to 'warning'
- the following code has no problems
- remove the semicolon after the ..toString()
- 'unnecessary NLS tag' warning shows up after enclosingType= "";


public class A {
	public static void getCatchBodyContent(String locationInAST){
		String enclosingType= ""; //$NON-NLS-1$
			
		if (locationInAST != null) {
			enclosingType.toString();
		}
	}
}
Comment 1 David Audel CLA 2006-06-23 10:40:31 EDT
This problem is caused by statements recovery because StringLiteral's are consumed twice inside a method body.
Comment 2 David Audel CLA 2006-06-27 03:39:03 EDT
Created attachment 45365 [details]
Proposed patch
Comment 3 David Audel CLA 2006-06-27 04:46:59 EDT
Fix released and test added
  ExternalizeStringLiteralsTest#tesdt017()

Released for 3.3 M1
Comment 4 Frederic Fusier CLA 2006-08-04 11:28:15 EDT
Verified for 3.3 M1 using build I20060804-0010.

I think this could be put in 3.2.1 stream...