You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/19 04:26:06 UTC

[commons-bcel] branch master updated (7168c854 -> c3cd3713)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git


    from 7168c854 Refactor duplicate code
     new 034e2c5e Remove unused cache
     new c3cd3713 Javadoc

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/bcel/classfile/Unknown.java    | 26 ++++------------------
 1 file changed, 4 insertions(+), 22 deletions(-)


[commons-bcel] 01/02: Remove unused cache

Posted by gg...@apache.org.
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) <gg...@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);
     }
 
     /**


[commons-bcel] 02/02: Javadoc

Posted by gg...@apache.org.
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 c3cd371364132383f27d7a03ef70a15651d89041
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Fri Nov 18 23:26:02 2022 -0500

    Javadoc
---
 src/main/java/org/apache/bcel/classfile/Unknown.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/bcel/classfile/Unknown.java b/src/main/java/org/apache/bcel/classfile/Unknown.java
index b7f8ab50..23cd38eb 100644
--- a/src/main/java/org/apache/bcel/classfile/Unknown.java
+++ b/src/main/java/org/apache/bcel/classfile/Unknown.java
@@ -72,9 +72,11 @@ public final class Unknown extends Attribute {
     /**
      * Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a
      * physical copy.
+     *
+     * @param unknown Source.
      */
-    public Unknown(final Unknown c) {
-        this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
+    public Unknown(final Unknown unknown) {
+        this(unknown.getNameIndex(), unknown.getLength(), unknown.getBytes(), unknown.getConstantPool());
     }
 
     /**