Bug 18414

Summary: NLS Tools: Find strings and compiler warning out of synch
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 F3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Result I got in F2 none

Description Dani Megert CLA 2002-05-31 04:15:16 EDT
The compiler does not warn about non-externalized strings if the code is not
compiled e.g. for the following code with DEBUG= false;
if (DEBUG)
  System.out.println("mmm");
On the other hand the NLS tool reports that string as not being externalized.
Comment 1 Erich Gamma CLA 2002-05-31 13:00:56 EDT
moving to JDT Core for comment. 
Comment 2 Olivier Thomann CLA 2002-06-03 14:46:44 EDT
Cannot reproduce. If the compiler settings are changed to report a warning when a string is not 
externalized, it works fine. By default the compiler ignores these errors.
Are you sure that 
your compiler settings are right?
Comment 3 Dani Megert CLA 2002-06-04 03:48:17 EDT
It reports the NLS errors correctly in all cases except where the code will not
be compiled because it is inside an if (false) block
e.g. 
boolean static final DEBUG= false;
...
if (DEBUG)
  System.out.println("this is a string");
Comment 4 Olivier Thomann CLA 2002-06-04 10:08:45 EDT
Created attachment 1219 [details]
Result I got in F2
Comment 5 Olivier Thomann CLA 2002-06-04 10:09:53 EDT
Here is a picture of what I got in F2. My test case is:
class Test2 {
	public static final boolean 
DEBUG = false;
	public static void main(String[] arguments) {
		if (DEBUG) 
{
			System.out.println("toto");
		}
	}
}

And "toto" is reported as a non 
externalized string. So I really cannot reproduce in F2.
Comment 6 Dani Megert CLA 2002-06-04 12:13:33 EDT
Forgot to add the build id. As the date may indicate this problem is reported
against a pre F2 build.

It seems that something in that area has been fixed. It works now for me on F2.
Comment 7 Philipe Mulet CLA 2002-06-11 10:12:06 EDT
No we did not change this area in the code.