Just use validate() from super class since it does the same thing

This commit is contained in:
Eric Banks 2011-10-19 11:48:23 -04:00
parent d79b57d6f4
commit 6cadaa84c9
1 changed files with 1 additions and 13 deletions

View File

@ -40,19 +40,7 @@ public class MutableGenotype extends Genotype {
*/ */
public void setAlleles(List<Allele> alleles) { public void setAlleles(List<Allele> alleles) {
this.alleles = new ArrayList<Allele>(alleles); this.alleles = new ArrayList<Allele>(alleles);
validate();
// todo -- add validation checking here
if ( alleles == null ) throw new IllegalArgumentException("BUG: alleles cannot be null in setAlleles");
if ( alleles.size() == 0) throw new IllegalArgumentException("BUG: alleles cannot be of size 0 in setAlleles");
int nNoCalls = 0;
for ( Allele allele : alleles ) { nNoCalls += allele.isNoCall() ? 1 : 0; }
if ( nNoCalls > 0 && nNoCalls != alleles.size() )
throw new IllegalArgumentException("BUG: alleles include some No Calls and some Calls, an illegal state " + this);
for ( Allele allele : alleles )
if ( allele == null ) throw new IllegalArgumentException("BUG: Cannot add a null allele to a genotype");
} }
public void setPhase(boolean isPhased) { public void setPhase(boolean isPhased) {