xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gad...@apache.org
Subject svn commit: r1311918 - in /xmlgraphics/commons/trunk: ./ src/java/org/apache/xmlgraphics/fonts/ src/java/org/apache/xmlgraphics/java2d/ src/java/org/apache/xmlgraphics/java2d/color/
Date Tue, 10 Apr 2012 18:44:31 GMT
Author: gadams
Date: Tue Apr 10 18:44:31 2012
New Revision: 1311918

URL: http://svn.apache.org/viewvc?rev=1311918&view=rev
Log:
Bugzilla #47174: Should never use Error to report runtime errors.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ICCColorSpaceWithIntent.java
    xmlgraphics/commons/trunk/status.xml

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java?rev=1311918&r1=1311917&r2=1311918&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java Tue Apr 10
18:44:31 2012
@@ -646,7 +646,7 @@ public class Glyphs {
         List lines = new java.util.ArrayList();
         InputStream in = Glyphs.class.getResourceAsStream(filename);
         if (in == null) {
-            throw new Error("Cannot load " + filename
+            throw new RuntimeException("Cannot load " + filename
                     + ". The Glyphs class cannot properly be initialized!");
         }
         try {
@@ -658,10 +658,10 @@ public class Glyphs {
                 }
             }
         } catch (UnsupportedEncodingException uee) {
-            throw new Error("Incompatible JVM! US-ASCII encoding is not supported."
+            throw new RuntimeException("Incompatible JVM! US-ASCII encoding is not supported."
                     + " The Glyphs class cannot properly be initialized!");
         } catch (IOException ioe) {
-            throw new Error("I/O error while loading " + filename
+            throw new RuntimeException("I/O error while loading " + filename
                     + ". The Glyphs class cannot properly be initialized!");
         } finally {
             IOUtils.closeQuietly(in);

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java?rev=1311918&r1=1311917&r2=1311918&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java
Tue Apr 10 18:44:31 2012
@@ -906,7 +906,7 @@ public abstract class AbstractGraphics2D
             }   catch(NoninvertibleTransformException e){
                                 // Should never happen since we checked the
                                 // matrix determinant
-                throw new Error();
+                throw new RuntimeException(e);
             }
 
             gc.transform(xform);

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java?rev=1311918&r1=1311917&r2=1311918&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java Tue
Apr 10 18:44:31 2012
@@ -105,7 +105,7 @@ public class TransformType{
         case TRANSFORM_GENERAL:
             return TransformType.GENERAL;
         default:
-            throw new Error("Unknown TransformType value");
+            throw new RuntimeException("Unknown TransformType value");
         }
     }
 }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ICCColorSpaceWithIntent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ICCColorSpaceWithIntent.java?rev=1311918&r1=1311917&r2=1311918&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ICCColorSpaceWithIntent.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ICCColorSpaceWithIntent.java
Tue Apr 10 18:44:31 2012
@@ -85,7 +85,7 @@ public class ICCColorSpaceWithIntent ext
         case SATURATION:
             return saturationToRGB(values);
         default:
-            throw new Error("invalid intent:" + intent );
+            throw new RuntimeException("invalid intent:" + intent );
         }
     }
 

Modified: xmlgraphics/commons/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/status.xml?rev=1311918&r1=1311917&r2=1311918&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/status.xml (original)
+++ xmlgraphics/commons/trunk/status.xml Tue Apr 10 18:44:31 2012
@@ -41,6 +41,9 @@
   </contexts>
   <changes>
     <release version="Trunk" date="n/a">
+      <action context="Code" dev="GA" type="fix" fixes-bug="47174" due-to="Sebastian Bazley">
+        Should never use Error to report runtime errors.
+      </action>
       <action context="Code" dev="GA" type="fix" fixes-bug="47175" due-to="Sebastian Bazley">
         Ensure that throwables have meaningful messages.
       </action>



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


Mime
View raw message