Project: JDT
Bug 316756 [nls tooling] Hover resolution of NLS references is thrown off by unused, incorrect 'BUNDLE_NAME'
Reported: 2010-06-14 09:26:47 | Status: resolved fixed

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.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSHintHelper.java