Project

General

Profile

Revision 4b80789a

ID4b80789a6d183956c922de22091164555d2ef442
Parent f83def50
Child c6c4ab3a

Added by Andreas Müller over 3 years ago

fix #6220 Improve isOrphaned definition for Taxon.

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/Taxon.java
1230 1230
    public boolean isOrphaned() {
1231 1231

  
1232 1232
        if(taxonNodes == null || taxonNodes.isEmpty()) {
1233
            if(getRelationsFromThisTaxon().isEmpty() && getRelationsToThisTaxon().isEmpty()) {
1233
            if(getRelationsFromThisTaxon().isEmpty()) {
1234 1234
                return true;
1235
            }else{
1236
                for (TaxonRelationship rel : getRelationsFromThisTaxon()){
1237
                    if (rel.getType() != null && ! rel.getType().isConceptRelationship()){
1238
                        return false;
1239
                    }
1240
                }
1241
                return true;  //all relations are real concept relations and therefore not relevant
1235 1242
            }
1243
        }else{
1244
            return false;
1236 1245
        }
1237
        return false;
1238 1246
    }
1239 1247

  
1240 1248
    /**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/TaxonRelationshipType.java
166 166
	public boolean isConceptRelationship(){
167 167
		if (this.equals(MISAPPLIED_NAME_FOR())){
168 168
			return false;
169
		}else if (this.equals(INVALID_DESIGNATION_FOR())){
170
            return false;
169 171
		}else if (this.equals(TAXONOMICALLY_INCLUDED_IN())){
170 172
			return false;
171 173
		}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)