This is an automated email from the ASF dual-hosted git repository.

henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
     new ea98e60  JEXL: test fix for java > 11
ea98e60 is described below

commit ea98e6035daa1fa0478c67501b1af7f7acf4c0d9
Author: henrib <[email protected]>
AuthorDate: Mon Mar 22 14:18:12 2021 +0100

    JEXL: test fix for java > 11
---
 src/test/java/org/apache/commons/jexl3/ArithmeticTest.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java 
b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
index 10dd536..35f7c85 100644
--- a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
+++ b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
@@ -1289,11 +1289,10 @@ public class ArithmeticTest extends JexlTestCase {
         int sep = version.indexOf(".");
         if (sep < 0) {
             sep = version.indexOf("-");
-            if (sep < 0) {
-                sep = 1;
-            }
         }
-        version = version.substring(0, sep);
+        if (sep > 0) {
+            version = version.substring(0, sep);
+        }
         return Integer.parseInt(version);
     }
 

Reply via email to