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-compress.git

commit b4a1fcf155eda56d64b7e00f1e9ad40c4a30b97e
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Apr 11 10:26:15 2025 -0400

    Remove superfluous private instance variable
---
 ...meVisibleorInvisibleParameterAnnotationsAttribute.java | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
index e0f5961fb..98c5859bd 100644
--- 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
+++ 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
@@ -70,8 +70,6 @@ public void writeBody(final DataOutputStream dos) throws 
IOException {
 
     }
 
-    private final int numParameters;
-
     private final ParameterAnnotation[] parameterAnnotations;
 
     /**
@@ -82,15 +80,14 @@ public void writeBody(final DataOutputStream dos) throws 
IOException {
      */
     public RuntimeVisibleorInvisibleParameterAnnotationsAttribute(final CPUTF8 
name, final ParameterAnnotation[] parameterAnnotations) {
         super(name);
-        this.numParameters = parameterAnnotations.length;
         this.parameterAnnotations = parameterAnnotations;
     }
 
     @Override
     protected int getLength() {
         int length = 1;
-        for (int i = 0; i < numParameters; i++) {
-            length += parameterAnnotations[i].getLength();
+        for (final ParameterAnnotation parameterAnnotation : 
parameterAnnotations) {
+            length += parameterAnnotation.getLength();
         }
         return length;
     }
@@ -115,14 +112,14 @@ protected void resolve(final ClassConstantPool pool) {
 
     @Override
     public String toString() {
-        return attributeName.underlyingString() + ": " + numParameters + " 
parameter annotations";
+        return attributeName.underlyingString() + ": " + 
parameterAnnotations.length + " parameter annotations";
     }
 
     @Override
     protected void writeBody(final DataOutputStream dos) throws IOException {
-        dos.writeByte(numParameters);
-        for (int i = 0; i < numParameters; i++) {
-            parameterAnnotations[i].writeBody(dos);
+        dos.writeByte(parameterAnnotations.length);
+        for (final ParameterAnnotation parameterAnnotation : 
parameterAnnotations) {
+            parameterAnnotation.writeBody(dos);
         }
     }
 

Reply via email to