You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2022/01/11 00:14:12 UTC

[commons-math] branch master updated: Allow successful build on Java 9+.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9b0fc1f  Allow successful build on Java 9+.
9b0fc1f is described below

commit 9b0fc1fe7faad6b97096953233777e94ec0f7bd1
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Tue Jan 11 01:05:58 2022 +0100

    Allow successful build on Java 9+.
    
    Currently "JdkMath" implements all "Math" methods only on Java 8 (or lower).
---
 .../org/apache/commons/math4/core/jdkmath/JdkMathTest.java     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/commons-math-core/src/test/java/org/apache/commons/math4/core/jdkmath/JdkMathTest.java b/commons-math-core/src/test/java/org/apache/commons/math4/core/jdkmath/JdkMathTest.java
index 659d32f..cf9df11 100644
--- a/commons-math-core/src/test/java/org/apache/commons/math4/core/jdkmath/JdkMathTest.java
+++ b/commons-math-core/src/test/java/org/apache/commons/math4/core/jdkmath/JdkMathTest.java
@@ -32,8 +32,18 @@ public class JdkMathTest {
     /** Separator. */
     private static final String LINE_SEP = System.lineSeparator();
 
+    /**
+     * Drop-in replacement of {@link Math} with {@link JdkMath} is only valid
+     * for Java 8.
+     * Test should be updated when {@code AccurateMath} implements functions
+     * added in Java 9+.
+     */
     @Test
     public void checkMissingMethods() {
+        final String runtimeVersion = System.getProperty("java.runtime.version");
+        final boolean doTest = runtimeVersion.matches("^1\\.8\\..*");
+        org.junit.Assume.assumeTrue(doTest);
+
         final List<String> notFound = compareClassMethods(StrictMath.class,
                                                           JdkMath.class);
         if (!notFound.isEmpty()) {