You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2026/01/08 18:51:53 UTC
(turbine-core) branch trunk updated (31d9a1b7 -> 09beefe2)
This is an automated email from the ASF dual-hosted git repository.
tv pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git
from 31d9a1b7 Document changes
new 0c440728 Remove useless double check
new b5f51e10 Fix log message
new db39340d Use Base64 from JDK, removing commons-codec dependency
new fc815459 Rely on library cache
new 09beefe2 Remove explicit declared transitive dependencies not used directly
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 39 ++--------
.../services/schedule/AbstractJobEntry.java | 15 ++--
.../schedule/AbstractSchedulerService.java | 2 +-
.../services/uniqueid/TurbineUniqueIdService.java | 5 +-
.../org/apache/turbine/util/BrowserDetector.java | 90 ++++------------------
5 files changed, 34 insertions(+), 117 deletions(-)
(turbine-core) 05/05: Remove explicit declared transitive dependencies not used directly
Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git
commit 09beefe29591017db1fd2d86c2f1f8cafeb557d4
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Thu Jan 8 19:51:50 2026 +0100
Remove explicit declared transitive dependencies not used directly
---
pom.xml | 39 +++++++--------------------------------
1 file changed, 7 insertions(+), 32 deletions(-)
diff --git a/pom.xml b/pom.xml
index 14af3863..0c3c5f64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -892,11 +892,6 @@
<artifactId>avalon-framework-api</artifactId>
<version>4.3.1</version>
</dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.20.0</version>
- </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
@@ -917,11 +912,6 @@
<artifactId>commons-text</artifactId>
<version>1.15.0</version>
</dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.11.0</version>
- </dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
@@ -960,12 +950,6 @@
<artifactId>fulcrum-parser</artifactId>
<version>${fulcrum.parser}</version>
</dependency>
- <!-- overrid dep from torque-runtime -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-pool2</artifactId>
- <version>2.13.1</version>
- </dependency>
<dependency>
<groupId>org.apache.fulcrum</groupId>
<artifactId>fulcrum-intake</artifactId>
@@ -1004,10 +988,6 @@
<groupId>avalon-logkit</groupId>
<artifactId>avalon-logkit</artifactId>
</exclusion>
- <exclusion><!-- already provided -->
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-1.2-api</artifactId>
- </exclusion>
</exclusions>
</dependency>
<!-- use default dbcp2 from torque-runtime -->
@@ -1055,11 +1035,6 @@
<artifactId>json</artifactId>
<version>20251224</version>
</dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-jcl</artifactId>
- <version>${turbine.log4j2.version}</version>
- </dependency>
<!-- java testcontainers uses slf4j-api, need for log4j-slf4j-impl mapping -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -1070,7 +1045,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>2.0.13</version>
+ <version>2.0.16</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -1089,12 +1064,6 @@
<artifactId>log4j-jakarta-web</artifactId>
<version>${turbine.log4j2.version}</version>
</dependency>
- <!-- optional log4j1.2 bridge instead of log4j -->
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-1.2-api</artifactId>
- <version>${turbine.log4j2.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
@@ -1138,6 +1107,12 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>5.12.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
(turbine-core) 01/05: Remove useless double check
Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git
commit 0c4407288d53ab6527af637cf25b9931af91f9cc
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Thu Jan 8 19:48:47 2026 +0100
Remove useless double check
---
.../turbine/services/schedule/AbstractJobEntry.java | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/java/org/apache/turbine/services/schedule/AbstractJobEntry.java b/src/java/org/apache/turbine/services/schedule/AbstractJobEntry.java
index 8a7700af..128bc991 100644
--- a/src/java/org/apache/turbine/services/schedule/AbstractJobEntry.java
+++ b/src/java/org/apache/turbine/services/schedule/AbstractJobEntry.java
@@ -297,8 +297,7 @@ public abstract class AbstractJobEntry implements JobEntry
* I know this is kinda ugly! If you can think of a cleaner way
* to do this, please jump in!
*
- * @return A number specifying the type of schedule. See
- * calcRunTime().
+ * @return An enum specifying the type of schedule. See {@link #calcRunTime() calcRunTime}.
* @throws TurbineException a generic exception.
*/
private ScheduleType evaluateJobType()
@@ -327,9 +326,9 @@ public abstract class AbstractJobEntry implements JobEntry
}
else
{
- // Must be a job run by the minute so we need minutes and
- // seconds.
- if (getMinute() < 0 || getSecond() < 0)
+ // Must be a job run by the minute so we have minutes and
+ // need seconds.
+ if (getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
@@ -340,8 +339,8 @@ public abstract class AbstractJobEntry implements JobEntry
else
{
// Must be a daily job by hours minutes, and seconds. In
- // this case, we need the minute, second, and hour params.
- if (getMinute() < 0 || getHour() < 0 || getSecond() < 0)
+ // this case, we have the hor and need the minute, and second params.
+ if (getMinute() < 0 || getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
@@ -365,7 +364,7 @@ public abstract class AbstractJobEntry implements JobEntry
{
// Must be a day of the month job. In this case, we need
// minute, second, and hour params
- if (getMinute() < 0 || getHour() < 0)
+ if (getMinute() < 0 || getHour() < 0 || getSecond() < 0)
{
throw new TurbineException("Error in JobEntry. Bad Job parameter.");
}
(turbine-core) 04/05: Rely on library cache
Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git
commit fc815459c077d7fdc3b760647a19ecd077a81fd8
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Thu Jan 8 19:50:34 2026 +0100
Rely on library cache
---
.../org/apache/turbine/util/BrowserDetector.java | 90 ++++------------------
1 file changed, 17 insertions(+), 73 deletions(-)
diff --git a/src/java/org/apache/turbine/util/BrowserDetector.java b/src/java/org/apache/turbine/util/BrowserDetector.java
index 58e5be28..6a6bc73f 100644
--- a/src/java/org/apache/turbine/util/BrowserDetector.java
+++ b/src/java/org/apache/turbine/util/BrowserDetector.java
@@ -1,26 +1,6 @@
package org.apache.turbine.util;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
+import java.util.Objects;
import nl.basjes.parse.useragent.UserAgent;
import nl.basjes.parse.useragent.UserAgentAnalyzer;
@@ -50,26 +30,9 @@ public class BrowserDetector
UserAgent.AGENT_VERSION,
UserAgent.OPERATING_SYSTEM_NAME)
.hideMatcherLoadStats()
+ .withCache(10000)
.build();
- /** The user agent cache. */
- private static volatile ConcurrentMap<String, UserAgent> userAgentCache =
- new ConcurrentHashMap<>();
-
- /** The browser name specified in the user agent string. */
- private String browserName = "";
-
- /**
- * The browser version specified in the user agent string. If we
- * can't parse the version just assume an old browser.
- */
- private float browserVersion = (float) 1.0;
-
- /**
- * The browser platform specified in the user agent string.
- */
- private String browserPlatform = "unknown";
-
/**
* Constructor used to initialize this class.
*
@@ -78,15 +41,6 @@ public class BrowserDetector
public BrowserDetector(String userAgentString)
{
this.userAgentString = userAgentString;
- UserAgent userAgent = getUserAgent();
-
- // Get the browser name and version.
- browserName = userAgent.getValue(UserAgent.AGENT_NAME);
- String version = userAgent.getValue(UserAgent.AGENT_VERSION);
- browserVersion = toFloat(version);
-
- // Try to figure out what platform.
- browserPlatform = userAgent.getValue(UserAgent.OPERATING_SYSTEM_NAME);
}
/**
@@ -106,7 +60,10 @@ public class BrowserDetector
*/
public String getBrowserName()
{
- return browserName;
+ // Get the browser name.
+ return Objects.requireNonNullElse(
+ getUserAgent().getValue(UserAgent.AGENT_NAME),
+ "");
}
/**
@@ -116,7 +73,10 @@ public class BrowserDetector
*/
public String getBrowserPlatform()
{
- return browserPlatform;
+ // Try to figure out what platform.
+ return Objects.requireNonNullElse(
+ getUserAgent().getValue(UserAgent.OPERATING_SYSTEM_NAME),
+ "unknown");
}
/**
@@ -126,7 +86,12 @@ public class BrowserDetector
*/
public float getBrowserVersion()
{
- return browserVersion;
+ // The browser version specified in the user agent string. If we
+ // can't parse the version just assume an old browser.
+ String version = Objects.requireNonNullElse(
+ getUserAgent().getValue(UserAgent.AGENT_VERSION),
+ "1.0");
+ return Float.parseFloat(version);
}
/**
@@ -146,27 +111,6 @@ public class BrowserDetector
*/
public UserAgent getUserAgent()
{
- return parse(userAgentString);
- }
-
- /**
- * Helper method to initialize this class.
- *
- * @param userAgentString the user agent string
- */
- private static UserAgent parse(String userAgentString)
- {
- return userAgentCache.computeIfAbsent(userAgentString, uaa::parse);
- }
-
- /**
- * Helper method to convert String to a float.
- *
- * @param s A String.
- * @return The String converted to float.
- */
- private static final float toFloat(String s)
- {
- return Float.parseFloat(s);
+ return uaa.parse(userAgentString);
}
}
(turbine-core) 02/05: Fix log message
Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git
commit b5f51e10119ca09a16c048789239ae3273917532
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Thu Jan 8 19:49:03 2026 +0100
Fix log message
---
.../org/apache/turbine/services/schedule/AbstractSchedulerService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/java/org/apache/turbine/services/schedule/AbstractSchedulerService.java b/src/java/org/apache/turbine/services/schedule/AbstractSchedulerService.java
index fa5655c4..c79c39de 100644
--- a/src/java/org/apache/turbine/services/schedule/AbstractSchedulerService.java
+++ b/src/java/org/apache/turbine/services/schedule/AbstractSchedulerService.java
@@ -386,7 +386,7 @@ public abstract class AbstractSchedulerService extends TurbineBaseService implem
}
catch (Exception e)
{
- log.error("Error in WorkerThread for scheduled job #{}, task: {}",
+ log.error("Error in scheduled job #{}, task: {}",
Integer.valueOf(je.getJobId()), je.getTask(), e);
}
finally
(turbine-core) 03/05: Use Base64 from JDK, removing commons-codec dependency
Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git
commit db39340d83cc1d3c8c7fa415a273dd33a313f0b4
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Thu Jan 8 19:49:57 2026 +0100
Use Base64 from JDK, removing commons-codec dependency
---
.../org/apache/turbine/services/uniqueid/TurbineUniqueIdService.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/java/org/apache/turbine/services/uniqueid/TurbineUniqueIdService.java b/src/java/org/apache/turbine/services/uniqueid/TurbineUniqueIdService.java
index 4f4aa606..626616f3 100644
--- a/src/java/org/apache/turbine/services/uniqueid/TurbineUniqueIdService.java
+++ b/src/java/org/apache/turbine/services/uniqueid/TurbineUniqueIdService.java
@@ -24,9 +24,9 @@ import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
+import java.util.Base64;
import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.commons.codec.binary.Base64;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.turbine.Turbine;
@@ -78,8 +78,7 @@ public class TurbineUniqueIdService
MessageDigest md = MessageDigest.getInstance("MD5");
byte [] bytesId = md.digest(turbineURL.getBytes(StandardCharsets.UTF_8));
- turbineId = new String(Base64.encodeBase64(bytesId),
- StandardCharsets.UTF_8);
+ turbineId = Base64.getEncoder().encodeToString(bytesId);
log.info("This is Turbine instance running at: {}", turbineURL);
log.info("The instance id is #{}", turbineId);