You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2015/06/19 19:43:08 UTC

svn commit: r1686464 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/FontMetrics.java

Author: tilman
Date: Fri Jun 19 17:43:08 2015
New Revision: 1686464

URL: http://svn.apache.org/r1686464
Log:
PDFBOX-2576: Don't throw raw exception type

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/FontMetrics.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/FontMetrics.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/FontMetrics.java?rev=1686464&r1=1686463&r2=1686464&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/FontMetrics.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/FontMetrics.java Fri Jun 19 17:43:08 2015
@@ -213,13 +213,14 @@ public class FontMetrics
      * This will set the metricSets attribute.  This value must be 0,1, or 2.
      *
      * @param metricSetsValue The new metric sets attribute.
+     * @throws IllegalArgumentException If the metricSets attribute is not 0,1, or 2.
      */
     public void setMetricSets( int metricSetsValue )
     {
         if( metricSetsValue < 0 || metricSetsValue > 2 )
         {
-            throw new RuntimeException( "The metricSets attribute must be in the " +
-                                        "set {0,1,2} and not '" + metricSetsValue + "'" );
+            throw new IllegalArgumentException("The metricSets attribute must be in the "
+                    + "set {0,1,2} and not '" + metricSetsValue + "'");
         }
         metricSets = metricSetsValue;
     }