pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1792768 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
Date Wed, 26 Apr 2017 16:55:54 GMT
Author: tilman
Date: Wed Apr 26 16:55:54 2017
New Revision: 1792768

URL: http://svn.apache.org/viewvc?rev=1792768&view=rev
Log:
PDFBOX-3766: replace method deprecated in jdk9

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java?rev=1792768&r1=1792767&r2=1792768&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
Wed Apr 26 16:55:54 2017
@@ -202,17 +202,14 @@ public class PDNumberTreeNode implements
      */
     protected COSObjectable convertCOSToPD( COSBase base ) throws IOException
     {
-        COSObjectable retval = null;
         try
         {
-            Constructor<? extends COSObjectable> ctor = valueType.getConstructor(base.getClass());
-            retval = ctor.newInstance(base);
+            return valueType.getDeclaredConstructor(base.getClass()).newInstance(base);
         }
-        catch( Throwable t )
+        catch (ReflectiveOperationException t)
         {
-            throw new IOException( "Error while trying to create value in number tree:" +
t.getMessage(), t);
+            throw new IOException("Error while trying to create value in number tree:" +
t.getMessage(), t);
         }
-        return retval;
     }
 
     /**



Mime
View raw message