Throws ReviewedStingException for a bug when parent VariantContext argument is null

This commit is contained in:
Mark DePristo 2012-02-27 15:09:00 -05:00
parent 4d9582de77
commit 729bb954e2
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import org.broad.tribble.Feature;
import org.broad.tribble.TribbleException;
import org.broad.tribble.util.ParsingUtils;
import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.util.*;
@ -102,9 +103,10 @@ public class VariantContextBuilder {
* Returns a new builder based on parent -- the new VC will have all fields initialized
* to their corresponding values in parent. This is the best way to create a derived VariantContext
*
* @param parent
* @param parent Cannot be null
*/
public VariantContextBuilder(VariantContext parent) {
if ( parent == null ) throw new ReviewedStingException("BUG: VariantContext parent argument cannot be null in VariantContextBuilder")
this.alleles = parent.alleles;
this.attributes = parent.getAttributes();
this.attributesCanBeModified = false;