openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msei...@apache.org
Subject [openoffice] 05/05: If the vendor is unknown, treat it as OpenJDK, as OpenJDK now allows every builder to set its own vendor string and we can't use that to identify them any more.
Date Sat, 24 Aug 2019 19:25:21 GMT
This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO417
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 7ffb764a1ac7af00a23617b96bfdd8504a695fa8
Author: Damjan Jovanovic <damjan@apache.org>
AuthorDate: Mon Aug 19 20:00:02 2019 +0200

    If the vendor is unknown, treat it as OpenJDK, as OpenJDK
    now allows every builder to set its own vendor string and
    we can't use that to identify them any more.
    
    Patch by: me
    
    (cherry picked from commit 61a4f434029376f30410cf27dbdd93c1f6011f21)
---
 .../OpenOfficeorg/javavendors_freebsd.xml          |  8 ++++++++
 .../OpenOfficeorg/javavendors_linux.xml            |  4 ++++
 .../OpenOfficeorg/javavendors_macosx.xml           |  4 ++++
 .../OpenOfficeorg/javavendors_os2.xml              |  8 ++++++++
 .../OpenOfficeorg/javavendors_unx.xml              |  4 ++++
 .../OpenOfficeorg/javavendors_wnt.xml              |  4 ++++
 .../plugins/sunmajor/javaenvsetup/javaldx.cxx      |  4 +++-
 main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx    | 23 +++++++++++++++++++++-
 .../plugins/sunmajor/pluginlib/vendorlist.cxx      |  1 +
 9 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml
index 1135354..4fe5eef 100644
--- a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml
+++ b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml
@@ -38,6 +38,12 @@
   <vendor name="Free Software Foundation, Inc.">
     <minVersion>1.5.0</minVersion>
   </vendor>
+  <vendor name="AdoptOpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
+  <vendor name="OpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
  </vendorInfos>
 
  <plugins>
@@ -45,5 +51,7 @@
   <library vendor="Sun Microsystems Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
   <library vendor="The FreeBSD Foundation">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
   <library vendor="Free Software Foundation, Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
+  <library vendor="AdoptOpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
+  <library vendor="OpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
  </plugins>
 </javaSelection>
diff --git a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml
index 58c4cc8..fe82be9 100644
--- a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml
+++ b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_linux.xml
@@ -47,6 +47,9 @@
   <vendor name="AdoptOpenJDK">
     <minVersion>1.8.0</minVersion>
   </vendor>
+  <vendor name="OpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
  </vendorInfos>
 
  <plugins>
@@ -57,5 +60,6 @@
   <library vendor="Free Software Foundation, Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
   <library vendor="BEA Systems, Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
   <library vendor="AdoptOpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
+  <library vendor="OpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
  </plugins>
 </javaSelection>
diff --git a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx.xml b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx.xml
index 60a4b27..29f9b92 100644
--- a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx.xml
+++ b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx.xml
@@ -38,6 +38,9 @@
  <vendor name="AdoptOpenJDK">
     <minVersion>1.8.0</minVersion>
  </vendor>
+ <vendor name="OpenJDK">
+    <minVersion>1.8.0</minVersion>
+ </vendor>
  </vendorInfos>
 
  <plugins>
@@ -45,5 +48,6 @@
   <library vendor="Apple Computer, Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dylib</library>
   <library vendor="Oracle Corporation">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dylib</library>
   <library vendor="AdoptOpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dylib</library>
+  <library vendor="OpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dylib</library>
  </plugins>
 </javaSelection>
diff --git a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml
index 5cceea3..00bfd2d 100644
--- a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml
+++ b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml
@@ -35,11 +35,19 @@
   <vendor name="IBM Corporation">
     <minVersion>1.5.0</minVersion>
   </vendor>
+  <vendor name="AdoptOpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
+  <vendor name="OpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
  </vendorInfos>
 
  <plugins>
   <library vendor="Oracle Corporation">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavap.dll</library>
   <library vendor="Sun Microsystems Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavap.dll</library>
   <library vendor="IBM Corporation">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavap.dll</library>
+  <library vendor="AdoptOpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavap.dll</library>
+  <library vendor="OpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavap.dll</library>
  </plugins>
 </javaSelection>
diff --git a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml
index cb622ce..7d976fa 100644
--- a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml
+++ b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_unx.xml
@@ -35,11 +35,15 @@
   <vendor name="AdoptOpenJDK">
     <minVersion>1.8.0</minVersion>
   </vendor>
