xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sstei...@apache.org
Subject svn commit: r1780540 - in /xmlgraphics/commons/trunk/src: main/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java main/java/org/apache/xmlgraphics/util/Service.java test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTestCase.java
Date Fri, 27 Jan 2017 11:10:50 GMT
Author: ssteiner
Date: Fri Jan 27 11:10:50 2017
New Revision: 1780540

URL: http://svn.apache.org/viewvc?rev=1780540&view=rev
Log:
FOP-2643: Java 9 warnings

Modified:
    xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java
    xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/util/Service.java
    xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTestCase.java

Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java?rev=1780540&r1=1780539&r2=1780540&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java
(original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java
Fri Jan 27 11:10:50 2017
@@ -19,6 +19,7 @@
 
 package org.apache.xmlgraphics.ps.dsc;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.Map;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
@@ -98,13 +99,17 @@ public final class DSCCommentFactory {
             return null;
         }
         try {
-            return (DSCComment)clazz.newInstance();
+            return (DSCComment)clazz.getDeclaredConstructor().newInstance();
         } catch (InstantiationException e) {
             throw new RuntimeException("Error instantiating instance for '" + name + "':
"
                     + e.getMessage());
         } catch (IllegalAccessException e) {
             throw new RuntimeException("Illegal Access error while instantiating instance
for '"
                     + name + "': " + e.getMessage());
+        } catch (NoSuchMethodException e) {
+            throw new RuntimeException(e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException(e);
         }
     }
 

Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/util/Service.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/util/Service.java?rev=1780540&r1=1780539&r2=1780540&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/util/Service.java (original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/util/Service.java Fri Jan
27 11:10:50 2017
@@ -82,7 +82,7 @@ public final class Service {
             for (String name : names) {
                 try {
                     // Try and load the class
-                    Object obj = cl.loadClass(name).newInstance();
+                    Object obj = cl.loadClass(name).getDeclaredConstructor().newInstance();
                     // stick it into our vector...
                     l.add(obj);
                 } catch (Exception ex) {

Modified: xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTestCase.java?rev=1780540&r1=1780539&r2=1780540&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTestCase.java
(original)
+++ xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/util/DoubleFormatUtilTestCase.java
Fri Jan 27 11:10:50 2017
@@ -20,6 +20,7 @@
 package org.apache.xmlgraphics.util;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
 import java.util.Locale;
@@ -297,7 +298,7 @@ public class DoubleFormatUtilTestCase {
         buf.setLength(0);
         BigDecimal bg = new BigDecimal(Double.toString(value));
         int scale = Math.abs(value) < 1.0 ? precision : decimals;
-        bg = bg.setScale(scale, BigDecimal.ROUND_HALF_UP);
+        bg = bg.setScale(scale, RoundingMode.HALF_UP);
         //buf.append(bg.toString()); // Java 1.4
         buf.append(bg.toPlainString()); // Java 1.5 and more !
         if (buf.indexOf(".") >= 0) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message