From ca7cad03e5dad054ab2f4fc86350ea84832046e0 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sun, 29 Dec 2024 11:09:35 -0500 Subject: [PATCH] Add Checkstyle UnnecessaryParentheses --- src/conf/checkstyle/checkstyle.xml | 1 + .../compress/archivers/cpio/CpioArchiveInputStream.java | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/checkstyle/checkstyle.xml b/src/conf/checkstyle/checkstyle.xml index bce06b7289b..8bd71f47d3b 100644 --- a/src/conf/checkstyle/checkstyle.xml +++ b/src/conf/checkstyle/checkstyle.xml @@ -80,6 +80,7 @@ limitations under the License. + diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java index 662b4b733b3..fbb8907fede 100644 --- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java @@ -82,12 +82,10 @@ public static boolean matches(final byte[] signature, final int length) { if (length < 6) { return false; } - // Check binary values - if ((signature[0] == 0x71 && (signature[1] & 0xFF) == 0xc7) || (signature[1] == 0x71 && (signature[0] & 0xFF) == 0xc7)) { + if (signature[0] == 0x71 && (signature[1] & 0xFF) == 0xc7 || signature[1] == 0x71 && (signature[0] & 0xFF) == 0xc7) { return true; } - // Check Ascii (String) values // 3037 3037 30nn if (signature[0] != 0x30) { @@ -115,7 +113,6 @@ public static boolean matches(final byte[] signature, final int length) { if (signature[5] == 0x37) { return true; } - return false; }