| Summary: | [nls tooling] problem with duplicated keys | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Martin Aeschlimann <martinae> |
| Component: | Text | Assignee: | 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: | |||
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