pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1685267 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Date Sat, 13 Jun 2015 15:06:28 GMT
Author: tilman
Date: Sat Jun 13 15:06:27 2015
New Revision: 1685267

URL: http://svn.apache.org/r1685267
Log:
PDFBOX-2576: replace throw new RuntimeException with IllegalArgumentException + javadoc

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java?rev=1685267&r1=1685266&r2=1685267&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java Sat Jun 13
15:06:27 2015
@@ -72,12 +72,13 @@ public class Splitter
      * page.
      *
      * @param split The number of pages each split document should contain.
+     * @throws IllegalArgumentException if the page is smaller than one.
      */
     public void setSplitAtPage(int split)
     {
         if(split <= 0)
         {
-            throw new RuntimeException("Error split must be at least one page.");
+            throw new IllegalArgumentException("Number of pages is smaller than one");
         }
         splitLength = split;
     }
@@ -86,12 +87,13 @@ public class Splitter
      * This will set the start page.
      *
      * @param start the start page
+     * @throws IllegalArgumentException if the start page is smaller than one.
      */
     public void setStartPage(int start)
     {
         if(start <= 0)
         {
-            throw new RuntimeException("Error split must be at least one page.");
+            throw new IllegalArgumentException("Start page is smaller than one");
         }
         startPage = start;
     }
@@ -100,12 +102,13 @@ public class Splitter
      * This will set the end page.
      *
      * @param end the end page
+     * @throws IllegalArgumentException if the end page is smaller than one.
      */
     public void setEndPage(int end)
     {
         if(end <= 0)
         {
-            throw new RuntimeException("Error split must be at least one page.");
+            throw new IllegalArgumentException("End page is smaller than one");
         }
         endPage = end;
     }



Mime
View raw message