commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/2] commons-compress git commit: don't wrap XZ for Java's exception
Date Mon, 19 Dec 2016 17:52:11 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 587430df7 -> b03521d07


don't wrap XZ for Java's exception

should be backwards compatible as I'm only changing the signature of a
package private method in a package private class.


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

Branch: refs/heads/master
Commit: bcc204d7d0c2fa22970cea1e82691e6f6340e0c2
Parents: 587430d
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Mon Dec 19 18:50:38 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Mon Dec 19 18:50:38 2016 +0100

----------------------------------------------------------------------
 .../commons/compress/archivers/sevenz/CoderBase.java  |  4 ++--
 .../compress/archivers/sevenz/LZMADecoder.java        | 14 +++-----------
 2 files changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/bcc204d7/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java
index 153f58c..3842513 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java
@@ -50,14 +50,14 @@ abstract class CoderBase {
     /**
      * @return property-bytes to write in a Folder block
      */
-    byte[] getOptionsAsProperties(final Object options) {
+    byte[] getOptionsAsProperties(final Object options) throws IOException {
         return NONE;
     }
 
     /**
      * @return configuration options that have been used to create the given InputStream
from the given Coder
      */
-    Object getOptionsFromCoder(final Coder coder, final InputStream in) {
+    Object getOptionsFromCoder(final Coder coder, final InputStream in) throws IOException
{
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/bcc204d7/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMADecoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMADecoder.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMADecoder.java
index 7a0ca8d..07c80ef 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMADecoder.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMADecoder.java
@@ -52,7 +52,7 @@ class LZMADecoder extends CoderBase {
     }
 
     @Override
-    byte[] getOptionsAsProperties(final Object opts) {
+    byte[] getOptionsAsProperties(final Object opts) throws IOException {
         final LZMA2Options options = getOptions(opts);
         final byte props = (byte) ((options.getPb() * 5 + options.getLp()) * 9 + options.getLc());
         int dictSize = options.getDictSize();
@@ -66,8 +66,7 @@ class LZMADecoder extends CoderBase {
     }
 
     @Override
-    Object getOptionsFromCoder(final Coder coder, final InputStream in) {
-        try {
+    Object getOptionsFromCoder(final Coder coder, final InputStream in) throws IOException
{
             final byte propsByte = coder.properties[0];
             int props = propsByte & 0xFF;
             int pb = props / (9 * 5);
@@ -79,9 +78,6 @@ class LZMADecoder extends CoderBase {
             opts.setLcLp(lc, lp);
             opts.setDictSize(getDictionarySize(coder));
             return opts;
-        } catch (UnsupportedOptionsException ex) {
-            throw new RuntimeException(ex);
-        }
     }
 
     private int getDictSize(final Object opts) {
@@ -99,16 +95,12 @@ class LZMADecoder extends CoderBase {
         return (int) dictSize;
     }
 
-    private LZMA2Options getOptions(final Object opts) {
+    private LZMA2Options getOptions(final Object opts) throws IOException {
         if (opts instanceof LZMA2Options) {
             return (LZMA2Options) opts;
         }
         final LZMA2Options options = new LZMA2Options();
-        try {
             options.setDictSize(numberOptionOrDefault(opts));
-        } catch (UnsupportedOptionsException ex) {
-            throw new RuntimeException(ex);
-        }
         return options;
     }
 


Mime
View raw message