This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 6b6949adfd Revert "OAK-11769 : replaced DoubleMath.fuzzyCompare with
commons-math3 Precision (#2345)"
6b6949adfd is described below
commit 6b6949adfdca0cf188a3324deca198c5f686f9e4
Author: Julian Reschke <[email protected]>
AuthorDate: Mon Jun 23 18:07:01 2025 +0100
Revert "OAK-11769 : replaced DoubleMath.fuzzyCompare with commons-math3
Precision (#2345)"
This reverts commit b9c3070c74906311516645e3452026b90281ef05.
---
oak-it-osgi/test-bundles.xml | 1 -
oak-run-elastic/pom.xml | 2 +-
oak-store-document/pom.xml | 4 ----
.../oak/plugins/document/mongo/MongoThrottlerFactory.java | 10 +++++-----
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/oak-it-osgi/test-bundles.xml b/oak-it-osgi/test-bundles.xml
index bb4c32c814..b21a048825 100644
--- a/oak-it-osgi/test-bundles.xml
+++ b/oak-it-osgi/test-bundles.xml
@@ -39,7 +39,6 @@
<include>commons-logging:commons-logging</include>
<include>com.fasterxml.jackson.core:jackson-core</include>
<include>org.apache.commons:commons-lang3</include>
- <include>org.apache.commons:commons-math3</include>
<include>org.apache.commons:commons-text</include>
<include>org.apache.commons:commons-collections4</include>
<include>org.apache.jackrabbit:jackrabbit-jcr-commons</include>
diff --git a/oak-run-elastic/pom.xml b/oak-run-elastic/pom.xml
index 8385808b91..37013d6fe2 100644
--- a/oak-run-elastic/pom.xml
+++ b/oak-run-elastic/pom.xml
@@ -42,7 +42,7 @@
105 MB: Azure updates
107 MB: RDB/Tomcat (OAK-10752)
-->
- <max.jar.size>119000000</max.jar.size>
+ <max.jar.size>117000000</max.jar.size>
</properties>
diff --git a/oak-store-document/pom.xml b/oak-store-document/pom.xml
index 141a4b69a4..c89f0c37bf 100644
--- a/oak-store-document/pom.xml
+++ b/oak-store-document/pom.xml
@@ -152,10 +152,6 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-math3</artifactId>
- </dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
diff --git
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoThrottlerFactory.java
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoThrottlerFactory.java
index 30fbf23998..a519335366 100644
---
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoThrottlerFactory.java
+++
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoThrottlerFactory.java
@@ -18,11 +18,11 @@
*/
package org.apache.jackrabbit.oak.plugins.document.mongo;
-import org.apache.commons.math3.util.Precision;
import org.apache.jackrabbit.guava.common.util.concurrent.AtomicDouble;
import org.apache.jackrabbit.oak.plugins.document.Throttler;
import org.jetbrains.annotations.NotNull;
+import static org.apache.jackrabbit.guava.common.math.DoubleMath.fuzzyCompare;
import static java.util.Objects.requireNonNull;
import static
org.apache.jackrabbit.oak.plugins.document.Throttler.NO_THROTTLING;
@@ -78,13 +78,13 @@ public final class MongoThrottlerFactory {
final double oplogWindow = this.oplogWindow.doubleValue();
long throttleTime = throttlingTime;
- if (Precision.compareTo(oplogWindow,threshold/8, 0.001) <= 0) {
+ if (fuzzyCompare(oplogWindow,threshold/8, 0.001) <= 0) {
throttleTime = throttleTime * 8;
- } else if (Precision.compareTo(oplogWindow,threshold/4, 0.001) <=
0) {
+ } else if (fuzzyCompare(oplogWindow,threshold/4, 0.001) <= 0) {
throttleTime = throttleTime * 4;
- } else if (Precision.compareTo(oplogWindow, threshold/2, 0.001) <=
0) {
+ } else if (fuzzyCompare(oplogWindow, threshold/2, 0.001) <= 0) {
throttleTime = throttleTime * 2;
- } else if (Precision.compareTo(oplogWindow, threshold,0.001) <= 0)
{
+ } else if (fuzzyCompare(oplogWindow, threshold,0.001) <= 0) {
throttleTime = throttlingTime;
} else {
throttleTime = 0;