Project

General

Profile

« Previous | Next » 

Revision d2c73605

Added by Katja Luther almost 12 years ago

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiExportBase.java
82 82
			if (! isPesiTaxon(taxonBase)){
83 83
				it.remove();
84 84
			}
85
			taxonBase = null;
85 86
		}
86 87
		
87 88
		return list;
......
214 215
			SynonymRelationship synRel = CdmBase.deproxy(rel, SynonymRelationship.class);
215 216
			taxonBase = synRel.getSynonym();
216 217
			taxon = synRel.getAcceptedTaxon();
218
			synRel = null;
217 219
		}else if (rel.isInstanceOf(TaxonRelationship.class)){
218 220
			TaxonRelationship taxRel = CdmBase.deproxy(rel, TaxonRelationship.class);
219 221
			taxonBase = taxRel.getFromTaxon();
220 222
			taxon = taxRel.getToTaxon();
223
			taxRel = null;
221 224
		}else{
222 225
			logger.warn ("Only synonym - and taxon-relationships alowed here");
223 226
			return false;
......
342 345
			Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
343 346
			for (Marker marker : taxon.getMarkers()){
344 347
				if (marker.getValue() == false && marker.getMarkerType().equals(MarkerType.PUBLISH())){
348
					taxon = null;
345 349
					return false;
346 350
				//probably not needed any more after #2786 was fixed
347 351
				}else if (marker.getValue() == true && marker.getMarkerType().getUuid().equals(BerlinModelTransformer.uuidMisappliedCommonName)){
348 352
					logger.warn("Misapplied common name still exists");
353
					taxon = null;
349 354
					return false;
350 355
				}
351 356
				
......
354 359
			if (! taxon.isMisapplication()){
355 360
				for (Marker marker : taxon.getMarkers()){
356 361
					if (marker.getValue() == false && marker.getMarkerType().equals(MarkerType.PUBLISH())){
362
						taxon = null;
357 363
						return false;
358 364
					}
359 365
				}
......
361 367
			//handle misapplied names
362 368
			}else{
363 369
				if (excludeMisappliedNames){
370
					taxon = null;
364 371
					return false;
365 372
				}
366 373
				for (Marker marker : taxon.getMarkers()){
367 374
					//probably not needed any more after #2786 was fixed
368 375
					if (marker.getValue() == true && marker.getMarkerType().getUuid().equals(BerlinModelTransformer.uuidMisappliedCommonName)){
369 376
						logger.warn("Misapplied common name still exists");
377
						taxon = null;
370 378
						return false;
371 379
					}
372 380
				}
......
374 382
					if (taxRel.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())){
375 383
//						logger.warn(taxRel.getUuid() + "; " + taxRel.getToTaxon().getUuid() + " + " + taxRel.getToTaxon().getTitleCache());
376 384
						if (isPesiTaxon(taxRel.getToTaxon(), true)){
385
							taxon = null;
377 386
							return true;
378 387
						}
379 388
					}
380 389
				}
381 390
				if (logger.isDebugEnabled()){ logger.debug("Misapplied name has no accepted PESI taxon: " +  taxon.getUuid() + ", (" +  taxon.getTitleCache() + ")");}
391
				taxon = null;
382 392
				return false;
383 393
			}
384 394
		//handle synonyms
......
391 401
				}
392 402
			}
393 403
			if (!hasAcceptedPesiTaxon) {if (logger.isDebugEnabled()){logger.debug("Synonym has no accepted PESI taxon: " +  synonym.getUuid() + ", (" +  synonym.getTitleCache() + ")");}}
404
			synonym = null;
394 405
			return hasAcceptedPesiTaxon;
395 406
		}else {
396 407
			throw new RuntimeException("Unknown taxon base type: " + taxonBase.getClass());
......
432 443
	
433 444
	
434 445
	
435
	static NonViralNameDefaultCacheStrategy getCacheStrategy(TaxonNameBase<?, ?> taxonName) {
446
	protected static NonViralNameDefaultCacheStrategy getCacheStrategy(TaxonNameBase<?, ?> taxonName) {
436 447
		NonViralNameDefaultCacheStrategy cacheStrategy;
437 448
		if (taxonName.isInstanceOf(ZoologicalName.class)){
438 449
			cacheStrategy = zooNameStrategy;

Also available in: Unified diff