Hi Andreas, Thanks for the bug report, but please get it entered in the bug reporting system so that it can be tracked. For Model Elements, we usually want to sort by name, so that's probably what the sorted list should be using here. We can continue the discussion in the bug entry when it's posted.
Tom On Thu, Apr 24, 2008 at 5:44 AM, Andreas Behnke <[EMAIL PROTECTED]> wrote: > Hi, > > if you add a State in the "in State" list of the ObjectFlowState, > an Exception is thrown: > > Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: > org.omg.uml.behavioralelements.statemachines.SimpleState$Impl cannot be cast > to java.lang.Comparable > at java.util.Arrays.mergeSort(Arrays.java:1144) > at java.util.Arrays.sort(Arrays.java:1079) > at java.util.Collections.sort(Collections.java:117) > at org.argouml.util.SortedListModel.addAll(SortedListModel.java:153) > at > org.argouml.uml.ui.UMLAddDialog.constructListModel(UMLAddDialog.java:298) > [...] > > The problem is that SortedListModel uses Collection.sort to sort the > elements of a collection. The collection contains elements of type > SimpleState$Impl, which in turn does not implement "Comparable". > > How could this be fixed? > org.omg.uml.behavioralelements.statemachines.SimpleState is a generated > class, so how could this class implement another interface (Comparable)? > > My workaround is to comment "Collection.sort" in SortedListModel, but this > is no solution. > > Andreas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
