You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2017/05/04 06:48:00 UTC

[2/3] commons-compress git commit: COMPRESS-392 make test for Brotli check for the library itself

COMPRESS-392 make test for Brotli check for the library itself


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/c4ad0b75
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/c4ad0b75
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/c4ad0b75

Branch: refs/heads/master
Commit: c4ad0b75c1f814d5ec5dd600183fb303f7241c33
Parents: ac73d23
Author: Stefan Bodewig <bo...@apache.org>
Authored: Thu May 4 08:46:49 2017 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Thu May 4 08:46:49 2017 +0200

----------------------------------------------------------------------
 .../apache/commons/compress/compressors/brotli/BrotliUtils.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/c4ad0b75/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliUtils.java b/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliUtils.java
index e73a895..251d98d 100644
--- a/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliUtils.java
+++ b/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliUtils.java
@@ -59,8 +59,9 @@ public class BrotliUtils {
 
     private static boolean internalIsBrotliCompressionAvailable() {
         try {
-            return BrotliCompressorInputStream.matches(null, 0);
-        } catch (final NoClassDefFoundError error) {
+            Class.forName("org.brotli.dec.BrotliInputStream");
+            return true;
+        } catch (NoClassDefFoundError | Exception error) {
             return false;
         }
     }