Project

General

Profile

« Previous | Next » 

Revision f3591fc0

Added by Andreas Müller over 12 years ago

remove duplicate null check (and comment)

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/Rank.java
757 757
		
758 758
		}else{ 
759 759
			if (rankName == null){
760
				rankName = "(null)";
760
				rankName = "(null)";  //see NPE above
761 761
			}
762 762
			if (useUnknown){
763 763
				logger.info("Unknown rank name: " + rankName+". Rank 'UNKNOWN_RANK' created instead");
764 764
				return Rank.UNKNOWN_RANK();
765 765
			}else{
766
				if (rankName == null){
767
					rankName = "(null)";
768
				}
769 766
				throw new UnknownCdmTypeException("Unknown rank name: " + rankName);
770 767
			}
771 768
		}
772 769
	}
773 770

  
771
	/**
772
	 * Defines the rank according to the English name.
773
	 * @param rankName English rank name.
774
	 * @param nc Defines the handling of the section and subsection ranks. These are in different orders depending on the
775
	 * nomenclatural code.
776
	 * @param useUnknown if true, the "Unknown" rank is returned as a placeholder.
777
	 * @return
778
	 * @throws UnknownCdmTypeException never thrown if useUnknown is true
779
	 */
774 780
	public static Rank getRankByEnglishName(String rankName, NomenclaturalCode nc, boolean useUnknown) throws UnknownCdmTypeException{
775 781
		Rank result = null;
776 782
		if (rankName == null){ 

Also available in: Unified diff