From f2f92d4ffcaa28bad1b91ea010de40e7797816eb Mon Sep 17 00:00:00 2001 From: John Marshall Date: Tue, 13 Jun 2023 21:45:44 +1200 Subject: [PATCH] Remove Slice setAttribute zero-length-array check Slices' optional tags follow the rules for BAM tagged fields, so zero-length 'B' arrays are valid. Slice tags are currently unused, so the question is somewhat moot and there are no test cases. --- src/main/java/htsjdk/samtools/cram/structure/Slice.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/htsjdk/samtools/cram/structure/Slice.java b/src/main/java/htsjdk/samtools/cram/structure/Slice.java index ae569d0836..88b9bdef0a 100644 --- a/src/main/java/htsjdk/samtools/cram/structure/Slice.java +++ b/src/main/java/htsjdk/samtools/cram/structure/Slice.java @@ -745,9 +745,6 @@ public void setReferenceMD5(final CRAMReferenceRegion cramReferenceRegion) { * @param value tag value */ public void setAttribute(final String tag, final Object value) { - if (value != null && value.getClass().isArray() && Array.getLength(value) == 0) { - throw new IllegalArgumentException("Empty value passed for tag " + tag); - } setAttribute(SAMTag.makeBinaryTag(tag), value); }