Bug 96974 - [5.0] @SuppressWarnings({"nls"}) does not work for unexternalized strings
Summary: [5.0] @SuppressWarnings({"nls"}) does not work for unexternalized strings
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 95951 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-27 09:55 EDT by Tobias Widmer CLA
Modified: 2005-06-10 09:07 EDT (History)
1 user (show)

See Also:


Attachments
Apply on HEAD (867 bytes, patch)
2005-05-27 11:54 EDT, Olivier Thomann CLA
no flags Details | Diff
Apply on HEAD of org.eclipse.jdt.core.tests.compiler (1.14 KB, patch)
2005-05-27 12:08 EDT, Olivier Thomann CLA
no flags Details | Diff

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