Hi, I am trying to improve the compareTo() functions that I have written and ran into the following error.
- java.lang.ArrayIndexOutOfBoundsException - 31 - org.datanucleus.state.StateManagerImpl#isLoaded(StateManagerImpl.java:2893) - au.com.scds.chats.dom.module.activity.RecurringActivity#getStartDateTime(RecurringActivity.java:-1) - sun.reflect.GeneratedMethodAccessor75#invoke(null:-1) - sun.reflect.DelegatingMethodAccessorImpl#invoke(DelegatingMethodAccessorImpl.java:43) - java.lang.reflect.Method#invoke(Method.java:497) - org.apache.isis.applib.util.Clause#getValueOf(ObjectContracts.java:365) - org.apache.isis.applib.util.ObjectContracts#compare(ObjectContracts.java:70) - org.apache.isis.applib.util.ObjectContracts#compare(ObjectContracts.java:63) - au.com.scds.chats.dom.module.activity.Activity#compareTo(Activity.java:120) - au.com.scds.chats.dom.module.activity.Activity#compareTo(Activity.java:54) - com.google.common.collect.ComparisonChain$1#compare(ComparisonChain.java:76) - au.com.scds.chats.dom.module.participant.Participation#compareTo(Participation.java:206) - au.com.scds.chats.dom.module.participant.Participation#compareTo(Participation.java:31) - java.util.TreeMap#compare(TreeMap.java:1290) - java.util.TreeMap#put(TreeMap.java:538) - java.util.TreeSet#add(TreeSet.java:255) - org.datanucleus.store.types.wrappers.backed.SortedSet#loadFromStore(SortedSet.java:283) - org.datanucleus.store.types.wrappers.backed.SortedSet#iterator(SortedSet.java:477) - com.google.common.collect.Collections2$TransformedCollection#iterator(Collections2.java:269) - org.apache.isis.core.metamodel.facets.collections.CollectionFacetAbstract#iterator(CollectionFacetAbstract.java:46) - org.apache.isis.core.metamodel.facets.collections.CollectionFacetAbstract$1#iterator(CollectionFacetAbstract.java:54) - org.apache.isis.core.metamodel.adapter.ObjectAdapter$Util#visibleAdapters(ObjectAdapter.java:314) - org.apache.isis.core.metamodel.adapter.ObjectAdapter$Util#visibleAdapters(ObjectAdapter.java:302) - org.apache.isis.core.metamodel.facets.collections.accessor.CollectionAccessorFacetViaAccessor#getProperty(CollectionAccessorFacetViaAccessor.java:85) - org.apache.isis.core.metamodel.specloader.specimpl.OneToManyAssociationDefault#get(OneToManyAssociationDefault.java:161) I have the comparison for Activity now of startDateTime then name then region, so the comparison of Participations (a link table between Activity and Participant) is of Activity first and then Participant. This gets quite complex in terms of retrieving value graphs which might explain the error. Is there a better way, maybe I can use database id instead as they reflect order of creation of records, which might be good enough for participation sorting. I've tried to avoid using generated ID values in OO code but maybe its a compromise I have to accept occassionally, instead of natural keys. Just raising it for discussion. Thanks