Community
Participate
Working Groups
Type arguments in Policy#get/setComparator APIs should be <String>, not <Object>. I realized this when I switched org.eclipse.ui.ide.application to JavaSE-1.8. IDEWorkbenchAdvisor#initialize(IWorkbenchConfigurer) contains one typical usage: Policy.setComparator(Collator.getInstance()); Both com.ibm.icu.text.Collator and java.text.Collator implement Comparator<Object>, not Comparator<String>, so you get a compile error here. It's unclear why they didn't bite the bullet and just made it a Comparator<String>; they probably just feared source incompatibilities. https://bugs.openjdk.java.net/browse/JDK-5062748 from 2004 remained unanswered. org.eclipse.compare's DiffViewerComparator#getComparator() shows such a source compatibility problem Policy.getComparator().
Created attachment 242797 [details] Fix
Oops, comment 0 and the original summary had the "should be *, not *" wrong. Fixed the summary. Paul, can you please review the patch (or tell someone else to review it)? Dani, can you please give PMC approval for the the API change?
Added explanatory Javadoc for private field Policy#viewerComparator and released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=ffc00fa559a3d6a3a72d3a8fe07c7e8a75789c3c