pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1854780 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java
Date Mon, 04 Mar 2019 17:00:16 GMT
Author: tilman
Date: Mon Mar  4 17:00:16 2019
New Revision: 1854780

URL: http://svn.apache.org/viewvc?rev=1854780&view=rev
Log:
PDFBOX-4479: remove ReflectiveOperationException that doesn't exist in jdk6

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java?rev=1854780&r1=1854779&r2=1854780&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Hex.java Mon Mar  4 17:00:16
2019
@@ -20,6 +20,7 @@ package org.apache.pdfbox.util;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -201,7 +202,19 @@ public final class Hex
             Method decodeMethod = base64Decoder.getClass().getMethod("decode", String.class);
             return (byte[]) decodeMethod.invoke(base64Decoder, base64Value.replaceAll("\\s",
""));
         }
-        catch (ReflectiveOperationException ex)
+        catch (ClassNotFoundException ex)
+        {
+            LOG.debug(ex);
+        }
+        catch (IllegalAccessException ex)
+        {
+            LOG.debug(ex);
+        }
+        catch (IllegalArgumentException ex)
+        {
+            LOG.debug(ex);
+        }
+        catch (NoSuchMethodException ex)
         {
             LOG.debug(ex);
         }
@@ -209,6 +222,10 @@ public final class Hex
         {
             LOG.debug(ex);
         }
+        catch (InvocationTargetException ex)
+        {
+            LOG.debug(ex);
+        }
         try
         {
             // up to java7? javax.xml.bind.DatatypeConverter.parseBase64Binary()
@@ -216,7 +233,19 @@ public final class Hex
             Method parseBase64BinaryMethod = datatypeConverterClass.getMethod("parseBase64Binary",
String.class);
             return (byte[]) parseBase64BinaryMethod.invoke(null, base64Value);
         }
-        catch (ReflectiveOperationException ex)
+        catch (ClassNotFoundException ex)
+        {
+            LOG.debug(ex);
+        }
+        catch (IllegalAccessException ex)
+        {
+            LOG.debug(ex);
+        }
+        catch (IllegalArgumentException ex)
+        {
+            LOG.debug(ex);
+        }
+        catch (NoSuchMethodException ex)
         {
             LOG.debug(ex);
         }
@@ -224,6 +253,10 @@ public final class Hex
         {
             LOG.debug(ex);
         }
+        catch (InvocationTargetException ex)
+        {
+            LOG.debug(ex);
+        }
         LOG.error("Can't decode base64 value, try adding javax.xml.bind:jaxb-api to your
build");
         return new byte[0];
     }



Mime
View raw message