Project

General

Profile

Revision 39d13a15

ID39d13a15932e979559b21bf484a122454dd00f38
Parent f0559e00
Child 375d001e

Added by Andreas Müller over 3 years ago

ref #4232 Improve OrderedTermBase.performCompareTo to include vocabulary information

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java
123 123
    protected int performCompareTo(T orderedTerm, boolean skipVocabularyCheck) {
124 124

  
125 125
    	OrderedTermBase<?> orderedTermLocal = CdmBase.deproxy(orderedTerm, OrderedTermBase.class);
126
        if(!skipVocabularyCheck){
126
    	if(!skipVocabularyCheck){
127 127
            if (this.vocabulary == null || orderedTermLocal.vocabulary == null){
128 128
                throw new IllegalStateException("An ordered term (" + this.toString() + " or " + orderedTermLocal.toString() + ") of class " + this.getClass() + " or " + orderedTermLocal.getClass() + " does not belong to a vocabulary and therefore can not be compared");
129 129
            }
......
145 145
        }else if (orderThis < orderThat){
146 146
            return 1;
147 147
        }else {
148
            return 0;
148
            if (skipVocabularyCheck){
149
                return this.getVocabulary().getUuid().compareTo(orderedTermLocal.vocabulary.getUuid());
150
            }else{
151
                return 0;
152
            }
149 153
        }
150 154
    }
151 155

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)