Bug 18414 - NLS Tools: Find strings and compiler warning out of synch
Summary: NLS Tools: Find strings and compiler warning out of synch
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-31 04:15 EDT by Dani Megert CLA
Modified: 2002-06-11 10:12 EDT (History)
0 users

See Also:


Attachments
Result I got in F2 (40.39 KB, image/jpeg)
2002-06-04 10:08 EDT, Olivier Thomann CLA
no flags Details

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