Repository: commons-compress Updated Branches: refs/heads/master 3240f2526 -> ca7ea939e
make Sonar less unhappy Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/ca7ea939 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/ca7ea939 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/ca7ea939 Branch: refs/heads/master Commit: ca7ea939eaa9dad5f00c8a5e269f09681602bc98 Parents: 3240f25 Author: Stefan Bodewig <[email protected]> Authored: Wed May 10 17:15:59 2017 +0200 Committer: Stefan Bodewig <[email protected]> Committed: Wed May 10 17:15:59 2017 +0200 ---------------------------------------------------------------------- .../org/apache/commons/compress/MemoryLimitException.java | 2 +- .../commons/compress/archivers/ArchiveStreamFactory.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/ca7ea939/src/main/java/org/apache/commons/compress/MemoryLimitException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/MemoryLimitException.java b/src/main/java/org/apache/commons/compress/MemoryLimitException.java index 1c5ec07..fe68c0b 100644 --- a/src/main/java/org/apache/commons/compress/MemoryLimitException.java +++ b/src/main/java/org/apache/commons/compress/MemoryLimitException.java @@ -57,7 +57,7 @@ public class MemoryLimitException extends IOException { } private static String buildMessage(long memoryNeededInKb, int memoryLimitInKb) { - return "" + memoryNeededInKb + " kb of memory would be needed; limit was " + return memoryNeededInKb + " kb of memory would be needed; limit was " + memoryLimitInKb + " kb. " + "If the file is not corrupt, consider increasing the memory limit."; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/ca7ea939/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java index ca15363..916e3e1 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java +++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java @@ -499,14 +499,14 @@ public class ArchiveStreamFactory implements ArchiveStreamProvider { signatureLength = IOUtils.readFully(in, signature); in.reset(); } catch (IOException e) { - throw new ArchiveException("IOException while reading signature."); + throw new ArchiveException("IOException while reading signature.", e); } if (ZipArchiveInputStream.matches(signature, signatureLength)) { return ZIP; } else if (JarArchiveInputStream.matches(signature, signatureLength)) { return JAR; - } if (ArArchiveInputStream.matches(signature, signatureLength)) { + } else if (ArArchiveInputStream.matches(signature, signatureLength)) { return AR; } else if (CpioArchiveInputStream.matches(signature, signatureLength)) { return CPIO; @@ -523,7 +523,7 @@ public class ArchiveStreamFactory implements ArchiveStreamProvider { signatureLength = IOUtils.readFully(in, dumpsig); in.reset(); } catch (IOException e) { - throw new ArchiveException("IOException while reading dump signature"); + throw new ArchiveException("IOException while reading dump signature", e); } if (DumpArchiveInputStream.matches(dumpsig, signatureLength)) { return DUMP; @@ -536,7 +536,7 @@ public class ArchiveStreamFactory implements ArchiveStreamProvider { signatureLength = IOUtils.readFully(in, tarHeader); in.reset(); } catch (IOException e) { - throw new ArchiveException("IOException while reading tar signature"); + throw new ArchiveException("IOException while reading tar signature", e); } if (TarArchiveInputStream.matches(tarHeader, signatureLength)) { return TAR; @@ -551,7 +551,7 @@ public class ArchiveStreamFactory implements ArchiveStreamProvider { if (tais.getNextTarEntry().isCheckSumOK()) { return TAR; } - } catch (final Exception e) { // NOPMD + } catch (final Exception e) { // NOPMD // NOSONAR // can generate IllegalArgumentException as well // as IOException // autodetection, simply not a TAR
