This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit 034e2c5eb86eb704bd929fbdfa5463419fbd00f9 Author: Gary David Gregory (Code signing key) <ggreg...@apache.org> AuthorDate: Fri Nov 18 23:25:24 2022 -0500 Remove unused cache --- src/main/java/org/apache/bcel/classfile/Unknown.java | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/main/java/org/apache/bcel/classfile/Unknown.java b/src/main/java/org/apache/bcel/classfile/Unknown.java index dd0d956e..b7f8ab50 100644 --- a/src/main/java/org/apache/bcel/classfile/Unknown.java +++ b/src/main/java/org/apache/bcel/classfile/Unknown.java @@ -20,8 +20,6 @@ import java.io.DataInput; import java.io.DataOutputStream; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.apache.bcel.Const; @@ -31,28 +29,11 @@ import org.apache.bcel.Const; * application-specific attributes should create an {@link UnknownAttributeReader} implementation and attach it via * {@link Attribute#addAttributeReader(String, UnknownAttributeReader)}. * - * * @see Attribute * @see UnknownAttributeReader */ public final class Unknown extends Attribute { - private static final Unknown[] EMPTY_ARRAY = {}; - - private static final Map<String, Unknown> UNKNOWN_ATTRIBUTES = new HashMap<>(); - - /** - * @return array of unknown attributes, but just one for each kind. - */ - static Unknown[] getUnknownAttributes() { - try { - return UNKNOWN_ATTRIBUTES.values().toArray(EMPTY_ARRAY); - } finally { - // TODO Does this really make sense? - UNKNOWN_ATTRIBUTES.clear(); - } - } - private byte[] bytes; private final String name; @@ -69,7 +50,6 @@ public final class Unknown extends Attribute { super(Const.ATTR_UNKNOWN, nameIndex, length, constantPool); this.bytes = bytes; name = constantPool.getConstantUtf8(nameIndex).getBytes(); - UNKNOWN_ATTRIBUTES.put(name, this); } /**