Community
Participate
Working Groups
Build Identifier: I20111209-1447 When having a java and properties files for NLS externalized strings, with a key-value pair synched in both files, the quick fix options are 'Rename in workspace (ALT + SHIFT + R)' and 'Remove property'. The 'Rename in workspace' option invokes the 'Rename field' wizard, with the new name and options to update references and textual occurrences. The preview changes only shows the java file changes and it does not rename the key in the properties file. Reproducible: Always Steps to Reproduce: 1.Should have a java and properties files with NLS externalized strings. 2.For an existing key, that is synched in the java file, invoke quick fix (ctrl +1) 3.The options should be to rename in workspace and to remove field. 4.Select rename in workspace. 5.Complete the new name field 6.The key gets renamed in the java file but not in the properties file.
Sorry, but I cannot reproduce this. I assume you start the rename in the Properties File editor? Can you attach a test plug-in which allows us to reproduce this? Deepak, please stay tuned to this bug.
Created attachment 208389 [details] java project Import existing project from the archive; Open Messages.properties file; On the first line, at the first character, invoke quick-fix (ctrl + 1) for 'key_one'; Select 'Rename in workspace'; Type in a new name and accept defaults; The field is renamed in Messages.java but not in Messages.properties. Also tested in Eclipse SDK, Build id: I20111028-1100.
The rename does not work because the Message.java does not conform to the proper format: it misses the initializer: static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } Due to this the rename fails and this is nothing new. In 3.7 it will also not rename the properties key if the rename is started on the field or on a reference to the field. Also, other NLS tooling like searching for broken externalized strings will fail (return false positives). Do you really have NLS classes without the initializer? If so, I suggest to fix your code to conform to the proper format supported by the NLS tooling, so that it can correctly perform it's job.