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 eef08ce57f7fd94134dc404e451abf7bfb0e7a12 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue Oct 4 06:37:45 2022 -0400 Move test Better use of toArray() --- .../commons/compress/harmony/unpack200/bytecode/CodeAttribute.java | 4 +--- .../harmony/unpack200/bytecode/LocalVariableTableAttribute.java | 4 +--- .../harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java | 4 +--- .../harmony/{unpack200 => pack200}/tests/Compress626Test.java | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java index 763311f9..857f9a65 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java @@ -108,9 +108,7 @@ public class CodeAttribute extends BCIRenumberedAttribute { nestedEntries.add(catchType); } } - final ClassFileEntry[] nestedEntryArray = new ClassFileEntry[nestedEntries.size()]; - nestedEntries.toArray(nestedEntryArray); - return nestedEntryArray; + return nestedEntries.toArray(ClassFileEntry.NONE); } @Override diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java index 0c9c48a5..df2503a8 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java @@ -83,9 +83,7 @@ public class LocalVariableTableAttribute extends BCIRenumberedAttribute { nestedEntries.add(names[i]); nestedEntries.add(descriptors[i]); } - final ClassFileEntry[] nestedEntryArray = new ClassFileEntry[nestedEntries.size()]; - nestedEntries.toArray(nestedEntryArray); - return nestedEntryArray; + return nestedEntries.toArray(ClassFileEntry.NONE); } @Override diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java index 514eb143..49d0dae2 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java @@ -96,9 +96,7 @@ public class LocalVariableTypeTableAttribute extends BCIRenumberedAttribute { nestedEntries.add(names[i]); nestedEntries.add(signatures[i]); } - final ClassFileEntry[] nestedEntryArray = new ClassFileEntry[nestedEntries.size()]; - nestedEntries.toArray(nestedEntryArray); - return nestedEntryArray; + return nestedEntries.toArray(ClassFileEntry.NONE); } @Override diff --git a/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/Compress626Test.java b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/Compress626Test.java similarity index 97% rename from src/test/java/org/apache/commons/compress/harmony/unpack200/tests/Compress626Test.java rename to src/test/java/org/apache/commons/compress/harmony/pack200/tests/Compress626Test.java index ef048189..ca0225f9 100644 --- a/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/Compress626Test.java +++ b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/Compress626Test.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.compress.harmony.unpack200.tests; +package org.apache.commons.compress.harmony.pack200.tests; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;