Bug 96974

Summary: [5.0] @SuppressWarnings({"nls"}) does not work for unexternalized strings
Product: [Eclipse Project] JDT Reporter: Tobias Widmer <tobias_widmer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: artur.brinkmann
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Apply on HEAD
none
Apply on HEAD of org.eclipse.jdt.core.tests.compiler none

Description Tobias Widmer CLA 2005-05-27 09:55:34 EDT
I20050527-0010:

Use snippet:

@SuppressWarnings({"javadoc","nls"})
 class Test<T> {
	 String test= "";
 }

with javadoc processing and nls checking enabled
Comment 1 Olivier Thomann CLA 2005-05-27 10:57:07 EDT
nls is not supported yet.
Comment 2 Olivier Thomann CLA 2005-05-27 11:37:45 EDT
I found a bug for the nls support. It should indeed work.
Comment 3 Olivier Thomann CLA 2005-05-27 11:44:28 EDT
*** Bug 95951 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Thomann CLA 2005-05-27 11:53:37 EDT
Using this test case:
@SuppressWarnings({"javadoc"}) //$NON-NLS-1$
public class X<T> {
	 String test= ""; //$NON-NLS-1$
}

I get no warning for the javadoc warning (missing javadoc for public type).

If I comment out the @SuppressWarnings line, then I get it.
So from my point of view, the support for "javadoc" is fine.

I will attach the patch to fix the nls bug.
Comment 5 Olivier Thomann CLA 2005-05-27 11:54:26 EDT
Created attachment 21890 [details]
Apply on HEAD
Comment 6 Olivier Thomann CLA 2005-05-27 12:08:41 EDT
Created attachment 21893 [details]
Apply on HEAD of  org.eclipse.jdt.core.tests.compiler

Corresponding regression test
Comment 7 Olivier Thomann CLA 2005-05-27 12:15:08 EDT
Tobias,

Could you please confirm that "javadoc" actually works?
Comment 8 Tobias Widmer CLA 2005-05-27 12:24:15 EDT
Yes, the "javadoc" works. The test case was rather designed to show that 
the "nls" annotation does not work on strings used in the annotation itself.
Comment 9 Olivier Thomann CLA 2005-05-27 13:35:51 EDT
Then I update the title accordingly
Comment 10 Olivier Thomann CLA 2005-05-27 16:51:37 EDT
Change in org.eclipse.jdt.internal.compiler.impl.CompilerOptions.
Fixed and released in HEAD.
Regression test added in
org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.test147
Comment 11 David Audel CLA 2005-06-07 11:16:20 EDT
Verified for 3.1RC2 using build N20050607-0010 + JDT/COre HEAD
Comment 12 David Audel CLA 2005-06-10 09:07:56 EDT
Verified for 3.1 RC2 using build I20050610-0010