Revision 87f7a97f
Added by Andreas Müller over 12 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java | ||
---|---|---|
100 | 100 |
protected int performCompareTo(T orderedTerm, boolean skipVocabularyCheck) { |
101 | 101 |
|
102 | 102 |
if(!skipVocabularyCheck){ |
103 |
if (this.vocabulary == null || ! this.vocabulary.getUuid().equals(orderedTerm.vocabulary.getUuid())){ |
|
103 |
if (this.vocabulary == null || orderedTerm.vocabulary == null){ |
|
104 |
throw new IllegalStateException("An ordered term of class " + this.getClass() + " does not belong to a vocabulary and therefore can not be compared"); |
|
105 |
} |
|
106 |
if (! this.vocabulary.getUuid().equals(orderedTerm.vocabulary.getUuid())){ |
|
104 | 107 |
throw new IllegalStateException("2 terms do not belong to the same vocabulary and therefore can not be compared"); |
105 | 108 |
} |
106 | 109 |
} |
Also available in: Unified diff
better error handling for performCompareTo