Make error messages clearer (even I was confused)

This commit is contained in:
Eric Banks 2011-10-19 11:49:16 -04:00
parent 6cadaa84c9
commit 48c4a8cb33
1 changed files with 3 additions and 3 deletions

View File

@ -1357,10 +1357,10 @@ public class VariantContext implements Feature { // to enable tribble intergrati
throw new IllegalArgumentException("Duplicate allele added to VariantContext: " + a);
}
// deal with the case where the first allele isn't the reference
// deal with the case where the first allele isn't the reference
if ( a.isReference() ) {
if ( sawRef )
throw new IllegalArgumentException("Alleles for a VariantContext must contain a single reference allele: " + alleles);
throw new IllegalArgumentException("Alleles for a VariantContext must contain at most one reference allele: " + alleles);
alleleList.add(0, a);
sawRef = true;
}
@ -1372,7 +1372,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
throw new IllegalArgumentException("Cannot create a VariantContext with an empty allele list");
if ( alleleList.get(0).isNonReference() )
throw new IllegalArgumentException("Alleles for a VariantContext must contain a single reference allele: " + alleles);
throw new IllegalArgumentException("Alleles for a VariantContext must contain at least one reference allele: " + alleles);
return alleleList;
}