This is an automated email from the ASF dual-hosted git repository.
jkevan pushed a commit to branch unomi-1.x
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/unomi-1.x by this push:
new e6936c968 UNOMI-710: revert Yauaa 7.8.0 upgrade (#542)
e6936c968 is described below
commit e6936c968746a93a933e0bf1740f3123627f41a8
Author: kevan Jahanshahi <[email protected]>
AuthorDate: Wed Nov 16 15:11:41 2022 +0100
UNOMI-710: revert Yauaa 7.8.0 upgrade (#542)
---
plugins/request/pom.xml | 9 +-------
.../useragent/UserAgentDetectorServiceImpl.java | 24 +++-------------------
2 files changed, 4 insertions(+), 29 deletions(-)
diff --git a/plugins/request/pom.xml b/plugins/request/pom.xml
index 4405f1ae4..c7132aa83 100644
--- a/plugins/request/pom.xml
+++ b/plugins/request/pom.xml
@@ -31,7 +31,7 @@
<packaging>bundle</packaging>
<properties>
- <yauaa.version>7.8.0</yauaa.version>
+ <yauaa.version>5.9</yauaa.version>
<kryo.version>2.24.0</kryo.version>
<minlog.version>1.3.1</minlog.version>
<prefixmap>1.1</prefixmap>
@@ -165,13 +165,6 @@
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
-
- <dependency>
- <groupId>org.ops4j.pax.logging</groupId>
- <artifactId>pax-logging-api</artifactId>
- <version>1.11.13</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
diff --git
a/plugins/request/src/main/java/org/apache/unomi/plugins/request/useragent/UserAgentDetectorServiceImpl.java
b/plugins/request/src/main/java/org/apache/unomi/plugins/request/useragent/UserAgentDetectorServiceImpl.java
index 1097fca63..ffff6c904 100644
---
a/plugins/request/src/main/java/org/apache/unomi/plugins/request/useragent/UserAgentDetectorServiceImpl.java
+++
b/plugins/request/src/main/java/org/apache/unomi/plugins/request/useragent/UserAgentDetectorServiceImpl.java
@@ -28,35 +28,16 @@ public class UserAgentDetectorServiceImpl {
private static final Logger logger =
LoggerFactory.getLogger(UserAgentDetectorServiceImpl.class.getName());
- private final static int JDK11 = 11;
- private final static String JDK_VERSION = "java.version";
-
private UserAgentAnalyzer userAgentAnalyzer;
public void postConstruct() {
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- final UserAgentAnalyzer.UserAgentAnalyzerBuilder
userAgentAnalyzerBuilder = UserAgentAnalyzer
+ this.userAgentAnalyzer = UserAgentAnalyzer
.newBuilder()
.hideMatcherLoadStats()
- .immediateInitialization();
- // Check JDK Version
- // Versions prior to 10 are named 1.x
- String[] versionElements =
System.getProperty(JDK_VERSION).split("\\.");
- int discard = Integer.parseInt(versionElements[0]);
- int currentJDK;
- if (discard == 1) {
- currentJDK = Integer.parseInt(versionElements[1]);
- } else {
- currentJDK = discard;
- }
- if (currentJDK < JDK11) {
- // Use custom cache for jdk8 compatibility
- logger.info("Use JDK8 compliant version of the agent analyzer
caching");
- userAgentAnalyzerBuilder.useJava8CompatibleCaching();
- }
- this.userAgentAnalyzer = userAgentAnalyzerBuilder.withCache(10000)
+ .withCache(10000)
.withField(nl.basjes.parse.useragent.UserAgent.OPERATING_SYSTEM_CLASS)
.withField(nl.basjes.parse.useragent.UserAgent.OPERATING_SYSTEM_NAME)
.withField(nl.basjes.parse.useragent.UserAgent.AGENT_NAME)
@@ -65,6 +46,7 @@ public class UserAgentDetectorServiceImpl {
.withField(nl.basjes.parse.useragent.UserAgent.DEVICE_NAME)
.withField(nl.basjes.parse.useragent.UserAgent.DEVICE_BRAND)
.build();
+ this.userAgentAnalyzer.immediateInitialization();
this.userAgentAnalyzer.initializeMatchers();
} finally {
Thread.currentThread().setContextClassLoader(tccl);