Revision d2924473
Added by Katja Luther about 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateLabelProvider.java | ||
---|---|---|
150 | 150 |
if(element instanceof FieldUnit){ |
151 | 151 |
return ((FieldUnit) element).getTitleCache(); |
152 | 152 |
} |
153 |
|
|
153 | 154 |
else if(element instanceof MediaSpecimen){ |
154 | 155 |
text = CdmFormatterFactory.format(element, |
155 | 156 |
new FormatKey[]{ |
... | ... | |
189 | 190 |
}); |
190 | 191 |
} |
191 | 192 |
else if(element instanceof IdentifiableEntity){ |
193 |
|
|
192 | 194 |
IdentifiableEntity identifiableEntity = (IdentifiableEntity) element; |
193 | 195 |
if(identifiableEntity.isProtectedTitleCache()){ |
194 | 196 |
text = identifiableEntity.getTitleCache(); |
... | ... | |
495 | 497 |
if(rootElements!=null){ |
496 | 498 |
Collection<DerivedUnit> derivedUnits = new ArrayList<DerivedUnit>(); |
497 | 499 |
for (SpecimenOrObservationBase specimenOrObservationBase : rootElements) { |
498 |
derivedUnits.addAll(CdmStore.getService(IOccurrenceService.class).getAllChildDerivatives(specimenOrObservationBase.getUuid())); |
|
500 |
List<DerivedUnit> childUnits = CdmStore.getService(IOccurrenceService.class).getAllChildDerivatives(specimenOrObservationBase.getUuid()); |
|
501 |
if (childUnits != null){ |
|
502 |
derivedUnits.addAll(childUnits); |
|
503 |
} |
|
499 | 504 |
if(specimenOrObservationBase.isInstanceOf(DerivedUnit.class)){ |
500 |
derivedUnits.add(HibernateProxyHelper.deproxy(specimenOrObservationBase, DerivedUnit.class)); |
|
505 |
specimenOrObservationBase = CdmStore.getService(IOccurrenceService.class).load(specimenOrObservationBase.getUuid()); |
|
506 |
if (specimenOrObservationBase != null){ |
|
507 |
derivedUnits.add(HibernateProxyHelper.deproxy(specimenOrObservationBase, DerivedUnit.class)); |
|
508 |
} |
|
501 | 509 |
} |
502 | 510 |
} |
503 | 511 |
for (DerivedUnit derivedUnit : derivedUnits) { |
Also available in: Unified diff
avoid NPE in derivate label provider