Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 123580

Summary: [nls tooling] problem with duplicated keys
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2006-01-12 05:57:42 EST
20060112

The following file is using the new NLS style:
Now you want to introduce a sepearte key for the second statement:
- Open the NLS wizard
- In the second line, change key 'Test1_0' to 'Test1_new' and change text 'Hello' to 'World'
- press next, see preview
 - Messages.properies is changed correctly: A new key is introduced
 - Messages.java has a bug. The key is just renamed. Result doesn't compile.


package p1;
public class Test1 {
	public static void main(String[] args) {
		String str1= Messages.Test1_0;
		String str2= Messages.Test1_0;
	}
}
--- Messages.java
package p1;

import org.eclipse.osgi.util.NLS;

/**
 * 
 */
public class Messages extends NLS {
	private static final String BUNDLE_NAME= "p1.messages"; //$NON-NLS-1$
	private Messages() {
	}
	static {
		// initialize resource bundle
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
	}
	public static String Test1_0;
}
--- Messages.properties
Test1_0=Hello
Comment 1 Dani Megert CLA 2006-01-12 11:31:28 EST

*** This bug has been marked as a duplicate of 95708 ***