Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316756 - [nls tooling] Hover resolution of NLS references is thrown off by unused, incorrect 'BUNDLE_NAME'
Summary: [nls tooling] Hover resolution of NLS references is thrown off by unused, inc...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-14 09:26 EDT by John Cortell CLA
Modified: 2010-06-14 09:57 EDT (History)
1 user (show)

See Also:


Attachments
Project referenced in reproducibility steps (9.06 KB, application/zip)
2010-06-14 09:29 EDT, John Cortell CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Cortell CLA 2010-06-14 09:26:47 EDT
I sort of stumbled on this.

If a client has an NLS class where the 
(a) the .properties file is named after the NLS class
(b) the NLS class passes Messages.class.getName() to the NLS.initializeMessages() method, and
(c) the NLS has an unused BUNDLE_NAME definition that is incorrect

...the support to show the NLS string value by hovering over the reference is unnecessarily confused. The resolution logic appears to give precedence to using the BUNDLE_NAME over what is passed to the NLS.initializeMessages() method. Clearly, the latter is a more accurate source and should be given precedence.

To reproduce:
1. Import the attached project into a workspace
2. Open SampleAction.java and hover over "SampleAction_0". 
You will see the hover popup show "Hello World". This is expected, working behavior.
3. Open Messages.java. Uncomment the definition of BUNDLE_NAME. 
4. Repeat step 2.
You will see "The properties file could not be detected", even though BUNDLE_NAME is unused.
Comment 1 John Cortell CLA 2010-06-14 09:29:14 EDT
Created attachment 171825 [details]
Project referenced in reproducibility steps
Comment 2 Dani Megert CLA 2010-06-14 09:57:12 EDT
Fixed in NLSHintHelper rev. 1.41.
Comment 3 Dani Megert CLA 2010-06-14 09:57:26 EDT
.