From 02942a97ef6e7e14019efa502b0b03fea3c68c1f Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Fri, 7 Oct 2022 16:22:19 -0400 Subject: [PATCH] Remove deprecation from Allele.acceptableAlleleBases #1623 (#1625) * Remove deprecation from Allele.acceptableAlleleBases * These methods were deprecated in 3.0.0, it seems like that was probably a mistake since there is no obvious replacement for this useful functionality. * fixes #1623 --- src/main/java/htsjdk/variant/variantcontext/Allele.java | 7 ++----- .../java/htsjdk/variant/variantcontext/SimpleAllele.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/htsjdk/variant/variantcontext/Allele.java b/src/main/java/htsjdk/variant/variantcontext/Allele.java index 36da06aba0..b256d2d9dd 100644 --- a/src/main/java/htsjdk/variant/variantcontext/Allele.java +++ b/src/main/java/htsjdk/variant/variantcontext/Allele.java @@ -26,6 +26,7 @@ package htsjdk.variant.variantcontext; import java.io.Serializable; +import java.nio.charset.StandardCharsets; /** * Immutable representation of an allele. @@ -285,7 +286,6 @@ static boolean wouldBeSingleBreakend(byte[] bases) { * @param bases bases representing a reference allele * @return true if the bases represent the well formatted allele */ - @Deprecated static boolean acceptableAlleleBases(String bases) { return acceptableAlleleBases(bases.getBytes(), true); } @@ -295,16 +295,14 @@ static boolean acceptableAlleleBases(String bases) { * @param isReferenceAllele is a reference allele * @return true if the bases represent the well formatted allele */ - @Deprecated static boolean acceptableAlleleBases(String bases, boolean isReferenceAllele) { - return acceptableAlleleBases(bases.getBytes(), isReferenceAllele); + return acceptableAlleleBases(bases.getBytes(StandardCharsets.UTF_8), isReferenceAllele); } /** * @param bases bases representing a reference allele * @return true if the bases represent the well formatted allele */ - @Deprecated static boolean acceptableAlleleBases(byte[] bases) { return acceptableAlleleBases(bases, true); } @@ -315,7 +313,6 @@ static boolean acceptableAlleleBases(byte[] bases) { * @param isReferenceAllele true if a reference allele * @return true if the bases represent the well formatted allele */ - @Deprecated static boolean acceptableAlleleBases(byte[] bases, boolean isReferenceAllele) { if ( wouldBeNullAllele(bases) ) return false; diff --git a/src/main/java/htsjdk/variant/variantcontext/SimpleAllele.java b/src/main/java/htsjdk/variant/variantcontext/SimpleAllele.java index ba4c3d2d44..db61712410 100644 --- a/src/main/java/htsjdk/variant/variantcontext/SimpleAllele.java +++ b/src/main/java/htsjdk/variant/variantcontext/SimpleAllele.java @@ -76,7 +76,7 @@ protected SimpleAllele(final byte[] bases, final boolean isRef) { this.bases = bases; if ( ! Allele.acceptableAlleleBases(bases, isRef) ) - throw new IllegalArgumentException("Unexpected base in allele bases \'" + new String(bases)+"\'"); + throw new IllegalArgumentException("Unexpected base in allele bases '" + new String(bases)+"'"); } protected SimpleAllele(final String bases, final boolean isRef) {