You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2022/11/16 14:06:04 UTC

[unomi] branch revertYauaaUpgrade1.x created (now 70cbcf075)

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

jkevan pushed a change to branch revertYauaaUpgrade1.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


      at 70cbcf075 UNOMI-710: revert Yauaa 7.8.0 upgrade

This branch includes the following new commits:

     new 70cbcf075 UNOMI-710: revert Yauaa 7.8.0 upgrade

The 1 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.



[unomi] 01/01: UNOMI-710: revert Yauaa 7.8.0 upgrade

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch revertYauaaUpgrade1.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 70cbcf0759c3ecdfc55bf627bf9bded775f5fee2
Author: Kevan <ke...@jahia.com>
AuthorDate: Wed Nov 16 15:05:49 2022 +0100

    UNOMI-710: revert Yauaa 7.8.0 upgrade
---
 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);