Author: kiwiwings
Date: Sat Jan 16 11:36:45 2021
New Revision: 1885553

URL: http://svn.apache.org/viewvc?rev=1885553&view=rev
Log:
integration tests: Fix JDK version handling

Modified:
    poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java?rev=1885553&r1=1885552&r2=1885553&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java 
(original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java Sat 
Jan 16 11:36:45 2021
@@ -88,15 +88,8 @@ import org.opentest4j.AssertionFailedErr
 @Execution(ExecutionMode.CONCURRENT)
 public class TestAllFiles {
     private static final File ROOT_DIR = new File("test-data");
-    private static final int jreVersion;
-
-    static {
-        String version = System.getProperty("java.version");
-        String major = version.startsWith("1.")
-            ? version.substring(2, 3)
-            : version.substring(0, version.indexOf("."));
-        jreVersion = Integer.parseInt(major);
-    }
+    private static final int jreVersion =
+        
Integer.parseInt(System.getProperty("java.version").replaceAll("^(?:1\\.)?(\\d+).*",
 "$1"));
 
     public static final String[] SCAN_EXCLUDES = {
         "**/.svn/**",



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to