From 4cfe0dd857891f6c70f4d0e58b60d6c4c401a0cd Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Thu, 7 Jul 2011 23:01:03 -0400 Subject: [PATCH 3/5] Test for bad alleles so that we don't generate IndexOutOfBoundsExceptions --- .../sting/utils/codecs/vcf/AbstractVCFCodec.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java index cd0f52c68..01344a117 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java @@ -225,7 +225,7 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec, loc = pos + alleles.get(0).length() - 1; } else if ( !isSingleNucleotideEvent(alleles) ) { ArrayList newAlleles = new ArrayList(); - loc = clipAlleles(pos, ref, alleles, newAlleles); + loc = clipAlleles(pos, ref, alleles, newAlleles, lineNo); alleles = newAlleles; } @@ -504,7 +504,7 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec, * @param clippedAlleles output list of clipped alleles * @return a list of alleles, clipped to the reference */ - protected static long clipAlleles(long position, String ref, List unclippedAlleles, List clippedAlleles) { + protected static long clipAlleles(long position, String ref, List unclippedAlleles, List clippedAlleles, int lineNo) { // Note that the computation of forward clipping here is meant only to see whether there is a common // base to all alleles, and to correctly compute reverse clipping, @@ -522,6 +522,8 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec, } if (a.length() - reverseClipped <= forwardClipping || a.length() - forwardClipping == 0) clipping = false; + else if (ref.length() == reverseClipped) + generateException("bad alleles encountered", lineNo); else if (a.getBases()[a.length()-reverseClipped-1] != ref.getBytes()[ref.length()-reverseClipped-1]) clipping = false; } From a3c9d9c3ff561a0a910b5313e0ebb037b7883a4b Mon Sep 17 00:00:00 2001 From: David Roazen Date: Fri, 8 Jul 2011 15:34:39 -0400 Subject: [PATCH 5/5] Fixing Contracts for Java, and enabling contracts by default for unit/integration tests. The NullPointerException we were seeing when trying to run with contracts enabled was being caused by an outdated version of the asm library. To run tests without contracts and disable their compilation, pass in "-Duse.contracts=false" to ant. Also did some minor unrelated cleanup in build.xml --- build.xml | 70 +++++++++++------- ivy.xml | 4 + settings/ivysettings.xml | 1 + .../cofoja-1.0-20110609.jar | Bin .../cofoja-1.0-20110609.xml | 3 + 5 files changed, 51 insertions(+), 27 deletions(-) rename settings/repository/{com.google => com.google.code.cofoja}/cofoja-1.0-20110609.jar (100%) create mode 100644 settings/repository/com.google.code.cofoja/cofoja-1.0-20110609.xml diff --git a/build.xml b/build.xml index 2a23f74c1..986d89213 100644 --- a/build.xml +++ b/build.xml @@ -28,6 +28,7 @@ + @@ -44,11 +45,11 @@ - - + + - - + + @@ -69,7 +70,7 @@ - + @@ -103,7 +104,7 @@ - + @@ -128,14 +129,14 @@ - + - + - + @@ -147,7 +148,7 @@ - + + + + + @@ -252,7 +257,7 @@ - + @@ -287,7 +292,7 @@ depends="gatk.compile.public.source,gatk.compile.private.source,gatk.compile.external.source" description="compile the GATK source" /> - + @@ -299,7 +304,16 @@ - + + + + + + + + + + @@ -312,7 +326,7 @@ + description="create GATK contracts" if="include.contracts" /> @@ -452,7 +466,7 @@ - + @@ -663,7 +677,7 @@ - + - - + @@ -820,7 +836,7 @@ - + @@ -828,7 +844,7 @@ - + @@ -921,8 +937,8 @@ - - + + @@ -944,7 +960,7 @@ - + @@ -969,7 +985,7 @@ - + diff --git a/ivy.xml b/ivy.xml index c2a6c4ccd..ce724bc3c 100644 --- a/ivy.xml +++ b/ivy.xml @@ -60,6 +60,10 @@ + + + + diff --git a/settings/ivysettings.xml b/settings/ivysettings.xml index 1e47fa847..b77414df9 100644 --- a/settings/ivysettings.xml +++ b/settings/ivysettings.xml @@ -25,5 +25,6 @@ + diff --git a/settings/repository/com.google/cofoja-1.0-20110609.jar b/settings/repository/com.google.code.cofoja/cofoja-1.0-20110609.jar similarity index 100% rename from settings/repository/com.google/cofoja-1.0-20110609.jar rename to settings/repository/com.google.code.cofoja/cofoja-1.0-20110609.jar diff --git a/settings/repository/com.google.code.cofoja/cofoja-1.0-20110609.xml b/settings/repository/com.google.code.cofoja/cofoja-1.0-20110609.xml new file mode 100644 index 000000000..38d4e88f1 --- /dev/null +++ b/settings/repository/com.google.code.cofoja/cofoja-1.0-20110609.xml @@ -0,0 +1,3 @@ + + +