Bug 105778 - Unnecessary NON-NLS should have its own preference
Summary: Unnecessary NON-NLS should have its own preference
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 106374
  Show dependency tree
 
Reported: 2005-08-02 08:47 EDT by Tod Creasey CLA
Modified: 2005-08-12 10:57 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2005-08-02 08:47:50 EDT
20040802

Unneccessary NON-NLS uses the same preference as non externalized Strings. As
the severity of these two options is so different we should have two preferences.

The Platform UI team has non externalized Strings set to error so we have to
reset our error settings everytime we load from HEAD.
Comment 1 Dirk Baeumer CLA 2005-08-02 08:58:44 EDT
This support got added in JDT/Core with build 2nd August 2005.

Martin, can you please add the UI for this and a quick fix. We should add the UI
for M1, quick fix can come later if difficult.

Question to Olivier: the build notes state that the setting is ignore by
default, but according to Tod the setting is derived from the unexternalized
string setting. Any comments.
Comment 2 Olivier Thomann CLA 2005-08-02 09:36:24 EDT
By default, the preference for externalized string literals is set to ignore. So
this is why I said the detection of unnecessary non-nls tags is disabled by
default. I will clarify the build notes.
We indeed reuse the same preference as the externalized string literals.
The reason for that is that these two features are related. One is to detect the
missing externalized string literals and one is to detect the non-nls tags left
behind.
I don't think this deserves two different options. If you have some errors, fix
them and they won't come back.
Comment 3 Tod Creasey CLA 2005-08-02 10:01:28 EDT
I understand your argument but we have over 2000 unneccessary NON-NLS in our
code (which we should fix). I assume it will be much worse for other products
with a larger code base.

As much as I hate adding extra preferences this should be another preference for
backwards compatibility - I suspect many teams turn unexternalized String to
error as they ship on multiple languages.
Comment 4 Olivier Thomann CLA 2005-08-02 10:05:32 EDT
I will add a new option for this. No rebuild will be requested. For this week,
simply turn off "externalize string literal".
Martin, I'll let you know when the new option is ready.
Comment 5 Douglas Pollock CLA 2005-08-02 11:13:11 EDT
Further information as to why this bugs us so much: all UI projects have the   
"Usage of non-externalized strings" preference set to error. 
  
Comment 6 Olivier Thomann CLA 2005-08-02 11:35:59 EDT
We won't add a new option. But this detection will be postponed after 3.2 M1.
Comment 7 Dani Megert CLA 2005-08-02 11:37:55 EDT
I'd vote for another option: I think not nls-ing something can be seen as more
severe than having a superfluous non-nls in the code (or the other way around ;-)
Comment 8 Olivier Thomann CLA 2005-08-02 11:42:48 EDT
non-nls tags should be accurate. Right now you can have more tags than the ones
you really need.
This new feature (see bug 49876) can be used to achieve accurancy between the
externalized string literals and the non-nls tags. Existing errors should be
fixed. It is a one time fix. Also the tool to externalize string literals should
be updated to get rid of superfluous tags.
Comment 9 Douglas Pollock CLA 2005-08-02 11:47:17 EDT
Will this tool be available for 3.2 M1?  I don't relish the thought of 
manually editing thousands of files to remove extraneous NLS tags. 
Comment 10 Douglas Pollock CLA 2005-08-02 12:18:44 EDT
See also Bug 105816. 
Comment 11 Olivier Thomann CLA 2005-08-02 12:24:05 EDT
I am working on a tool to get rid of unnecessary non-nls tags automatically. It
will be available on the JDT/Core dev page.
Comment 12 Douglas Pollock CLA 2005-08-02 13:42:52 EDT
I over-reacted in comment #9.  There are only 100+ errors from this change, 
which is fairly easy to edit by hand. 
 
Comment 13 Olivier Thomann CLA 2005-08-02 13:48:15 EDT
(In reply to comment #9)
> Will this tool be available for 3.2 M1?  I don't relish the thought of 
> manually editing thousands of files to remove extraneous NLS tags. 
I am testing the tool right now. It will be available in the JDT/Core dev page
after some more testing. Do you volunteer for beta-testing? :-)
Comment 14 Douglas Pollock CLA 2005-08-02 13:49:33 EDT
(In reply to comment #13) 
> Do you volunteer for beta-testing? :-) 
 
Sure. 
 
 
 
Comment 15 Olivier Thomann CLA 2005-08-03 12:08:00 EDT
I get this one back. It has nothing to do with JDT/UI.
Comment 16 Philipe Mulet CLA 2005-08-08 12:13:25 EDT
I would also be enclined to provide an extra option, to provide maximal
configurability. Now UI could choose to only present a combined setting if it
wanted (setting the 2 options at once under the cover).

Now, we can see reaction of users to one shared option before we provide 2
options adding complexity.
Comment 17 Dirk Baeumer CLA 2005-08-09 04:36:28 EDT
If we start with one setting we should start with one in core as well. Since
changing the settings can be done via API as well we can end in situations where
the two settings have different values and what does UI present then ?
Comment 18 Olivier Thomann CLA 2005-08-10 11:17:56 EDT
I will release after M1 a version that is using only one option. If this is not
good enough, then we will add a second one. My point of view is that this adds
unnecessary complexity for nothing.
The purpose of the actual option is to provide accuracy in the nls tagging. This
was not achieve before this new detection.
Comment 19 Olivier Thomann CLA 2005-08-12 10:57:55 EDT
Closing as WONTFIX since for now we reuse the nls option.