Skip to content

Commit

Permalink
Remove deprecation from Allele.acceptableAlleleBases #1623 (#1625)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lbergelson authored Oct 7, 2022
1 parent e490a97 commit 02942a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/main/java/htsjdk/variant/variantcontext/Allele.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package htsjdk.variant.variantcontext;

import java.io.Serializable;
import java.nio.charset.StandardCharsets;

/**
* Immutable representation of an allele.
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 02942a9

Please sign in to comment.