Bug 157086 - should adopt ICU Collator and use new APIs on StructuredViewer
Summary: should adopt ICU Collator and use new APIs on StructuredViewer
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-12 15:19 EDT by Karice McIntyre CLA
Modified: 2006-09-18 10:21 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karice McIntyre CLA 2006-09-12 15:19:50 EDT
Since ICU4J provides more comprehensive support for internationalization and is now included as part of the Platform, we should be endorsing it by adopting use  of its APIs instead of using the default Java implementation.  

One widespread example of usage that should be migrated to is using ICU's collator to sort in all of our viewers (see ViewerComparator) rather than the java.text collator used in ViewerSorter.  This component was found to be  affected by at least one of the 3 following conditions that should be adopted:
1. change references to java.text.Collator to com.ibm.icu.Collator.  
CAVEAT: There may be cases where this is not possible if plug-ins can ship without the com.ibm.icu plug-in (example, JFace).

2. change references to StructuredViewer#setSorter to use StructuredViewer#setComparator and StructuredViewer#getSorter to StructuredViewer#setComparator. These are slated to be deprecated (see bug 154871). 

3. any classes that subclass ViewerSorter should now sublcass ViewerComparator, if possible (i.e. if the class is internal).

The UI component is in the process of completing this work (see bug 154884) and it is slated to be released for M2.
Comment 1 Frederic Fusier CLA 2006-09-13 04:24:30 EDT
JDT/Core does not use neither java.text.Collator nor StructuredViewer in org.eclipse.jdt.core project.

However, we have one reference to java.text.Collator in one of our class in a test project: org.eclipse.jdt.core.tests.model.DefaultJavaElementComparator

I'll change it...
Comment 2 Frederic Fusier CLA 2006-09-13 09:06:22 EDT
Fixed and released for 3.3 M2
Comment 3 Karice McIntyre CLA 2006-09-13 10:34:18 EDT
My bad - I saw a couple of jdt packages that didn't have "ui" in the name in my list of hits and assumed they were in the core plugin so that's why I logged a bug against JDT-Core.  I suppose that changing the test suites is also a good idea.  Thanks for catching that.
Comment 4 David Audel CLA 2006-09-18 10:21:05 EDT
Verified for 3.3 M2 using build I20060918-0010.