pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1792772 - in /pdfbox/trunk: preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidatorFactory.java xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchemaFactory.java
Date Wed, 26 Apr 2017 17:03:18 GMT
Author: tilman
Date: Wed Apr 26 17:03:18 2017
New Revision: 1792772

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

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidatorFactory.java
    pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchemaFactory.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidatorFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidatorFactory.java?rev=1792772&r1=1792771&r2=1792772&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidatorFactory.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidatorFactory.java
Wed Apr 26 17:03:18 2017
@@ -85,12 +85,12 @@ public abstract class AnnotationValidato
         {
             try
             {
-                Constructor<? extends AnnotationValidator> constructor = clazz.getConstructor(PreflightContext.class,
-                        COSDictionary.class);
+                Constructor<? extends AnnotationValidator> constructor =
+                        clazz.getDeclaredConstructor(PreflightContext.class, COSDictionary.class);
                 result = constructor.newInstance(ctx, annotDic);
                 result.setFactory(this);
             }
-            catch (Exception e)
+            catch (ReflectiveOperationException e)
             {
                 throw new ValidationException(e.getMessage(), e);
             }

Modified: pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchemaFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchemaFactory.java?rev=1792772&r1=1792771&r2=1792772&view=diff
==============================================================================
--- pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchemaFactory.java (original)
+++ pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPSchemaFactory.java Wed Apr
26 17:03:18 2017
@@ -21,7 +21,6 @@
 
 package org.apache.xmpbox.schema;
 
-import java.lang.reflect.Constructor;
 
 import org.apache.xmpbox.XMPMetadata;
 import org.apache.xmpbox.type.PropertiesDescription;
@@ -116,20 +115,18 @@ public class XMPSchemaFactory
             schemaArgs = new Object[] { metadata };
         }
 
-        Constructor<? extends XMPSchema> schemaConstructor;
         try
         {
-            schemaConstructor = schemaClass.getConstructor(argsClass);
-            schema = schemaConstructor.newInstance(schemaArgs);
+            schema = schemaClass.getDeclaredConstructor(argsClass).newInstance(schemaArgs);
             if (schema != null)
             {
                 metadata.addSchema(schema);
             }
             return schema;
         }
-        catch (Exception e)
+        catch (ReflectiveOperationException e)
         {
-            throw new XmpSchemaException("Cannot instanciate specified object schema", e);
+            throw new XmpSchemaException("Cannot Instanciate specified Object Schema", e);
         }
     }
 



Mime
View raw message