From e07cefb058c25ce2cc5391a62b65ba968b29faa2 Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Thu, 31 Jan 2013 15:57:48 -0500 Subject: [PATCH] Updating AlignmentUtils.consolidateCigar() to the GATK coding standards. --- .../org/broadinstitute/sting/utils/sam/AlignmentUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java b/public/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java index d270f251d..8c6059d08 100644 --- a/public/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java @@ -508,12 +508,13 @@ public class AlignmentUtils { * For example, 1M1M1M1D2M1M --> 3M1D3M * If the given cigar is empty then the returned cigar will also be empty * @param c the cigar to consolidate - * @return a cigar with consecutive matching operators merged into single operators. + * @return a non-null cigar with consecutive matching operators merged into single operators. */ - @Requires({"c != null"}) @Ensures({"result != null"}) public static Cigar consolidateCigar( final Cigar c ) { + if( c == null ) { throw new IllegalArgumentException("Cigar cannot be null"); } if( c.isEmpty() ) { return c; } + final Cigar returnCigar = new Cigar(); int sumLength = 0; for( int iii = 0; iii < c.numCigarElements(); iii++ ) {