Community
Participate
Working Groups
Today we can generate equals() and hashCode() implementations for classes. I suggest adding a feature that would add "implements java.lang.Comparable<X>" to the class (if not already present) and generate implementation code for the compareTo() method. A dialog would allow the selection of which member variables should be pertitent, just like we have for the equals/hashCode generator today. A question for debate: should we provide an option as to whether the Comparable interface used is genericized or not? Either way, should we allow the user to specify what the type parameter is, or always use the current class type? Or instead of allowing any old type, allow the user to choose a type from the class' inheritance ancestry.
Move to JDT/UI