pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1792777 - in /pdfbox/branches/1.8: jempbox/src/main/java/org/apache/jempbox/xmp/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/ xmpbox/src/main/java/org/apache/xmpbox/type/ xmpbox/src/test/java/org/apache/xmpbox/type/
Date Wed, 26 Apr 2017 17:18:38 GMT
Author: tilman
Date: Wed Apr 26 17:18:38 2017
New Revision: 1792777

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

Modified:
    pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPMetadata.java
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryptionManager.java
    pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java
    pdfbox/branches/1.8/xmpbox/src/test/java/org/apache/xmpbox/type/TestDerivedType.java

Modified: pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPMetadata.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPMetadata.java?rev=1792777&r1=1792776&r2=1792777&view=diff
==============================================================================
--- pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPMetadata.java (original)
+++ pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPMetadata.java Wed
Apr 26 17:18:38 2017
@@ -621,7 +621,7 @@ public class XMPMetadata
                     try
                     {
                         Constructor<?> ctor = schemaClass
-                                .getConstructor(new Class[] { Element.class,
+                                .getDeclaredConstructor(new Class[] { Element.class,
                                         String.class });
                         retval.add((XMPSchema)ctor.newInstance(new Object[] { schema,
                                 name.substring(6) }));

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryptionManager.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryptionManager.java?rev=1792777&r1=1792776&r2=1792777&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryptionManager.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PDEncryptionManager.java
Wed Apr 26 17:18:38 2017
@@ -88,7 +88,7 @@ public class PDEncryptionManager
             {
                 try
                 {
-                    Constructor ctor = handlerClass.getConstructor( new Class[] {
+                    Constructor ctor = handlerClass.getDeclaredConstructor( new Class[] {
                         COSDictionary.class
                     } );
                     retval = ctor.newInstance( new Object[] {

Modified: pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java?rev=1792777&r1=1792776&r2=1792777&view=diff
==============================================================================
--- pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java (original)
+++ pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java Wed Apr
26 17:18:38 2017
@@ -128,12 +128,12 @@ public final class TypeMapping
             Class<? extends AbstractStructuredType> propertyTypeClass = type.getImplementingClass().asSubclass(
                     AbstractStructuredType.class);
             Constructor<? extends AbstractStructuredType> construct = propertyTypeClass
-                    .getConstructor(new Class<?>[] { XMPMetadata.class });
+                    .getDeclaredConstructor(new Class<?>[] { XMPMetadata.class });
             AbstractStructuredType tmp = construct.newInstance(metadata);
             tmp.setPropertyName(propertyName);
             return tmp;
         }
-        catch (InvocationTargetException e)
+        catch (ReflectiveOperationException e)
         {
             throw new BadFieldValueException("Failed to instanciate structured type : " +
type, e);
         }
@@ -141,22 +141,6 @@ public final class TypeMapping
         {
             throw new BadFieldValueException("Failed to instanciate structured type : " +
type, e);
         }
-        catch (InstantiationException e)
-        {
-            throw new BadFieldValueException("Failed to instanciate structured type : " +
type, e);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new BadFieldValueException("Failed to instanciate structured type : " +
type, e);
-        }
-        catch (SecurityException e)
-        {
-            throw new BadFieldValueException("Failed to instanciate structured type : " +
type, e);
-        }
-        catch (NoSuchMethodException e)
-        {
-            throw new BadFieldValueException("Failed to instanciate structured type : " +
type, e);
-        }
     }
 
     public AbstractStructuredType instanciateDefinedType(String propertyName, String namespace)
@@ -174,7 +158,7 @@ public final class TypeMapping
         {
             Class<? extends AbstractSimpleProperty> clz = type.getImplementingClass().asSubclass(
                     AbstractSimpleProperty.class);
-            Constructor<? extends AbstractSimpleProperty> cons = clz.getConstructor(simplePropertyConstParams);
+            Constructor<? extends AbstractSimpleProperty> cons = clz.getDeclaredConstructor(simplePropertyConstParams);
             return cons.newInstance(params);
         }
         catch (NoSuchMethodError e)

Modified: pdfbox/branches/1.8/xmpbox/src/test/java/org/apache/xmpbox/type/TestDerivedType.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/xmpbox/src/test/java/org/apache/xmpbox/type/TestDerivedType.java?rev=1792777&r1=1792776&r2=1792777&view=diff
==============================================================================
--- pdfbox/branches/1.8/xmpbox/src/test/java/org/apache/xmpbox/type/TestDerivedType.java (original)
+++ pdfbox/branches/1.8/xmpbox/src/test/java/org/apache/xmpbox/type/TestDerivedType.java Wed
Apr 26 17:18:38 2017
@@ -82,7 +82,7 @@ public class TestDerivedType
     public void before() throws Exception
     {
         xmp = XMPMetadata.createXMPMetadata();
-        constructor = clz.getConstructor(new Class[] { XMPMetadata.class, String.class, String.class,
String.class,
+        constructor = clz.getDeclaredConstructor(new Class[] { XMPMetadata.class, String.class,
String.class, String.class,
                 Object.class });
     }
 



Mime
View raw message