You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2022/09/14 09:55:02 UTC

svn commit: r1904066 - /poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java

Author: fanningpj
Date: Wed Sep 14 09:55:02 2022
New Revision: 1904066

URL: http://svn.apache.org/viewvc?rev=1904066&view=rev
Log:
try to use IllegalStateException instead of RuntimeException

Modified:
    poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java

Modified: poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java?rev=1904066&r1=1904065&r2=1904066&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/POIDataSamples.java Wed Sep 14 09:55:02 2022
@@ -165,7 +165,7 @@ public final class POIDataSamples {
     public File getFile(String sampleFileName) {
         File f = new File(_resolvedDataDir, sampleFileName);
         if (!f.exists()) {
-            throw new RuntimeException("Sample file '" + sampleFileName
+            throw new IllegalStateException("Sample file '" + sampleFileName
                     + "' not found in data dir '" + _resolvedDataDir.getAbsolutePath() + "'");
         }
         try {
@@ -175,12 +175,12 @@ public final class POIDataSamples {
                   fn = fn.substring(fn.indexOf('/')+1);
                }
                if(!fn.equals(f.getCanonicalFile().getName())){
-                   throw new RuntimeException("File name is case-sensitive: requested '" + fn
+                   throw new IllegalStateException("File name is case-sensitive: requested '" + fn
                         + "' but actual file is '" + f.getCanonicalFile().getName() + "'");
                }
             }
         } catch (IOException e){
-            throw new RuntimeException(e);
+            throw new IllegalStateException(e);
         }
         return f;
     }



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