aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-math/src
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2023-02-15 23:08:25 +0100
committerJulien Gouesse <[email protected]>2023-02-15 23:08:25 +0100
commitaa6df077361bf1470d3799514f5774951025bed4 (patch)
treeef4161d363c026cfcdf9ac884f91a16bf09869ef /ardor3d-math/src
parentd0444773304dd536898183e361d2737315aee6b5 (diff)
Removes some deprecated calls in order to ease compilation with future versions of Java
Diffstat (limited to 'ardor3d-math/src')
-rw-r--r--ardor3d-math/src/main/java/com/ardor3d/math/MathConstants.java34
-rw-r--r--ardor3d-math/src/main/java/com/ardor3d/math/ObjectPool.java2
2 files changed, 5 insertions, 31 deletions
diff --git a/ardor3d-math/src/main/java/com/ardor3d/math/MathConstants.java b/ardor3d-math/src/main/java/com/ardor3d/math/MathConstants.java
index e03e1f6..2204fd2 100644
--- a/ardor3d-math/src/main/java/com/ardor3d/math/MathConstants.java
+++ b/ardor3d-math/src/main/java/com/ardor3d/math/MathConstants.java
@@ -15,42 +15,16 @@ package com.ardor3d.math;
*/
public class MathConstants {
- public static final boolean useMathPools;
+ public static final boolean useMathPools = System.getProperty("ardor3d.noMathPools") == null;
- public static final boolean useFastMath;
+ public static final boolean useFastMath = System.getProperty("ardor3d.useFastMath") != null;
- public static final int maxMathPoolSize;
+ public static final int maxMathPoolSize = Integer.parseInt(System.getProperty("ardor3d.maxMathPoolSize", "11"));
/**
* Flag indicating whether zero floating-point representations's sign is taken into account when comparing values.
* <code>true</code> when -0.0 and 0.0 are considered equal, otherwise <code>false</code>. Ignoring the sign
* produces a numerically correct behavior but is inconsistent with java.lang.Double.compare()
*/
- public static final boolean ignoreZeroFloatingPointRepresentationSign;
-
- static {
- boolean hasPropertyAccess = true;
- try {
- if (System.getSecurityManager() != null) {
- System.getSecurityManager().checkPropertiesAccess();
- }
- } catch (final SecurityException e) {
- hasPropertyAccess = false;
- }
-
- if (hasPropertyAccess) {
- useMathPools = (System.getProperty("ardor3d.noMathPools") == null);
- useFastMath = (System.getProperty("ardor3d.useFastMath") != null);
- maxMathPoolSize = (System.getProperty("ardor3d.maxMathPoolSize") != null
- ? Integer.parseInt(System.getProperty("ardor3d.maxMathPoolSize"))
- : 11);
- ignoreZeroFloatingPointRepresentationSign = (System
- .getProperty("ardor3d.useZeroFloatingPointRepresentationSign") == null);
- } else {
- useMathPools = true;
- useFastMath = false;
- maxMathPoolSize = 11;
- ignoreZeroFloatingPointRepresentationSign = true;
- }
- }
+ public static final boolean ignoreZeroFloatingPointRepresentationSign = System.getProperty("ardor3d.useZeroFloatingPointRepresentationSign") == null;
}
diff --git a/ardor3d-math/src/main/java/com/ardor3d/math/ObjectPool.java b/ardor3d-math/src/main/java/com/ardor3d/math/ObjectPool.java
index 53fcf1c..5594e4b 100644
--- a/ardor3d-math/src/main/java/com/ardor3d/math/ObjectPool.java
+++ b/ardor3d-math/src/main/java/com/ardor3d/math/ObjectPool.java
@@ -57,7 +57,7 @@ public abstract class ObjectPool<T extends Poolable> {
@Override
protected T newInstance() {
try {
- return clazz.newInstance();
+ return clazz.getDeclaredConstructor().newInstance();
} catch (final Exception e) {
throw new RuntimeException(e);
}