From 12c3e3ecdaf27d62607a254304fc34a0689b05f8 Mon Sep 17 00:00:00 2001 From: weisburd Date: Wed, 2 Jun 2010 16:23:05 +0000 Subject: [PATCH] Added back the check for values.size() != header.size(). Now exception will be thrown if number of columns in a record doesn't equal number of columns in the header git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3473 348d0f76-0448-11de-a6fe-93d51630548a --- .../annotator/AnnotatorInputTableCodec.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java b/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java index 87f70b7e5..3b9cb25ee 100755 --- a/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import org.apache.log4j.Logger; import org.broad.tribble.FeatureCodec; +import org.broad.tribble.exception.CodecLineParsingException; import org.broad.tribble.util.AsciiLineReader; import org.broad.tribble.util.LineReader; import org.broadinstitute.sting.utils.GenomeLoc; @@ -64,7 +65,6 @@ public class AnnotatorInputTableCodec implements FeatureCodec getFeatureType() { return AnnotatorInputTableFeature.class; } @@ -79,9 +79,9 @@ public class AnnotatorInputTableCodec implements FeatureCodec header = this.header; //optimization final ArrayList values = Utils.split(line, DELIMITER, header.size()); - //if ( values.size() > header.size()) { - // throw new CodecLineParsingException(String.format("Encountered a line within " + file + " that has %d columns which is > the number of columns in the header which has %d columns.\nHeader: " + header + "\nLine: " + values, values.size(), header.size())); - //} + if ( values.size() != header.size()) { + throw new CodecLineParsingException(String.format("Encountered a line that has %d columns while the header has %d columns.\nHeader: " + header + "\nLine: " + values, values.size(), header.size())); + } final AnnotatorInputTableFeature feature = new AnnotatorInputTableFeature(header); for ( int i = 0; i < header.size(); i++ ) { @@ -132,8 +132,7 @@ public class AnnotatorInputTableCodec implements FeatureCodec