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 ca7cad03e5dad054ab2f4fc86350ea84832046e0 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sun Dec 29 11:09:35 2024 -0500 Add Checkstyle UnnecessaryParentheses --- src/conf/checkstyle/checkstyle.xml | 1 + .../commons/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 bce06b728..8bd71f47d 100644 --- a/src/conf/checkstyle/checkstyle.xml +++ b/src/conf/checkstyle/checkstyle.xml @@ -80,6 +80,7 @@ limitations under the License. <module name="SuperClone" /> <module name="SuperFinalize" /> <module name="UnusedImports" /> + <module name="UnnecessaryParentheses" /> <module name="UpperEll" /> <module name="WhitespaceAfter" /> <module name="WhitespaceAround" /> 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 662b4b733..fbb8907fe 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 class CpioArchiveInputStream extends ArchiveInputStream<CpioArchiveEntry> 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 class CpioArchiveInputStream extends ArchiveInputStream<CpioArchiveEntry> if (signature[5] == 0x37) { return true; } - return false; }