Bug 148352 - NLS warning shows up on incomplete code
Summary: NLS warning shows up on incomplete code
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-23 03:50 EDT by Martin Aeschlimann CLA
Modified: 2006-08-04 11:28 EDT (History)
0 users

See Also:


Attachments
Proposed patch (6.16 KB, patch)
2006-06-27 03:39 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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...