+  <vendor name="OpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
  </vendorInfos>
 
  <plugins>
   <library vendor="Oracle Corporation">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
   <library vendor="Sun Microsystems Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
   <library vendor="AdoptOpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
+  <library vendor="OpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.so</library>
  </plugins>
 </javaSelection>
diff --git a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml
index c86f017..c8bea81 100644
--- a/main/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml
+++ b/main/jvmfwk/distributions/OpenOfficeorg/javavendors_wnt.xml
@@ -38,6 +38,9 @@
   <vendor name="AdoptOpenJDK">
     <minVersion>1.8.0</minVersion>
   </vendor>
+  <vendor name="OpenJDK">
+    <minVersion>1.8.0</minVersion>
+  </vendor>
  </vendorInfos>
 
  <plugins>
@@ -45,5 +48,6 @@
   <library vendor="Sun Microsystems Inc.">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dll</library>
   <library vendor="IBM Corporation">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dll</library>
   <library vendor="AdoptOpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dll</library>
+  <library vendor="OpenJDK">vnd.sun.star.expand:$URE_INTERNAL_LIB_DIR/sunjavaplugin.dll</library>
  </plugins>
 </javaSelection>
diff --git a/main/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/main/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index 1ae01c6..57c839e 100644
--- a/main/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/main/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -121,6 +121,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
     rtl::OUString sVendor7(RTL_CONSTASCII_USTRINGPARAM("Free Software Foundation, Inc."));
     rtl::OUString sVendor8(RTL_CONSTASCII_USTRINGPARAM("The FreeBSD Foundation"));
     rtl::OUString sVendor9(RTL_CONSTASCII_USTRINGPARAM("AdoptOpenJDK"));
+    rtl::OUString sVendor10(RTL_CONSTASCII_USTRINGPARAM("OpenJDK"));
     if ( ! (sVendor0.equals(pInfo->sVendor) == sal_True
             || sVendor1.equals(pInfo->sVendor) == sal_True
             || sVendor2.equals(pInfo->sVendor) == sal_True
@@ -130,7 +131,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
             || sVendor6.equals(pInfo->sVendor) == sal_True
             || sVendor7.equals(pInfo->sVendor) == sal_True
             || sVendor8.equals(pInfo->sVendor) == sal_True
-            || sVendor9.equals(pInfo->sVendor) == sal_True))
+            || sVendor9.equals(pInfo->sVendor) == sal_True
+            || sVendor10.equals(pInfo->sVendor) == sal_True))
         return 0;
     
     rtl::OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData);
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 554693f..d755a7e 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1018,7 +1018,28 @@ rtl::Reference<VendorBase> getJREInfoByPath(
                 break;
             }
         }
-    }
+        if ( !ret.is() )
+        {
+            // As of Java 8u222 the vendor name can be anything, so try the most generic
one
+            OUString genericVendorName(RTL_CONSTASCII_USTRINGPARAM("OpenJDK"));
+            for ( sal_Int32 c = 0;
+                  gVendorMap[c].sVendorName != NULL; ++c )
+            {
+                OUString sNameMap(gVendorMap[c].sVendorName, strlen(gVendorMap[c].sVendorName),
+                                  RTL_TEXTENCODING_ASCII_US);
+                if (sNameMap.equals(genericVendorName))
+                {
+                    for (vector<pair<OUString, OUString> >::iterator i = props.begin();
i != props.end(); i++)
+                    {
+                        if (sVendor.equals(i->first))
+                            i->second = genericVendorName;
+                    }
+                    ret = createInstance(gVendorMap[c].createFunc, props);
+                    break;
+                }
+            }
+        }
+    }    
     if (ret.is() == false)
         vecBadPaths.push_back(sFilePath);
     else
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index 6eb493b..34f0ec5 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -52,6 +52,7 @@ BEGIN_VENDOR_MAP()
     VENDOR_MAP_ENTRY("Free Software Foundation, Inc.", GnuInfo)
     VENDOR_MAP_ENTRY("The FreeBSD Foundation", OtherInfo)
     VENDOR_MAP_ENTRY("AdoptOpenJDK", OtherInfo)
+    VENDOR_MAP_ENTRY("OpenJDK", SunInfo)
 END_VENDOR_MAP()    
 
 


Mime
View raw message