Summary: | Sort members doesn't work for enums | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | UI | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | VERIFIED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | markus.kell.r |
Version: | 3.1 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Dirk Baeumer
2004-12-14 09:55:01 EST
Annotations seem to work Not only doesn't work, but completly messes up. Build id: 200412140010 This code: package org.sevensoft.emerchant.model; public class EnumSortTest { public enum Suit { SPADES, CLUBS, HEARTS, DIAMONDS } public enum Card { KING, QUEEN, JACK, ACE } private String string; private int integer; public void method1() { } public void method2() { } } becomes this after sorting package org.sevensoft.emerchant.model; public class EnumSortTest { public enum Card { ACE JACK KING QUEEN } public enum Suit { CLUBS DIAMONDS HEARTS SPADES } private int integer; private String string; public void method1() { } public void method2() { } } It's even worse on big classes, splits the enum up and puts parts of it all over the place, in between methods and everything ! JDT UI only provides the comparator for CompilationUnitSorter#sort (ICompilationUnit, int[], Comparator, int, IProgressMonitor). Moving to JDT Core for comment. This should be fixed for M4. The change is too big for M4. *** This bug has been marked as a duplicate of 80036 *** For M4, the action can be disabled for enums. When reworking element sorter, we should also attempt to handle logical groups: fields, methods... I may want to solve methods (no distinction on staticness) and leave my fields alone. We have disabled the action for M4. Verified that the current solution in I20051102-0010 correctly handles enums. Continuing the discussion about the right UI in bug 113338. |