You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2019/08/24 19:25:16 UTC
[openoffice] branch AOO417 updated (af1b3ff -> 7ffb764)
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a change to branch AOO417
in repository https://gitbox.apache.org/repos/asf/openoffice.git.
from af1b3ff Patch by: Damjan
new 7a04c6d Fixed typo
new f031179 Improve Java detection on *nix, by also checking the immediate subdirectories of /usr and /usr/local, where at least FreeBSD puts Java (eg. /usr/local/openjdk8, /usr/local/openjdk7-jre). Also simplify that search code a bit, and eliminate an unnecessary stat() for a directory on which it has already been called earlier.
new 4524ebc Fix build on Windows with precompiled headers.
new fd47460 removed whitespaces
new 7ffb764 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.
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:
.../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 | 198 ++++++++++++---------
.../plugins/sunmajor/pluginlib/vendorlist.cxx | 1 +
9 files changed, 147 insertions(+), 88 deletions(-)
[openoffice] 03/05: Fix build on Windows with precompiled headers.
Posted by ms...@apache.org.
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 4524ebca466870f2b052abeae02f5b44c357e2f2
Author: Don Lewis <tr...@apache.org>
AuthorDate: Wed May 2 01:36:10 2018 +0000
Fix build on Windows with precompiled headers.
git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1830715 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit 5a2d7207d0102343be221f0a085eade310636fec)
---
main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index b204897..ad28ae0 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -22,7 +22,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_jvmfwk.hxx"
+#include "precompiled_plugin.hxx"
#include "util.hxx"
[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.
Posted by ms...@apache.org.
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 <da...@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()
[openoffice] 01/05: Fixed typo
Posted by ms...@apache.org.
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 7a04c6dbfda194c37cab30d4212d7d90b22aca62
Author: mseidel <ms...@apache.org>
AuthorDate: Sat Aug 24 21:19:02 2019 +0200
Fixed typo
---
main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index d59f1db..c311cb6 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -572,7 +572,7 @@ bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
// Get the path for the runtime lib
if(RegQueryValueExW(hKey, L"JavaHome", 0, &dwType, (unsigned char*) szTmpPath, &dwTmpPathLen) == ERROR_SUCCESS)
{
- // There can be several version entries refering with the same JavaHome,e.g 1.4 and 1.4.1
+ // There can be several version entries referring with the same JavaHome,e.g 1.4 and 1.4.1
OUString usHome((sal_Unicode*) szTmpPath);
// check if there is already an entry with the same JavaHomeruntime lib
// if so, we use the one with the more accurate version
[openoffice] 02/05: Improve Java detection on *nix,
by also checking the immediate subdirectories of /usr and
/usr/local, where at least FreeBSD puts Java (eg. /usr/local/openjdk8,
/usr/local/openjdk7-jre). Also simplify that search code a bit,
and eliminate an unnecessary stat() for a directory on which it has already
been called earlier.
Posted by ms...@apache.org.
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 f031179e3bcf3ce499ef5512ce51dd23c2a77129
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sun Apr 15 09:46:56 2018 +0000
Improve Java detection on *nix, by also checking the immediate
subdirectories of /usr and /usr/local, where at least FreeBSD puts Java
(eg. /usr/local/openjdk8, /usr/local/openjdk7-jre). Also simplify that
search code a bit, and eliminate an unnecessary stat() for a directory on
which it has already been called earlier.
Patch by: me
git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1829200 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit 58368a3fb4ba73f514fcac5672d8424ed9e2740f)
---
main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 87 +++++++++++++------------
1 file changed, 45 insertions(+), 42 deletions(-)
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index c311cb6..b204897 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -91,25 +91,30 @@ char const *g_arCollectDirs[] = {
"jvm/"
};
+struct JavaSearchPathEntry {
+ int searchImmediateContents; // More thorough, too slow for /usr/bin and /usr/lib
+ char const *path;
+};
+
/* These are directories in which a java installation is
looked for.
*/
-char const *g_arSearchPaths[] = {
+struct JavaSearchPathEntry g_arSearchPaths[] = {
#ifdef MACOSX
- "",
- "Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin",
- "System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/"
+ { 0, "" },
+ { 0, "Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin" },
+ { 0, "System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/" },
#else
- "",
- "usr/",
- "usr/local/",
- "usr/local/IBMJava2-ppc-142",
- "usr/local/j2sdk1.3.1",
+ { 0, "" },
+ { 1, "usr/" },
+ { 1, "usr/local/" },
+ { 0, "usr/local/IBMJava2-ppc-142" },
+ { 0, "usr/local/j2sdk1.3.1" },
#ifdef X86_64
- "usr/lib64/",
+ { 0, "usr/lib64/" },
#endif
- "usr/lib/",
- "usr/bin/"
+ { 0, "usr/lib/" },
+ { 0, "usr/bin/" }
#endif
};
}
@@ -1148,11 +1153,11 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
arNames[i] = OUString(g_arJavaNames[i], strlen(g_arJavaNames[i]),
RTL_TEXTENCODING_UTF8);
- int cSearchPaths= sizeof(g_arSearchPaths) / sizeof(char*);
+ int cSearchPaths= sizeof(g_arSearchPaths) / sizeof(g_arSearchPaths[0]);
boost::scoped_array<OUString> sarPathNames(new OUString[cSearchPaths]);
OUString *arPaths = sarPathNames.get();
for(int c = 0; c < cSearchPaths; c++)
- arPaths[c] = OUString(g_arSearchPaths[c], strlen(g_arSearchPaths[c]),
+ arPaths[c] = OUString(g_arSearchPaths[c].path, strlen(g_arSearchPaths[c].path),
RTL_TEXTENCODING_UTF8);
int cCollectDirs = sizeof(g_arCollectDirs) / sizeof(char*);
@@ -1174,8 +1179,8 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
for(int j= 0; j < cCollectDirs; j++)
{
OUString usDir2(usDir1 + arCollectDirs[j]);
- // prevent that we scan the whole /usr, /usr/lib, etc directories
- if (arCollectDirs[j] != OUString())
+ // prevent that we scan the whole /usr/bin, /usr/lib, etc directories
+ if (g_arSearchPaths[ii].searchImmediateContents || arCollectDirs[j] != OUString())
{
//usr/java/xxx
//Examin every subdirectory
@@ -1227,33 +1232,31 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
+ usDir2 + OUSTR(". Osl file error: ")
+ OUString::valueOf((sal_Int32) openErr));
}
- else
+ }
+ for (int j= 0; j < cJavaNames; j++)
+ {
+ //When we look directly into a dir like /usr/bin, /usr/lib, etc. then we only
+ //look for certain java directories, such as jre, jdk, etc. Whe do not want
+ //to examine the whole directory because of performance reasons.
+
+ // usFile arNames[j]
+ // <------> <->
+ // file:///usr/lib/jvm
+ // <------>
+ // arPaths[ii] (usDir1)
+ //
+ OUString usDir3(usDir1 + arNames[j]);
+
+ DirectoryItem item3;
+ if(DirectoryItem::get(usDir3, item3) == File::E_None)
{
- //usr/java
- //When we look directly into a dir like /usr, /usr/lib, etc. then we only
- //look for certain java directories, such as jre, jdk, etc. Whe do not want
- //to examine the whole directory because of performance reasons.
- DirectoryItem item2;
- if(DirectoryItem::get(usDir2, item2) == File::E_None)
- {
- for( int k= 0; k < cJavaNames; k++)
- {
- // /usr/java/j2re1.4.0
- OUString usDir3(usDir2 + arNames[k]);
-
- DirectoryItem item3;
- if(DirectoryItem::get(usDir3, item) == File::E_None)
- {
- //remove trailing '/'
- sal_Int32 islash = usDir3.lastIndexOf('/');
- if (islash == usDir3.getLength() - 1
- && (islash
- > RTL_CONSTASCII_LENGTH("file://")))
- usDir3 = usDir3.copy(0, islash);
- getJREInfoByPath(usDir3,vecInfos);
- }
- }
- }
+ //remove trailing '/'
+ sal_Int32 islash = usDir3.lastIndexOf('/');
+ if (islash == usDir3.getLength() - 1
+ && (islash
+ > RTL_CONSTASCII_LENGTH("file://")))
+ usDir3 = usDir3.copy(0, islash);
+ getJREInfoByPath(usDir3,vecInfos);
}
}
}
[openoffice] 04/05: removed whitespaces
Posted by ms...@apache.org.
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 fd4746037e1175b6bc333caacf907754ebbc4bf7
Author: Mechtilde <oo...@mechtilde.de>
AuthorDate: Sun Aug 18 14:21:37 2019 +0200
removed whitespaces
(cherry picked from commit c4c81054f4275d578a084ee9a63b07db19337dfb)
---
main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 90 ++++++++++++-------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index ad28ae0..554693f 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* 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
@@ -7,16 +7,16 @@
* 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.
- *
+ *
*************************************************************/
@@ -69,11 +69,11 @@ using namespace std;
namespace {
char const *g_arJavaNames[] = {
"",
- "j2re",
- "j2se",
+ "j2re",
+ "j2se",
"j2sdk",
"jdk",
- "jre",
+ "jre",
"java",
"Home",
"IBMJava2-ppc-142"
@@ -82,11 +82,11 @@ char const *g_arJavaNames[] = {
*/
char const *g_arCollectDirs[] = {
"",
- "j2re/",
- "j2se/",
+ "j2re/",
+ "j2se/",
"j2sdk/",
"jdk/",
- "jre/",
+ "jre/",
"java/",
"jvm/"
};
@@ -134,7 +134,7 @@ namespace
{
rtl::OUString getLibraryLocation()
{
- rtl::OUString libraryFileUrl;
+ rtl::OUString libraryFileUrl;
OSL_VERIFY(osl::Module::getUrlFromAddress((void *)(sal_IntPtr)getLibraryLocation, libraryFileUrl));
return getDirFromFile(libraryFileUrl);
}
@@ -145,7 +145,7 @@ namespace
{
static rtl::Bootstrap aInstance(sIni);
return & aInstance;
-
+
}
};
@@ -290,7 +290,7 @@ class AsynchReader: public Thread
{
size_t m_nDataSize;
boost::scoped_array<sal_Char> m_arData;
-
+
bool m_bError;
bool m_bDone;
FileHandleGuard m_aGuard;
@@ -303,7 +303,7 @@ public:
/** only call this function after this thread has finished.
That is, call join on this instance and then call getData.
-
+
*/
OString getData();
#endif
@@ -336,12 +336,12 @@ void AsynchReader::run()
case osl_File_E_PIPE: //HACK! for windows
nRead = 0;
case osl_File_E_None:
- break;
+ break;
default:
m_bError = true;
return;
}
-
+
if (nRead == 0)
{
m_bDone = true;
@@ -391,7 +391,7 @@ bool getJavaProps(const OUString & exePath,
//that it calls java.awt.Toolkit.getDefaultToolkit();
OUString sValue;
getBootstrap()->getFrom(OUSTR("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"), sValue);
-
+
//prepare the arguments
sal_Int32 cArgs = 3;
OUString arg1 = OUString(RTL_CONSTASCII_USTRINGPARAM("-classpath"));// + sClassPath;
@@ -406,7 +406,7 @@ bool getJavaProps(const OUString & exePath,
args[3] = arg4.pData;
cArgs = 4;
}
-
+
oslProcess javaProcess= 0;
oslFileHandle fileOut= 0;
oslFileHandle fileErr= 0;
@@ -478,7 +478,7 @@ bool getJavaProps(const OUString & exePath,
stderrReader.join();
JFW_TRACE2(OString("[Java framework] Java wrote to stderr:\" ")
+ stderrReader.getData() + OString(" \".\n"));
-
+
TimeValue waitMax= {5 ,0};
procErr = osl_joinProcessWithTimeout(javaProcess, &waitMax);
OSL_ASSERT(procErr == osl_Process_E_None);
@@ -556,7 +556,7 @@ bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
const DWORD BUFFSIZE = 1024;
wchar_t bufVersion[BUFFSIZE];
// char bufVersion[BUFFSIZE];
- DWORD nNameLen = BUFFSIZE;
+ DWORD nNameLen = BUFFSIZE;
FILETIME fileTime;
nNameLen = sizeof(bufVersion);
@@ -649,7 +649,7 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
// valid version
//check if version of current is recognized, by comparing it with itself
- try
+ try
{
cur->compareVersions(cur->getVersion());
}
@@ -661,13 +661,13 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
if (nCmp == 0)
{
try
- {
+ {
nCmp = cur->compareVersions(next->getVersion());
}
catch (MalformedVersionException & )
{
//The second version is invalid, therefor it is regardes less.
- nCmp = 1;
+ nCmp = 1;
}
}
if(nCmp == 1) // cur > next
@@ -723,7 +723,7 @@ bool getJREInfoFromBinPath(
// jre/bin/jre -> jre/bin
OUString sMapPath(i->getStr(), index);
index = sBinPath.lastIndexOf(sMapPath);
- if (index != -1
+ if (index != -1
&& (index + sMapPath.getLength() == sBinPath.getLength())
&& sBinPath[index - 1] == '/')
{
@@ -780,7 +780,7 @@ bool getJREInfoByPath(const rtl::OUString& path,
std::vector<rtl::Reference<VendorBase> > & vecInfos)
{
bool ret = false;
-
+
rtl::Reference<VendorBase> aInfo = getJREInfoByPath(path);
if (aInfo.is())
{
@@ -815,7 +815,7 @@ OUString resolveDirPath(const OUString & path)
FileStatus status(FileStatusMask_Type |
FileStatusMask_LinkTargetURL |
FileStatusMask_FileURL);
-
+
if (item.getFileStatus(status) == File::E_None
&& status.getFileType() == FileStatus::Directory)
{
@@ -827,7 +827,7 @@ OUString resolveDirPath(const OUString & path)
return ret;
}
/** Checks if the path is a file. If it is a link to a file than
- it is resolved.
+ it is resolved.
*/
OUString resolveFilePath(const OUString & path)
{
@@ -849,11 +849,11 @@ OUString resolveFilePath(const OUString & path)
&& status.getFileType() == FileStatus::Regular)
{
ret = sResolved;
- }
+ }
}
else
return OUString();
-
+
return ret;
}
@@ -874,7 +874,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
// If this path is invalid then there is no chance to find a JRE here
if (sResolvedDir.getLength() == 0)
return 0;
-
+
//check if the directory path is good, that is a JRE was already recognized.
//Then we need not detect it again
//For example, a sun JKD contains <jdk>/bin/java and <jdk>/jre/bin/java.
@@ -906,7 +906,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
{
//if the path is a link, then resolve it
//check if the executable exists at all
-
+
//path can be only "file:///". Then do not append a '/'
//sizeof counts the terminating 0
OUString sFullPath;
@@ -918,7 +918,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
sFilePath = resolveFilePath(sFullPath);
-
+
if (sFilePath.getLength() == 0)
{
//The file path (to java exe) is not valid
@@ -963,7 +963,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
//then it tries to start a jdk/.../native_threads/.java_wrapper. Therefore the link, which
//is named java, must be used to start the script.
getJavaProps(sFullPath, props, & bProcessRun);
- // Either we found a working 1.3.1
+ // Either we found a working 1.3.1
//Or the java is broken. In both cases we stop searchin under this "root" directory
bBreak = true;
break;
@@ -989,12 +989,12 @@ rtl::Reference<VendorBase> getJREInfoByPath(
if (props.size() == 0)
return rtl::Reference<VendorBase>();
-
+
//find java.vendor property
typedef vector<pair<OUString, OUString> >::const_iterator c_ip;
OUString sVendor(RTL_CONSTASCII_USTRINGPARAM("java.vendor"));
OUString sVendorName;
-
+
for (c_ip i = props.begin(); i != props.end(); i++)
{
if (sVendor.equals(i->first))
@@ -1003,9 +1003,9 @@ rtl::Reference<VendorBase> getJREInfoByPath(
break;
}
}
-
+
if (sVendorName.getLength() > 0)
- {
+ {
//find the creator func for the respective vendor name
for ( sal_Int32 c = 0;
gVendorMap[c].sVendorName != NULL; ++c )
@@ -1018,7 +1018,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
break;
}
}
- }
+ }
if (ret.is() == false)
vecBadPaths.push_back(sFilePath);
else
@@ -1026,9 +1026,9 @@ rtl::Reference<VendorBase> getJREInfoByPath(
JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")
+ OUSTR("Found JRE: ") + sResolvedDir
+ OUSTR(" \n at: ") + path + OUSTR(".\n"));
-
+
mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret));
- mapJREs.insert(MAPJRE::value_type(sFilePath, ret));
+ mapJREs.insert(MAPJRE::value_type(sFilePath, ret));
}
return ret;
@@ -1037,7 +1037,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
Reference<VendorBase> createInstance(createInstance_func pFunc,
vector<pair<OUString, OUString> > properties)
{
-
+
Reference<VendorBase> aBase = (*pFunc)();
if (aBase.is())
{
@@ -1138,7 +1138,7 @@ bool makeDriveLetterSame(OUString * fileURL)
void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
{
JFW_TRACE2(OUSTR("\n[Java framework] Checking \"/usr/jdk/latest\"\n"));
- getJREInfoByPath(OUSTR("file:////usr/jdk/latest"), vecInfos);
+ getJREInfoByPath(OUSTR("file:////usr/jdk/latest"), vecInfos);
}
#else
@@ -1167,7 +1167,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
arCollectDirs[d] = OUString(g_arCollectDirs[d], strlen(g_arCollectDirs[d]),
RTL_TEXTENCODING_UTF8);
-
+
OUString usFile(RTL_CONSTASCII_USTRINGPARAM("file:///"));
for( int ii = 0; ii < cSearchPaths; ii ++)
@@ -1225,7 +1225,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
getJREInfoByPath(aStatus.getFileURL(),vecInfos);
}
-
+
JFW_ENSURE(errNext == File::E_None || errNext == File::E_NOENT,
OUSTR("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")
@@ -1246,7 +1246,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
// arPaths[ii] (usDir1)
//
OUString usDir3(usDir1 + arNames[j]);
-
+
DirectoryItem item3;
if(DirectoryItem::get(usDir3, item3) == File::E_None)
{