Bug 89503 - [nls tooling] Externalize String wizard: new Eclipse mode and sorting
Summary: [nls tooling] Externalize String wizard: new Eclipse mode and sorting
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.2 M6   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 94958 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-30 05:48 EST by Dirk Baeumer CLA
Modified: 2020-08-30 18:09 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-03-30 05:48:13 EST
M6 test pass

The properties file approach tried to insert new key/value pairs according to
some sort order. The new approach seems to simply adding the fields at the end. 

Sorting the fields by name would improve the readability of the file.
Comment 1 Dani Megert CLA 2005-05-12 10:33:39 EDT
*** Bug 94958 has been marked as a duplicate of this bug. ***
Comment 2 Dani Megert CLA 2005-08-18 04:53:15 EDT
see also bug 107308
Comment 3 Benno Baumgartner CLA 2006-03-08 11:23:12 EST
I fixed in > I20060307-1315

New fields are added sorted into the *Message.java file. 

This does not fix Bug 94958 which is IMHO not a dup (if there are no fields yet in the *Message.java file then the new field is still inserted at the end and does not honor the member sort order)

This does also not change anything for Bug 107308 because there the problem is that the *.properties file is sorted, which does work with the traditional NLS style as well as with the eclipse style.
Comment 4 Benno Baumgartner CLA 2006-03-10 09:28:03 EST
fixed > I20060309-1000

1. New fields for existing NLS files are inserted in alphabetical order (handles also renames, see also Bug 131288).

2. The members of new generated NLS files are inserted in the order as defined by the member sort order (for traditional as well as for eclipse style nls mechanism). Exception is the BUNDLE_NAME field, which is always the first member of the class.
Comment 5 Carsten Hammer CLA 2020-08-30 18:09:40 EDT
With this change the code in AccessorClassCreator.java looks like this:

			if (constructorIdx < methodIdx) {
				result.append(constructor);
				result.append(method);
			} else {
				result.append(constructor);
				result.append(method);
			}

So the constructor is always first and then the method no matter what constructorIdx and methodIdx are. Is this intended?