[Libreoffice-commits] core.git: jvmfwk/plugins

2023-04-11 Thread Christian Lohmaier (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit bdd96fb801627b0accd81ff33be034c19fe193ba
Author: Christian Lohmaier 
AuthorDate: Fri Apr 7 11:15:42 2023 +0200
Commit: Christian Lohmaier 
CommitDate: Tue Apr 11 12:07:15 2023 +0200

accept aarch64 JDK for win/aarch64

the check is only done for windows & mac since the property can have
arbitrary values - in OpenJDK it is hardcoded for windows, but for other
platforms it can come from autoconf. For a more detailed explanation
see f05a42ef8c8192186f91a169047742e5c3ae9b9e

Change-Id: I8555ef3b7153a9b744b45cf07deae3c3a1d48ae3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150119
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index f4cf14a9ab3f..d7988518f2ed 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -175,12 +175,16 @@ bool VendorBase::isValidArch() const
 // It is not defined what the exact values are.
 // Oracle JRE 8 has "x86" and "amd64", the others were found at 
http://lopica.sourceforge.net/os.html .
 // There might still be missing some options; we need to extend the check 
once we find out.
-#if defined _WIN64 || (defined MACOSX && defined __x86_64__)
+#if defined _WIN64 || defined MACOSX
+#if defined __x86_64__ || defined _M_AMD64
 return m_sArch == "amd64" || m_sArch == "x86_64";
+#elif defined __aarch64__ || defined _M_ARM64
+return m_sArch == "aarch64";
+#else
+#error neither arm64 nor amd64 for win64/mac? Sounds fishy.
+#endif
 #elif defined _WIN32
 return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
-#elif defined MACOSX && defined __aarch64__
-return m_sArch == "aarch64";
 #else
 (void)this;
 return true;


[Libreoffice-commits] core.git: jvmfwk/plugins

2022-05-04 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c7b923a9ebaa40809c11659f8816a1d2bfd44c89
Author: Stephan Bergmann 
AuthorDate: Wed May 4 14:22:45 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 18:16:36 2022 +0200

Some JREs need the bin/server/jvm.dll path after all

...which had been removed in 18bdf78e156f3cd1e6ccbb3ae28e919583bac70c "Azul 
is
just another OpenJDK variant", when fixing the previously mis-classified 
Azul
JRE from "uses OtherInfo" to "uses SunInfo".  But the IBM Semeru Runtime
() is
another arguably mis-classified case due to its java.vendor of "IBM 
Corporation"
(and where the

VENDOR_MAP_ENTRY("IBM Corporation"),

line in jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx might be relevant 
for
some other JRE from IBM; at least, that entry is present ever since the
introduction of vendorlist.cxx in 738e9b77b9d181b376188e405e1eb353cf93c597
"INTEGRATION: CWS jl8").

So just generally support the bin/server/jvm.dll path here for "uses 
OtherInfo",
even though it should actually only be necessary for "uses SunInfo".

(See the mail thread starting at

"[libreoffice-users] LibreOffice 7.3.3.2 Windows 64 bit seems not detect
AdoptOpenJdk JRE Windows 64 bit runtime".)

Change-Id: I3a4d02309b7c833c3cd32dc2dda4f4cb7b216693
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133827
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
index 578c51f0b0cc..528af9498959 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
@@ -52,7 +52,11 @@ char const* const* OtherInfo::getRuntimePaths(int * size)
 "/bin/client/jvm.dll",
 "/bin/hotspot/jvm.dll",
 "/bin/classic/jvm.dll",
-"/bin/jrockit/jvm.dll"
+"/bin/jrockit/jvm.dll",
+// Needed by IBM Semeru Runtime, which is an OpenJDK (so should 
actually use SunInfo) with a
+// java.vendor of "IBM Corporation", so using OtherInfo here (cf. 
gVendorMap in
+// jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx):
+"/bin/server/jvm.dll"
 #elif defined UNX
 #ifdef MACOSX
 "/../../../../../Frameworks/JavaVM.framework/JavaVM" //as of  1.6.0_22


[Libreoffice-commits] core.git: jvmfwk/plugins

2022-04-10 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 655b6c2f46a73d9893ba8e6b572731a5890a4f72
Author: Stephan Bergmann 
AuthorDate: Sun Apr 10 09:16:20 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Apr 10 13:08:04 2022 +0200

loplugin:stringviewparam

Change-Id: I62a7534844006a7bf3c2ece5e5d2f8b739a15b9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132762
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 89534a0a2cf8..72c3a2424f63 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -32,6 +32,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -464,34 +465,34 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 // think it should be, do nothing, and just let the implicit loading
 // that happens when loading the JVM take care of it.
 
-static void load_msvcr(OUString const & jvm_dll, std::u16string_view msvcr)
+static void load_msvcr(std::u16string_view jvm_dll, std::u16string_view msvcr)
 {
 // First check if msvcr71.dll is in the same folder as jvm.dll. It
 // normally isn't, at least up to 1.6.0_22, but who knows if it
 // might be in the future.
-sal_Int32 slash = jvm_dll.lastIndexOf('\\');
+std::size_t slash = jvm_dll.rfind('\\');
 
-if (slash == -1)
+if (slash == std::u16string_view::npos)
 {
 // Huh, weird path to jvm.dll. Oh well.
-SAL_WARN("jfw", "JVM pathname <" + jvm_dll + "> w/o backslash");
+SAL_WARN("jfw", "JVM pathname <" << OUString(jvm_dll) << "> w/o 
backslash");
 return;
 }
 
 if (LoadLibraryW(
-o3tl::toW(OUString(OUString::Concat(jvm_dll.subView(0, slash+1)) + 
msvcr).getStr(
+o3tl::toW(OUString(OUString::Concat(jvm_dll.substr(0, slash+1)) + 
msvcr).getStr(
 return;
 
 // Then check if msvcr71.dll is in the parent folder of where
 // jvm.dll is. That is currently (1.6.0_22) as far as I know the
 // normal case.
-slash = jvm_dll.lastIndexOf('\\', slash);
+slash = jvm_dll.rfind('\\', slash);
 
-if (slash == -1)
+if (slash == std::u16string_view::npos)
 return;
 
 (void)LoadLibraryW(
-o3tl::toW(OUString(OUString::Concat(jvm_dll.subView(0, slash+1)) + 
msvcr).getStr()));
+o3tl::toW(OUString(OUString::Concat(jvm_dll.substr(0, slash+1)) + 
msvcr).getStr()));
 }
 
 // Check if the jvm DLL imports msvcr71.dll, and in that case try


[Libreoffice-commits] core.git: jvmfwk/plugins

2022-03-15 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8e6462571bb4cb872f607b4ac9dfde7f43b79ac3
Author: Stephan Bergmann 
AuthorDate: Tue Mar 15 12:17:30 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Mar 15 13:46:06 2022 +0100

Allow for java.version consisting of four dotted segments

...like "11.0.14.1" reported now by
java-11-openjdk-headless-11.0.14.1.1-5.fc35.x86_64, and which caused

> warn:jfw:274674:274674:jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx:100: 
[Java framework] sunjavaplugin.so does not know the version: 11.0.14.1 as valid 
for a SUN/Oracle JRE.

(For simplicity, cover it with the same code block that already covers a
potential "_01" etc. part following the official(?) three dotted segments.)

Change-Id: Id98235d3be59653ab412f9b6c1ffbf3b0470bd6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131586
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 490d5febbea4..16a1e14f3662 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -72,8 +72,8 @@ bool SunVersion::init(const char *szVersion)
 //separators after maintenance (1.4.1_01, 1.4.1-beta, or 1.4.1)
 (pCur == pEnd || *pCur == '_' || *pCur == '-')
 ||
-//separators between major-minor and minor-maintenance
-(nPart < 2 && *pCur == '.') )
+//separators between major-minor and minor-maintenance (or 
fourth segment)
+(nPart < 3 && *pCur == '.') )
 && (
 //prevent 1.4.0. 1.4.0-
 pCur + 1 != pEnd
@@ -113,10 +113,10 @@ bool SunVersion::init(const char *szVersion)
 }
 if (pCur >= pEnd)
 return true;
-//We have now 1.4.1. This can be followed by _01, -beta, etc.
+//We have now 1.4.1. This can be followed by _01 (or a fourth segment .1), 
-beta, etc.
 // _01 (update) According to docu must not be followed by any other
 //characters, but on Solaris 9 we have a 1.4.1_01a!!
-if (* (pCur - 1) == '_')
+if (* (pCur - 1) == '_' || *(pCur - 1) == '.')
 {// _01, _02
 // update is the last part _01, _01a, part 0 is the digits parts and 1 
the trailing alpha
 while (true)


[Libreoffice-commits] core.git: jvmfwk/plugins

2022-02-22 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 79c2398b8047016671069ceb271f218570819fad
Author: Stephan Bergmann 
AuthorDate: Tue Feb 22 11:16:14 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 22 13:53:44 2022 +0100

Replace some fprintf with SAL_WARN

Change-Id: I3f31f223b6e906c6b40415a8d5c66c27e3c7cff5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130338
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 0ac4c1ef2e9c..89534a0a2cf8 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -19,7 +19,6 @@
 
 
 #ifdef _WIN32
-# include 
 # include 
 # if !defined WIN32_LEAN_AND_MEAN
 #  define WIN32_LEAN_AND_MEAN
@@ -199,7 +198,7 @@ extern "C" void JNICALL abort_handler()
 // If we are within JNI_CreateJavaVM then we jump back into getJavaVM
 if( g_bInGetJavaVM != 0 )
 {
-fprintf(stderr, "JavaVM: JNI_CreateJavaVM called os::abort(), caught 
by abort_handler in javavm.cxx\n");
+SAL_WARN("jfw", "JavaVM: JNI_CreateJavaVM called os::abort(), caught 
by abort_handler");
 longjmp( jmp_jvm_abort, 0);
 }
 }
@@ -681,9 +680,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 sRuntimeLib, osl_getThreadTextEncoding());
 OString sSymbol = OUStringToOString(
 sSymbolCreateJava, osl_getThreadTextEncoding());
-fprintf(stderr,"[Java framework]sunjavaplugin" SAL_DLLEXTENSION
-": Java runtime library: %s does not export symbol %s !\n",
-sLib.getStr(), sSymbol.getStr());
+SAL_WARN("jfw", "Java runtime library: " << sLib << " does not export 
symbol " << sSymbol);
 return javaPluginError::VmCreationFailed;
 }
 moduleRt.release();
@@ -805,14 +802,12 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 {
 if( err < 0)
 {
-fprintf(stderr,"[Java framework] sunjavaplugin" SAL_DLLEXTENSION
-": Can not create Java Virtual Machine, %" SAL_PRIdINT32 
"\n", sal_Int32(err));
+SAL_WARN("jfw", "Can not create Java Virtual Machine, " << err);
 errorcode = javaPluginError::VmCreationFailed;
 }
 else if( err > 0)
 {
-fprintf(stderr,"[Java framework] sunjavaplugin" SAL_DLLEXTENSION
-": Can not create JavaVirtualMachine, abort handler was 
called.\n");
+SAL_WARN("jfw", "Can not create JavaVirtualMachine, abort handler 
was called");
 errorcode = javaPluginError::VmCreationFailed;
 }
 }


[Libreoffice-commits] core.git: jvmfwk/plugins

2022-02-22 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 14a8eecaa4368495f681f3fe2ed8f867697b234c
Author: Stephan Bergmann 
AuthorDate: Tue Feb 22 11:07:19 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 22 13:15:41 2022 +0100

Remove a debug-style fprintf

...that had been added in 811de66d7fd8c93c43d8e4e2dc73720033ba939b "First
attempt at getting access to the Java VM on Android", together with another

  fprintf(stderr, "Got lo_get_javavm = %p", lo_get_javavm);

that had meanwhile been removed again in
5510127e89d6971a219ce3664e4631d6c6dda2b1 "Android code refactorig and 
hacking"

Change-Id: I1a50563e2af1ea5a0ecbd2cc9d49d70c6e5bbbd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130337
Reviewed-by: Tor Lillqvist 
Tested-by: Jenkins

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index e55b914edf13..0ac4c1ef2e9c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -828,7 +828,6 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 // On Android we always have a Java VM as we only expect this code
 // to be run in an Android app anyway.
 *ppVm = lo_get_javavm();
-fprintf(stderr, "lo_get_javavm returns %p", *ppVm);
 #endif
 
 return errorcode;


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2022-02-21 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   16 +---
 jvmfwk/source/framework.cxx |8 ++--
 jvmfwk/source/fwkbase.cxx   |3 +++
 3 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 5e8f64e50f97d39e83a3358697be14db03566878
Author: Stephan Bergmann 
AuthorDate: Mon Feb 21 11:55:21 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Feb 21 15:37:27 2022 +0100

Avoid unnecessary empty -Djava.class.path=

Change-Id: Idcfe7321077b60381c0273910b1faeb444ef1fd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130242
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 29de226211f1..e55b914edf13 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -712,17 +712,22 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 // all versions below 1.5.1
 options.emplace_back("abort", reinterpret_cast(abort_handler));
 bool hasStackSize = false;
+#ifdef UNX
+// Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
+// in the class path in order to have applet support:
+OString sAddPath = getPluginJarPath(pInfo->sVendor, 
pInfo->sLocation,pInfo->sVersion);
+#endif
 for (int i = 0; i < cOptions; i++)
 {
 OString opt(arOptions[i].optionString);
 #ifdef UNX
-// Until java 1.5 we need to put a plugin.jar or javaplugin.jar 
(<1.4.2)
-// in the class path in order to have applet support:
 if (opt.startsWith("-Djava.class.path="))
 {
-OString sAddPath = getPluginJarPath(pInfo->sVendor, 
pInfo->sLocation,pInfo->sVersion);
 if (!sAddPath.isEmpty())
+{
 opt += OStringChar(SAL_PATHSEPARATOR) + sAddPath;
+sAddPath.clear();
+}
 }
 #endif
 if (opt == "-Xint") {
@@ -767,6 +772,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 }
 #endif
 }
+#ifdef UNX
+if (!sAddPath.isEmpty()) {
+options.emplace_back("-Djava.class.path=" + sAddPath, nullptr);
+}
+#endif
 
 std::unique_ptr sarOptions(new 
JavaVMOption[options.size()]);
 for (std::vector::size_type i = 0; i != options.size(); ++i) {
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 4163eea57b7c..8aa85082b838 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -195,8 +195,12 @@ javaFrameworkError jfw_startVM(
 //In direct mode the options are specified by bootstrap 
variables
 //of the form UNO_JAVA_JFW_PARAMETER_1 .. 
UNO_JAVA_JFW_PARAMETER_n
 vmParams = jfw::BootParams::getVMParameters();
-sUserClassPath =
-"-Djava.class.path=" + jfw::BootParams::getClasspath();
+auto const cp = jfw::BootParams::getClasspath();
+if (!cp.isEmpty())
+{
+sUserClassPath =
+"-Djava.class.path=" + cp;
+}
 }
 else
 OSL_ASSERT(false);
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 0af34a443f3c..bb5df10a9c4d 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -470,6 +470,9 @@ OString makeClassPathOption(std::u16string_view 
sUserClassPath)
 }
 
 sPaths = OUStringToOString(sBufCP.makeStringAndClear(), PathEncoding());
+if (sPaths.isEmpty()) {
+return "";
+}
 
 OString sOptionClassPath = "-Djava.class.path=" + sPaths;
 return sOptionClassPath;


[Libreoffice-commits] core.git: jvmfwk/plugins

2021-11-17 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f05a42ef8c8192186f91a169047742e5c3ae9b9e
Author: Stephan Bergmann 
AuthorDate: Wed Nov 17 14:01:55 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 17 16:53:47 2021 +0100

tdf#144695 VendorBase::isValidArch also for macOS

Lets extend it only to macOS (where there is some confusion now with 
Rosetta-
translated vs. native processes on Apple M1 machines), not to all Unix-like 
OSs:
The comment that it "is not defined what the exact [os.arch] values are" is
still relevant.  At least for OpenJDK, while Windows has a hardcoded list of
possible values in GetJavaProperties at

,
the corresponding non-Windows code in GetJavaProperties at


uses ARCHPROPNAME which, via

> -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'

at

,
appears to somehow come out of Autoconf at

,
so probably can show some variance in actual values being used.

Change-Id: I16725cd9365f6bd034372c653aa43ab84d487b98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125401
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 8863df3352ff..f4cf14a9ab3f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -175,10 +175,12 @@ bool VendorBase::isValidArch() const
 // It is not defined what the exact values are.
 // Oracle JRE 8 has "x86" and "amd64", the others were found at 
http://lopica.sourceforge.net/os.html .
 // There might still be missing some options; we need to extend the check 
once we find out.
-#if defined _WIN64
+#if defined _WIN64 || (defined MACOSX && defined __x86_64__)
 return m_sArch == "amd64" || m_sArch == "x86_64";
 #elif defined _WIN32
 return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
+#elif defined MACOSX && defined __aarch64__
+return m_sArch == "aarch64";
 #else
 (void)this;
 return true;


[Libreoffice-commits] core.git: jvmfwk/plugins

2021-10-20 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx   |6 ++
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx |2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 18bdf78e156f3cd1e6ccbb3ae28e919583bac70c
Author: Stephan Bergmann 
AuthorDate: Wed Oct 20 10:38:37 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 20 15:21:58 2021 +0200

Azul is just another OpenJDK variant

...so there was no good reason for 0f95f8ffd7a3685ca53876005a9c96f2e2e7bc99
"Support Azul Zulu JRE (at least on Windows)" to map it to OtherInfo rather 
than
SunInfo.  (That way, it benefits from SunInfo::compareVersions's proper
implementation, unlike OtherInfo::compareVersions which always returns 0.
Although trying to add e.g. the too-old Java 7

would already have failed before this commit due to a
java.lang.UnsupportedClassVersionError when executing the JREProperties 
code.)

This also reverts all the "needed by Azul" additions in
OtherInfo::getRuntimePaths; it is unlikely that any of the other JREs using
OtherInfo silently also benefited from them, and JREs of unknown vendor use
SunInfo (which does have those two paths already, as they are not only 
needed by
Azul there).

Change-Id: I4af9b4b9e65cd2346011522c105cfc62ec59f552
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123874
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
index 5c7f3ba9afc8..578c51f0b0cc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
@@ -52,12 +52,10 @@ char const* const* OtherInfo::getRuntimePaths(int * size)
 "/bin/client/jvm.dll",
 "/bin/hotspot/jvm.dll",
 "/bin/classic/jvm.dll",
-"/bin/jrockit/jvm.dll",
-"/bin/server/jvm.dll" // needed by Azul
+"/bin/jrockit/jvm.dll"
 #elif defined UNX
 #ifdef MACOSX
-"/../../../../../Frameworks/JavaVM.framework/JavaVM", //as of  1.6.0_22
-"/lib/server/libjvm.dylib" // needed by Azul
+"/../../../../../Frameworks/JavaVM.framework/JavaVM" //as of  1.6.0_22
 #else
 "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", // for Blackdown PPC
 "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", // for Blackdown AMD64
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index 183075e0c9af..b68152e80906 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -40,6 +40,7 @@ VendorSupportMapEntry const gVendorMap[] ={
 VENDOR_MAP_ENTRY("Oracle Corporation"),
 VENDOR_MAP_ENTRY("AdoptOpenJdk"),
 VENDOR_MAP_ENTRY("Amazon.com Inc."),
+VENDOR_MAP_ENTRY("Azul Systems, Inc."),
 #ifndef MACOSX
 VENDOR_MAP_ENTRY("IBM Corporation"),
 VENDOR_MAP_ENTRY("Blackdown Java-Linux Team"),
@@ -47,7 +48,6 @@ VendorSupportMapEntry const gVendorMap[] ={
 VENDOR_MAP_ENTRY("Free Software Foundation, Inc."),
 VENDOR_MAP_ENTRY("The FreeBSD Foundation"),
 #endif
-VENDOR_MAP_ENTRY("Azul Systems, Inc."),
 {nullptr, nullptr, nullptr} };
 
 }


[Libreoffice-commits] core.git: jvmfwk/plugins

2021-07-07 Thread Michael Stahl (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java |   11 
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx   |   42 +--
 2 files changed, 48 insertions(+), 5 deletions(-)

New commits:
commit 515b72fb9275c76ff9f26b0c3c47cac706d92af0
Author: Michael Stahl 
AuthorDate: Wed Jul 7 11:28:47 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 7 15:07:32 2021 +0200

Revert "I suspect that we unlikely to use JRE older than 1.3.1_07"

This reverts commit b3541dea4889b9d0039554f87bd16e55189cf8b1.

Reason for revert: The code did not just deal with text encoding 
differences, but also with properties whose value contains line breaks.

For example, OpenJ9 has line breaks in "java.vm.info" and 
"java.fullversion", which now trigger asserts; also there is "line.separator" 
but this one happened not to cause problems so far.

Change-Id: I3ded8e824e96b6fcf21677dd9ba72cbf58c1d261
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118495
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java 
b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
index d863c359a489..0d3503af385f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
+++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
@@ -25,6 +25,9 @@ import java.util.*;
 unfortunately this works only with later update - versions (for example,
 1.3.1_07). Therefore we use this scheme. The property string has this form:
 name=value
+
+Every character is cast to an integer which value is printed, followed by a
+space. If all characters of the string are printed, then a new line is 
printed.
 */
 public class JREProperties
 {
@@ -37,7 +40,13 @@ public class JREProperties
 while (e.hasMoreElements()) {
 String sProp = (String) e.nextElement();
 String sCompleteProp = sProp + "=" + p.getProperty(sProp);
-System.out.println(sCompleteProp);
+char[] arChars = new char[sCompleteProp.length()];
+sCompleteProp.getChars(0, sCompleteProp.length(), arChars, 0);
+for (int c = 0; c < arChars.length; c++) {
+System.out.print(String.valueOf((int) arChars[c]));
+System.out.print(" ");
+}
+System.out.print("\n");
 }
 }
 catch(Exception e)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 90911ee7d153..df14c0841bf9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -114,6 +114,9 @@ static bool getSDKInfoFromRegistry(vector & 
vecHome);
 static bool getJREInfoFromRegistry(vector& vecJavaHome);
 #endif
 
+static bool decodeOutput(const OString& s, OUString* out);
+
+
 namespace
 {
 
@@ -382,11 +385,11 @@ bool getJavaProps(const OUString & exePath,
 #endif
 
 //prepare the arguments
-OUString arg0 = "-Dfile.encoding=UTF8";
+sal_Int32 const cArgs = 3;
 OUString arg1 = "-classpath";// + sClassPath;
 OUString arg2 = sClassPath;
 OUString arg3("JREProperties");
-rtl_uString *args[] = {arg0.pData, arg1.pData, arg2.pData, arg3.pData};
+rtl_uString *args[cArgs] = {arg1.pData, arg2.pData, arg3.pData};
 
 oslProcess javaProcess= nullptr;
 oslFileHandle fileOut= nullptr;
@@ -399,7 +402,7 @@ bool getJavaProps(const OUString & exePath,
 oslProcessError procErr =
 osl_executeProcess_WithRedirectedIO( exePath.pData,//usExe.pData,
  args,
- SAL_N_ELEMENTS(args), 
//sal_uInt32   nArguments,
+ cArgs, 
//sal_uInt32   nArguments,
  osl_Process_HIDDEN, 
//oslProcessOption Options,
  nullptr, //oslSecurity Security,
  
usStartDir.pData,//usStartDir.pData,//usWorkDir.pData, //rtl_uString 
*strWorkDir,
@@ -436,7 +439,9 @@ bool getJavaProps(const OUString & exePath,
 rs = stdoutReader.readLine( & aLine);
 if (rs != FileHandleReader::RESULT_OK)
 break;
-OUString sLine = OStringToOUString(aLine, RTL_TEXTENCODING_UTF8);
+OUString sLine;
+if (!decodeOutput(aLine, &sLine))
+continue;
 JFW_TRACE2("  \"" << sLine << "\"");
 sLine = sLine.trim();
 if (sLine.isEmpty())
@@ -474,6 +479,35 @@ bool getJavaProps(const OUString & exePath,
 return ret;
 }
 
+/* converts the properties printed by JREProperties.class into
+readable strings. The strings are encoded as integer values separated
+by spaces.
+ */
+bool decodeOutput(const OString& s, OUString* out)
+{
+OSL_ASSERT(out != nullptr);
+OUStringBuff

[Libreoffice-commits] core.git: jvmfwk/plugins

2021-06-29 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e529461bcb126e0975ffa3f86e1fd5a630551de2
Author: Stephan Bergmann 
AuthorDate: Tue Dec 22 12:55:54 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jun 29 16:36:50 2021 +0200

Enable JVM also on macOS ARM64

My previous attempts of `make check` and running a --with-java build against
various Azul JDK 13--17 have always crashed with SIGBUS that smelled like 
our
uses of pthread_jit_write_protect_np in
bridges/source/cpp_uno/shared/vtablefactory.cxx colided with corresponding 
calls
in the in-process JVM, randomly(?) causing some attempts of running 
generated
code to SIGBUS.  (See the email thread starting at


"Using Java on macOS ARM64".)

But at least with the recent


on macOS 11.4, this appears to work reliably now:  Multiple `make check
screenshot` as well as some manual use of LibreOffice did not run into any 
such
issues.

Change-Id: I2b1327e7e877ed71420c174c1d88e68a96b3532e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118114
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 51d5046c203f..4f1e95fb4580 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -59,7 +59,7 @@ char const* const* SunInfo::getRuntimePaths(int * size)
 "/bin/jrockit/jvm.dll",
 // The 64-bit JRE has the jvm in bin/server
 "/bin/server/jvm.dll"
-#elif defined MACOSX && defined X86_64
+#elif defined MACOSX
 // Oracle Java 7, under /Library/Internet 
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
 "/lib/server/libjvm.dylib",
 "/lib/jli/libjli.dylib"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2021-05-10 Thread Mike Kaganski (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java |   11 
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx   |   42 +--
 2 files changed, 5 insertions(+), 48 deletions(-)

New commits:
commit b3541dea4889b9d0039554f87bd16e55189cf8b1
Author: Mike Kaganski 
AuthorDate: Sun May 9 18:07:16 2021 +0200
Commit: Mike Kaganski 
CommitDate: Mon May 10 14:38:57 2021 +0200

I suspect that we unlikely to use JRE older than 1.3.1_07

... and so possibly can rely on -Dfile.encoding=UTF8 now.

This reverts 79ac0685de0b19d856db70a208a8372cb589646c
and 3428bace79d64a10cfcabb79e4caa608ee5db233.

Change-Id: Ia9e09025691b200c0f79427e0f4efe500f9c81f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115272
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java 
b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
index 0d3503af385f..d863c359a489 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
+++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
@@ -25,9 +25,6 @@ import java.util.*;
 unfortunately this works only with later update - versions (for example,
 1.3.1_07). Therefore we use this scheme. The property string has this form:
 name=value
-
-Every character is cast to an integer which value is printed, followed by a
-space. If all characters of the string are printed, then a new line is 
printed.
 */
 public class JREProperties
 {
@@ -40,13 +37,7 @@ public class JREProperties
 while (e.hasMoreElements()) {
 String sProp = (String) e.nextElement();
 String sCompleteProp = sProp + "=" + p.getProperty(sProp);
-char[] arChars = new char[sCompleteProp.length()];
-sCompleteProp.getChars(0, sCompleteProp.length(), arChars, 0);
-for (int c = 0; c < arChars.length; c++) {
-System.out.print(String.valueOf((int) arChars[c]));
-System.out.print(" ");
-}
-System.out.print("\n");
+System.out.println(sCompleteProp);
 }
 }
 catch(Exception e)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 3b7a2beb2314..85001803bebc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -113,9 +113,6 @@ static bool getSDKInfoFromRegistry(vector & 
vecHome);
 static bool getJREInfoFromRegistry(vector& vecJavaHome);
 #endif
 
-static bool decodeOutput(const OString& s, OUString* out);
-
-
 namespace
 {
 
@@ -384,11 +381,11 @@ bool getJavaProps(const OUString & exePath,
 #endif
 
 //prepare the arguments
-sal_Int32 const cArgs = 3;
+OUString arg0 = "-Dfile.encoding=UTF8";
 OUString arg1 = "-classpath";// + sClassPath;
 OUString arg2 = sClassPath;
 OUString arg3("JREProperties");
-rtl_uString *args[cArgs] = {arg1.pData, arg2.pData, arg3.pData};
+rtl_uString *args[] = {arg0.pData, arg1.pData, arg2.pData, arg3.pData};
 
 oslProcess javaProcess= nullptr;
 oslFileHandle fileOut= nullptr;
@@ -401,7 +398,7 @@ bool getJavaProps(const OUString & exePath,
 oslProcessError procErr =
 osl_executeProcess_WithRedirectedIO( exePath.pData,//usExe.pData,
  args,
- cArgs, 
//sal_uInt32   nArguments,
+ SAL_N_ELEMENTS(args), 
//sal_uInt32   nArguments,
  osl_Process_HIDDEN, 
//oslProcessOption Options,
  nullptr, //oslSecurity Security,
  
usStartDir.pData,//usStartDir.pData,//usWorkDir.pData, //rtl_uString 
*strWorkDir,
@@ -438,9 +435,7 @@ bool getJavaProps(const OUString & exePath,
 rs = stdoutReader.readLine( & aLine);
 if (rs != FileHandleReader::RESULT_OK)
 break;
-OUString sLine;
-if (!decodeOutput(aLine, &sLine))
-continue;
+OUString sLine = OStringToOUString(aLine, RTL_TEXTENCODING_UTF8);
 JFW_TRACE2("  \"" << sLine << "\"");
 sLine = sLine.trim();
 if (sLine.isEmpty())
@@ -478,35 +473,6 @@ bool getJavaProps(const OUString & exePath,
 return ret;
 }
 
-/* converts the properties printed by JREProperties.class into
-readable strings. The strings are encoded as integer values separated
-by spaces.
- */
-bool decodeOutput(const OString& s, OUString* out)
-{
-OSL_ASSERT(out != nullptr);
-OUStringBuffer buff(512);
-sal_Int32 nIndex = 0;
-do
-{
-OString aToken = s.getToken( 0, ' ', nIndex );
-if (!aToken.isEmpty())
-{
-for (sal_Int32 i = 0; i < aToken.getLength(); ++i)
-{
-

[Libreoffice-commits] core.git: jvmfwk/plugins

2020-09-22 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm |   38 
 1 file changed, 7 insertions(+), 31 deletions(-)

New commits:
commit 7db048f62929a9d267b63db3a6ea2b58b47ec757
Author: Stephan Bergmann 
AuthorDate: Tue Sep 22 20:41:49 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 22 21:43:56 2020 +0200

Manually select JDK outside /Library/Java/JavaVirtualMachines on macOS

32bc8ddbf335dd26019edcf12758643b4cff9913 "tdf#94716 allow Oracle's JDK to be
used on OS X 10.10 and 10.11" had restricted both addJavaInfosDirScan
(jvmfwk/plugins/sunmajor/pluginlib/util.cxx, relevant when LO scans for
available Java runtimes) and JvmfwkUtil_isLoadableJVM (which is more 
central and
also relevant when manually adding a Java installation on the Advanced 
options
page) to JDK installations under /Library/Java/JavaVirtualMachines.

Recent versions of OpenJDK for macOS are provided as *.tar.gz files (e.g.,

 avaiable at ) that 
can
potentially be installed anywhere, so it looks useful to remove the
/Library/Java/JavaVirtualMachines restriction from JvmfwkUtil_isLoadableJVM.

I'm not sure whether that would have any nagative impact, esp. for any 
scenario
that would still be relevant today.  When I unpacked the above
openjdk-15_osx-x64_bin.tar.gz to ~/OpenJDK/ on my macOS 10.15.6, and 
manually
added /Users/stephan/OpenJDK/jdk-15.jdk/Contents/Home on the Advanced 
options
page, everything appeared to work fine.

Change-Id: I15545cc786a4a423f3bfe22ba477a45d6ef7fdf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103212
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm 
b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm
index 136518253cde..8c745f8d98db 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm
@@ -21,40 +21,16 @@ bool JvmfwkUtil_isLoadableJVM( OUString const & aURL )
 NSString *pString = [NSString 
stringWithCharacters:reinterpret_cast(aURL.getStr()) 
length:aURL.getLength()];
 if ( pString )
 {
-NSURL *pURL = nil;
-
 // Ignore all but Oracle's JDK as loading Apple's Java and Oracle's
 // JRE will cause macOS's JavaVM framework to display a dialog and
 // invoke exit() when loaded via JNI on macOS 10.10
-NSURL *pTmpURL = [NSURL URLWithString:pString];
-if ( pTmpURL )
-pTmpURL = [pTmpURL filePathURL];
-if ( pTmpURL )
-pTmpURL = [pTmpURL URLByStandardizingPath];
-if ( pTmpURL )
-pTmpURL = [pTmpURL URLByResolvingSymlinksInPath];
-if ( pTmpURL )
-{
-NSURL *pJVMsDirURL = [NSURL 
URLWithString:@"file:///Library/Java/JavaVirtualMachines/"];
-if ( pJVMsDirURL )
-pJVMsDirURL= [pJVMsDirURL filePathURL];
-if ( pJVMsDirURL )
-pJVMsDirURL = [pJVMsDirURL URLByStandardizingPath];
-// The JVM directory must not contain softlinks or the JavaVM
-// framework bug will occur so don't resolve softlinks in the
-// JVM directory
-if ( pJVMsDirURL )
-{
-NSString *pTmpURLString = [pTmpURL absoluteString];
-NSString *pJVMsDirURLString = [pJVMsDirURL absoluteString];
-if ( pTmpURLString && pJVMsDirURLString && 
[pJVMsDirURLString length] )
-{
-NSRange aJVMsDirURLRange = [pTmpURLString 
rangeOfString:pJVMsDirURLString];
-if ( !aJVMsDirURLRange.location && 
aJVMsDirURLRange.length )
-pURL = pTmpURL;
-}
-}
-}
+NSURL *pURL = [NSURL URLWithString:pString];
+if ( pURL )
+pURL = [pURL filePathURL];
+if ( pURL )
+pURL = [pURL URLByStandardizingPath];
+if ( pURL )
+pURL = [pURL URLByResolvingSymlinksInPath];
 
 while ( pURL )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2020-08-18 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1b006f8aaa7fd2dd9394f8a74f85999e58fb2310
Author: Stephan Bergmann 
AuthorDate: Tue Aug 18 11:12:10 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 18 13:29:22 2020 +0200

Add missing punctuation/spaces to error messages

Change-Id: I4be46342b24a5993df74dbd047d88842a8df0412
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100901
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index abe47b567832..acd5af590dff 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -682,7 +682,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 OString sSymbol = OUStringToOString(
 sSymbolCreateJava, osl_getThreadTextEncoding());
 fprintf(stderr,"[Java framework]sunjavaplugin" SAL_DLLEXTENSION
-"Java runtime library: %s does not export symbol %s !\n",
+": Java runtime library: %s does not export symbol %s !\n",
 sLib.getStr(), sSymbol.getStr());
 return javaPluginError::VmCreationFailed;
 }
@@ -796,13 +796,13 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 if( err < 0)
 {
 fprintf(stderr,"[Java framework] sunjavaplugin" SAL_DLLEXTENSION
-"Can not create Java Virtual Machine, %" SAL_PRIdINT32 
"\n", sal_Int32(err));
+": Can not create Java Virtual Machine, %" SAL_PRIdINT32 
"\n", sal_Int32(err));
 errorcode = javaPluginError::VmCreationFailed;
 }
 else if( err > 0)
 {
 fprintf(stderr,"[Java framework] sunjavaplugin" SAL_DLLEXTENSION
-"Can not create JavaVirtualMachine, abort handler was 
called.\n");
+": Can not create JavaVirtualMachine, abort handler was 
called.\n");
 errorcode = javaPluginError::VmCreationFailed;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2020-08-18 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 15914df5f0d857b038ae5580c483541a6c0826fc
Author: Stephan Bergmann 
AuthorDate: Tue Aug 18 10:51:20 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 18 11:45:52 2020 +0200

Silence new Clang 12 trunk -Werror,-Wstring-concatenation

"suspicious concatenation of string literals in an array initialization; 
did you
mean to separate the elements with a comma?"

Change-Id: I83828d8cc6f8ab9b0c1ca8a1c3fb528592c46504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100897
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
index 8a10d39a89e3..fd2468edf65e 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
@@ -90,7 +90,7 @@ char const* const* OtherInfo::getLibraryPaths(int* size)
 "/lib/" JFW_PLUGIN_ARCH "/classic",
 "/lib/" JFW_PLUGIN_ARCH "/jrockit",
 "/lib/" JFW_PLUGIN_ARCH "/native_threads",
-"/lib/" JFW_PLUGIN_ARCH
+("/lib/" JFW_PLUGIN_ARCH)
 };
 
 *size = SAL_N_ELEMENTS(ar);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 89731ad15ddc..51d5046c203f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -82,7 +82,7 @@ char const* const* SunInfo::getLibraryPaths(int* size)
 "/lib/" JFW_PLUGIN_ARCH "/client",
 "/lib/" JFW_PLUGIN_ARCH "/server",
 "/lib/" JFW_PLUGIN_ARCH "/native_threads",
-"/lib/" JFW_PLUGIN_ARCH
+("/lib/" JFW_PLUGIN_ARCH)
 };
 *size = SAL_N_ELEMENTS(ar);
 return ar;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins vcl/source

2020-05-19 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |5 ++---
 vcl/source/filter/jpeg/jpegc.cxx|8 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit fc1d1acd518a9937c2501242dae2af4530b52fe7
Author: Stephan Bergmann 
AuthorDate: Tue May 19 08:57:31 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 19 09:57:57 2020 +0200

Avoid UB when calling setjmp

The C standard (and thus by reference also the C++ standard) has very picky
constraints how invocations of the setjmp macro need to appear to not cause
undefined behavior.

Change-Id: I09418de340a044e4309261bae9816ca746700858
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94474
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 7fcd60891263..abe47b567832 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -213,11 +213,10 @@ int createJvm(
 g_bInGetJavaVM = 1;
 jint err;
 memset( jmp_jvm_abort, 0, sizeof(jmp_jvm_abort));
-int jmpval= setjmp( jmp_jvm_abort );
-/* If jmpval is not "0" then this point was reached by a longjmp in the
+/* If the setjmp return value is not "0" then this point was reached by a 
longjmp in the
abort_handler, which was called indirectly by JNI_CreateVM.
 */
-if( jmpval == 0)
+if( setjmp( jmp_jvm_abort ) == 0)
 {
 //returns negative number on failure
 err= pCreateJavaVM(pJavaVM, ppEnv, vm_args);
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index ced814e2fccb..c1fbb535a8e4 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -469,7 +469,13 @@ void Transform(void* pInputStream, void* pOutputStream, 
long nAngle)
 JpegDecompressOwner aDecompressOwner;
 JpegCompressOwner aCompressOwner;
 
-if (setjmp(aSourceError.setjmp_buffer) || 
setjmp(aDestinationError.setjmp_buffer))
+if (setjmp(aSourceError.setjmp_buffer))
+{
+jpeg_destroy_decompress(&aSourceInfo);
+jpeg_destroy_compress(&aDestinationInfo);
+return;
+}
+if (setjmp(aDestinationError.setjmp_buffer))
 {
 jpeg_destroy_decompress(&aSourceInfo);
 jpeg_destroy_compress(&aDestinationInfo);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2020-05-16 Thread Thorsten Behrens (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 759f55c01059b599f4294ea2e37d3dc3748a54be
Author: Thorsten Behrens 
AuthorDate: Sun May 17 01:47:20 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sun May 17 03:07:25 2020 +0200

jvmfwk: fix [-Werror,-Wunused-function]

After recent cleanups, android build fails with
sunjavaplugin.cxx:204:5: error: unused function 'createJvm'
[-Werror,-Wunused-function]

Change-Id: Idc9a97673debdd5da798fbdc729b8d90b6b7af9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94371
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 1d3667988cf9..7fcd60891263 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -201,6 +201,7 @@ extern "C" void JNICALL abort_handler()
 
 typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *);
 
+#ifndef ANDROID
 int createJvm(
 JNI_CreateVM_Type * pCreateJavaVM, JavaVM ** pJavaVM, JNIEnv ** ppEnv, 
JavaVMInitArgs * vm_args)
 {
@@ -228,6 +229,7 @@ int createJvm(
 err= 1;
 return err;
 }
+#endif
 
 /** helper function to check Java version requirements
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2020-05-15 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   69 +---
 1 file changed, 33 insertions(+), 36 deletions(-)

New commits:
commit dd372b444f1f1821048e197768d5095e6204a102
Author: Stephan Bergmann 
AuthorDate: Fri May 15 20:30:12 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 15 23:29:12 2020 +0200

Avoid any false GCC -Wclobbered

...by moving the code that calls JNI_CreateJavaVM and the setjmp that it may
longjmp to (from abort_handler that may be called from within 
JNI_CreateJavaVM)
into its own small function.  That way, no local variables in
jfw_plugin_startJavaVirtualMachine should produce any such false "variable 
might
be clobbered by ‘longjmp’ or ‘vfork’" GCC warnings any longer, and all the
workarounds to silence such warnings can be removed.

Change-Id: I6de134628e8efbf2d67fcd83a9cc2623b55762a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94330
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 6397cda3c045..46f5cfba1281 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -200,6 +200,36 @@ extern "C" void JNICALL abort_handler()
 }
 }
 
+typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *);
+
+int createJvm(
+JNI_CreateVM_Type * pCreateJavaVM, JavaVM ** pJavaVM, JNIEnv ** ppEnv, 
JavaVMInitArgs * vm_args)
+{
+/* We set a global flag which is used by the abort handler in order to
+   determine whether it is  should use longjmp to get back into this 
function.
+   That is, the abort handler determines if it is on the same stack as 
this function
+   and then jumps back into this function.
+*/
+g_bInGetJavaVM = 1;
+jint err;
+memset( jmp_jvm_abort, 0, sizeof(jmp_jvm_abort));
+int jmpval= setjmp( jmp_jvm_abort );
+/* If jmpval is not "0" then this point was reached by a longjmp in the
+   abort_handler, which was called indirectly by JNI_CreateVM.
+*/
+if( jmpval == 0)
+{
+//returns negative number on failure
+err= pCreateJavaVM(pJavaVM, ppEnv, vm_args);
+g_bInGetJavaVM = 0;
+}
+else
+// set err to a positive number, so as or recognize that an abort 
(longjmp)
+//occurred
+err= 1;
+return err;
+}
+
 /** helper function to check Java version requirements
 
 This function checks if the Java version of the given VendorBase
@@ -587,12 +617,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 assert(pInfo != nullptr);
 assert(ppVm != nullptr);
 assert(ppEnv != nullptr);
-// unless guard is volatile the following warning occurs on gcc:
-// warning: variable 't' might be clobbered by `longjmp' or `vfork'
-volatile osl::MutexGuard guard(PluginMutex::get());
-// unless errorcode is volatile the following warning occurs on gcc:
-// warning: variable 'errorcode' might be clobbered by `longjmp' or `vfork'
-volatile javaPluginError errorcode = javaPluginError::NONE;
+osl::MutexGuard guard(PluginMutex::get());
+javaPluginError errorcode = javaPluginError::NONE;
 #ifdef MACOSX
 rtl::Reference aVendorInfo = getJREInfoByPath( 
pInfo->sLocation );
 if ( !aVendorInfo.is() || aVendorInfo->compareVersions( pInfo->sVersion ) 
< 0 )
@@ -644,7 +670,6 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 osl_setEnvironment(OUString("JAVA_HOME").pData, sPathLocation.pData);
 #endif
 
-typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *);
 OUString sSymbolCreateJava("JNI_CreateJavaVM");
 
 JNI_CreateVM_Type * pCreateJavaVM =
@@ -763,29 +788,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 vm_args.nOptions= options.size(); //TODO overflow
 vm_args.ignoreUnrecognized= JNI_TRUE;
 
-/* We set a global flag which is used by the abort handler in order to
-   determine whether it is  should use longjmp to get back into this 
function.
-   That is, the abort handler determines if it is on the same stack as 
this function
-   and then jumps back into this function.
-*/
-g_bInGetJavaVM = 1;
-jint err;
 JavaVM * pJavaVM = nullptr;
-memset( jmp_jvm_abort, 0, sizeof(jmp_jvm_abort));
-int jmpval= setjmp( jmp_jvm_abort );
-/* If jmpval is not "0" then this point was reached by a longjmp in the
-   abort_handler, which was called indirectly by JNI_CreateVM.
-*/
-if( jmpval == 0)
-{
-//returns negative number on failure
-err= pCreateJavaVM(&pJavaVM, ppEnv, &vm_args);
-g_bInGetJavaVM = 0;
-}
-else
-// set err to a positive number, so as or recognize that an abort 
(longjmp)
-//occurred
-err= 1;
+jint err = createJvm(pCreateJavaVM, &pJavaVM, ppEnv, &vm_args);
 
 if(err != 0)
 

[Libreoffice-commits] core.git: jvmfwk/plugins

2020-05-15 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 73f973df8fe588272e99d330d1b7b9254c9341d7
Author: Stephan Bergmann 
AuthorDate: Fri May 15 11:36:40 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 15 14:12:30 2020 +0200

Use symbolic JFW_FEATURE_ACCESSBRIDGE

(unclear why 43cc8abfb0a41878c4e78fd3b868b1d4f344c610 "#i20052# plugin lib 
for
java framework" hadn't done so from the start, when
2b24c46035657a8a43c6552328f7b4dda1622ce5 "#i20052# java framework" had 
already
introduced the macro)

Change-Id: I7f83e5ee68300438bcf7b49bdd12512ca0cbea42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94286
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index cec0ce97ff6a..6397cda3c045 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -168,7 +168,7 @@ std::unique_ptr createJavaInfo(
 return std::unique_ptr(
 new JavaInfo{
 info->getVendor(), info->getHome(), info->getVersion(),
-sal_uInt64(info->supportsAccessibility() ? 1 : 0),
+sal_uInt64(info->supportsAccessibility() ? 
JFW_FEATURE_ACCESSBRIDGE : 0),
 sal_uInt64(info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0),
 rtl::ByteSequence(
 reinterpret_cast(sVendorData.pData->buffer),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2020-05-13 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e8bd027d70d448d8fc5dd90d1a94b4fa6cb937b2
Author: Stephan Bergmann 
AuthorDate: Wed May 13 14:14:18 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 13 16:53:12 2020 +0200

The -Wclobbered hack appears to be needed for all versions of GCC

What apparently triggers it here is a combination of

  --enable-assert-always-abort
  --enable-optimized
  --enable-werror

See  "Unexpected 
-Wclobbered
in bits/vector.tcc with -O2" for a stripped-down reproducer.

Change-Id: Ic2cff0e402290cd9fd67790168dc1183799e3f14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94121
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index c754dbe7c9cb..cec0ce97ff6a 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -818,12 +818,12 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #endif
 
 return errorcode;
-#if defined __GNUC__ && (__GNUC__ == 7 || __GNUC__ == 10) && !defined __clang__
+#if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wclobbered"
 #endif
 }
-#if defined __GNUC__ && (__GNUC__ == 7 || __GNUC__ == 10) && !defined __clang__
+#if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2020-05-12 Thread Noel Grandin (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ab3eabe438880d6c0fc7dab99a8537d873da3f05
Author: Noel Grandin 
AuthorDate: Tue May 12 15:34:33 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed May 13 08:28:13 2020 +0200

gcc 10 also generates this clobber warning

(specifically 10.1.1 is the version I have)

Change-Id: I40fd720a9a75b809f24ca135c4ddb0ce61ecbe41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94056
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 4760ab629313..c754dbe7c9cb 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -818,12 +818,12 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #endif
 
 return errorcode;
-#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ == 7 || __GNUC__ == 10) && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wclobbered"
 #endif
 }
-#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ == 7 || __GNUC__ == 10) && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2020-04-07 Thread Noel Grandin (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |   60 ++---
 jvmfwk/source/fwkbase.cxx  |   34 
 2 files changed, 47 insertions(+), 47 deletions(-)

New commits:
commit 21eb6c98bcfb1d453f8eb9f73bd87f6dd87aa882
Author: Noel Grandin 
AuthorDate: Tue Apr 7 14:16:40 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 7 15:12:35 2020 +0200

loplugin:flatten in jvmfwk

Change-Id: Ic58bc539ad6b4e1ef1d8049ec97547d1420be8a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91817
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index ff540cc52325..db855d9ce4f4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1049,44 +1049,44 @@ void addJavaInfosFromPath(
 #if !defined JVM_ONE_PATH_CHECK
 // Get Java from PATH environment variable
 char *szPath= getenv("PATH");
-if(szPath)
+if(!szPath)
+return;
+
+OUString usAllPath(szPath, strlen(szPath), osl_getThreadTextEncoding());
+sal_Int32 nIndex = 0;
+do
 {
-OUString usAllPath(szPath, strlen(szPath), 
osl_getThreadTextEncoding());
-sal_Int32 nIndex = 0;
-do
+OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR, nIndex );
+OUString usTokenUrl;
+if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == File::E_None)
 {
-OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR, 
nIndex );
-OUString usTokenUrl;
-if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == 
File::E_None)
+if(!usTokenUrl.isEmpty())
 {
-if(!usTokenUrl.isEmpty())
+OUString usBin;
+if(usTokenUrl == ".")
 {
-OUString usBin;
-if(usTokenUrl == ".")
-{
-OUString usWorkDirUrl;
-if(osl_Process_E_None == 
osl_getProcessWorkingDir(&usWorkDirUrl.pData))
-usBin= usWorkDirUrl;
-}
-else if(usTokenUrl == "..")
-{
-OUString usWorkDir;
-if(osl_Process_E_None == 
osl_getProcessWorkingDir(&usWorkDir.pData))
-usBin= getDirFromFile(usWorkDir);
-}
-else
-{
-usBin = usTokenUrl;
-}
-if(!usBin.isEmpty())
-{
-addJREInfoFromBinPath(usBin, allInfos, addedInfos);
-}
+OUString usWorkDirUrl;
+if(osl_Process_E_None == 
osl_getProcessWorkingDir(&usWorkDirUrl.pData))
+usBin= usWorkDirUrl;
+}
+else if(usTokenUrl == "..")
+{
+OUString usWorkDir;
+if(osl_Process_E_None == 
osl_getProcessWorkingDir(&usWorkDir.pData))
+usBin= getDirFromFile(usWorkDir);
+}
+else
+{
+usBin = usTokenUrl;
+}
+if(!usBin.isEmpty())
+{
+addJREInfoFromBinPath(usBin, allInfos, addedInfos);
 }
 }
 }
-while ( nIndex >= 0 );
 }
+while ( nIndex >= 0 );
 #endif
 }
 
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 332d84ebb07b..7f3cd0a132ae 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -94,23 +94,23 @@ VendorSettings::VendorSettings()
 SAL_WARN( "jfw", sMsg );
 throw FrameworkException(JFW_E_CONFIGURATION, sMsg);
 }
-if (!sSettingsPath.isEmpty())
-{
-m_xmlDocVendorSettings = xmlParseFile(sSettingsPath.getStr());
-if (m_xmlDocVendorSettings == nullptr)
-throw FrameworkException(
-JFW_E_ERROR,
-OStringLiteral("[Java framework] Error while parsing file: ")
-+ sSettingsPath + ".");
-
-m_xmlPathContextVendorSettings = 
xmlXPathNewContext(m_xmlDocVendorSettings);
-int res = xmlXPathRegisterNs(
-m_xmlPathContextVendorSettings, reinterpret_cast("jf"),
-reinterpret_cast(NS_JAVA_FRAMEWORK));
-if (res == -1)
-throw FrameworkException(JFW_E_ERROR,
-"[Java framework] Error in constructor 
VendorSettings::VendorSettings() (fwkbase.cxx)");
-}
+if (sSettingsPath.isEmpty())
+return;
+
+m_xmlDocVendorSettings = xmlParseFile(sSettingsPath.getStr());
+if (m_xmlDocVendorSettings == nullptr)
+throw FrameworkException(
+JFW_E_ERROR,
+   

[Libreoffice-commits] core.git: jvmfwk/plugins

2020-03-27 Thread ilhan (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 6b6af620ff53209487a146aa3977db328c3a6300
Author: ilhan 
AuthorDate: Wed Mar 25 11:18:09 2020 +0100
Commit: Michael Stahl 
CommitDate: Fri Mar 27 17:46:51 2020 +0100

tdf#131399 Update java settings after slight java version change

Under linux, the version is now also checked for changes at startup
of libreoffice.

Change-Id: I572f718cf5afc83a70d98a6897f1d3d6877644f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91037
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 128de9b352b0..4760ab629313 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -867,6 +867,18 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, 
bool *exist)
 *exist = true;
 JFW_TRACE2("Java runtime library exist: " << sRuntimeLib);
 
+// Check version
+rtl::Reference aVendorInfo = 
getJREInfoByPath(sLocation);
+if (!aVendorInfo.is())
+{
+*exist = false;
+JFW_TRACE2("JRE or supported vendor not accessible at 
location: " << sLocation);
+}
+else if(pInfo->sVersion!=aVendorInfo->getVersion())
+{
+*exist = false;
+JFW_TRACE2("Mismatch between version number in libreoffice 
settings and installed JRE:  " << pInfo->sVersion <<" != " << 
aVendorInfo->getVersion());
+}
 }
 else if (::osl::File::E_NOENT == rc_itemRt)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2019-12-16 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit b70cc938c3a38e4d7aabac032b3bd5475bccdbff
Author: Stephan Bergmann 
AuthorDate: Mon Dec 16 10:05:50 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 16 12:59:09 2019 +0100

unused #include

...after c0ac7ae73480cd2b01f24e88c01bee507e8638f9 "Remove
JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY, JFW_PLUGIN_FORCE_ACCESSIBILITY"

Change-Id: I359255127782efa061f1daa35e524fb414a0160c
Reviewed-on: https://gerrit.libreoffice.org/85202
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index d630a84dd904..937500fe2467 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2019-12-14 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/sunjavapluginrc |2 --
 jvmfwk/source/jvmfwk3rc   |4 
 jvmfwk/source/readme.txt  |4 
 3 files changed, 10 deletions(-)

New commits:
commit 6f5dcd30d4035652d4ee3cf9708f481cd2f53977
Author: Stephan Bergmann 
AuthorDate: Sat Dec 14 09:16:40 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Dec 14 10:53:50 2019 +0100

Remove unused jvmfwk *rc files

...and accompanying readme.txt.  In the past, they got copied to "solver" 
and
were used during the build.  bf0e30f9cdee963d3cf889305c85b53c21b8c974 
"jvmfwk:
remove Package_*solver" stopped copying them.

From jvmfwk3rc, the UNO_JAVA_JFW_ENV_JREHOME/CLASSPATH=true settings are 
found
in OfficeConnection::setUp (unotest/source/cpp/officeconnection.cxx) and
org.openoffice.test.OfficeConnection.setup
(unotest/source/java/org/openoffice/test/OfficeConnection.java), used during
tests.  Setting UNO_JAVA_JFW_VENDOR_SETTINGS appears to not be necessary 
there
(presumably because those UNO_JAVA_JFW_ENV_* settings override its use 
anyway?).

The JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 in sunjavapluginrc had been 
added
as the fix for  "java
framework: registration of Java components may fail", most of the relevant
commit messages mention "#i40879# in build environment the JRE is not 
tested for
accessibility, because of potential X server problems".  There appears to 
be no
replacement that still sets it in post "solver" times, presumably because 
that
hack is just no longer relevant.

Change-Id: I3028b2f69c00eed3c5d2103345773b8daac409a0
Reviewed-on: https://gerrit.libreoffice.org/85136
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavapluginrc 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavapluginrc
deleted file mode 100644
index 0f2fb31eef90..
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavapluginrc
+++ /dev/null
@@ -1,2 +0,0 @@
-[Bootstrap]
-JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1
\ No newline at end of file
diff --git a/jvmfwk/source/jvmfwk3rc b/jvmfwk/source/jvmfwk3rc
deleted file mode 100644
index 048b16e7ab3b..
--- a/jvmfwk/source/jvmfwk3rc
+++ /dev/null
@@ -1,4 +0,0 @@
-[Bootstrap]
-UNO_JAVA_JFW_ENV_JREHOME=true
-UNO_JAVA_JFW_ENV_CLASSPATH=true
-UNO_JAVA_JFW_VENDOR_SETTINGS=javavendors.xml
\ No newline at end of file
diff --git a/jvmfwk/source/readme.txt b/jvmfwk/source/readme.txt
deleted file mode 100644
index b39576a7e863..
--- a/jvmfwk/source/readme.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-The file jvfwk3rc is intended for providing bootstrap parameter for the java 
-framework within the build environment. It is not part of a product. Tools 
-which are started in the environment, such as regcomp.exe and uno.exe, use
-this rc file when Java is needed. 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2019-07-29 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b8106018ab997931c872219986e2e9aa88b774af
Author: Stephan Bergmann 
AuthorDate: Mon Jul 29 09:04:52 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Jul 29 10:21:45 2019 +0200

Avoid memcpy nonnull issue

...as started to get reported by 


> /jvmfwk/plugins/sunmajor/pluginlib/util.cxx:368:33: runtime error: null 
pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:43:28: note: nonnull attribute specified here
> #0 0x2b710cdb4e35 in jfw_plugin::AsynchReader::execute() 
/jvmfwk/plugins/sunmajor/pluginlib/util.cxx:368:13
> #1 0x2b70c87b8a27 in salhelper::Thread::run() 
/salhelper/source/thread.cxx:40:9
> #2 0x2b70c87bac9f in threadFunc /include/osl/thread.hxx:185:15
> #3 0x2b70ba8bb89d in osl_thread_start_Impl(void*) 
/sal/osl/unx/thread.cxx:235:9
> #4 0x2b70bc47fdd4 in start_thread (/lib64/libpthread.so.0+0x7dd4)
> #5 0x2b70bcdb4eac in clone (/lib64/libc.so.6+0xfdeac)

during UITest_calc_tests6

Change-Id: I6505061192a8d6b9a68d72980fd134d161e5e1a3
Reviewed-on: https://gerrit.libreoffice.org/76516
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index d8238120b04c..f703fb4c200b 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -365,7 +365,9 @@ void AsynchReader::execute()
 {
 //Save the data we have in m_arData into a temporary array
 std::unique_ptr arTmp( new sal_Char[m_nDataSize]);
-memcpy(arTmp.get(), m_arData.get(), m_nDataSize);
+if (m_nDataSize != 0) {
+memcpy(arTmp.get(), m_arData.get(), m_nDataSize);
+}
 //Enlarge m_arData to hold the newly read data
 m_arData.reset(new sal_Char[static_cast(m_nDataSize + 
nRead)]);
 //Copy back the data that was already in m_arData
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: jvmfwk/plugins

2019-06-17 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 41dee8c55275c458317ce711478ff00b9a976451
Author: Stephan Bergmann 
AuthorDate: Mon Jun 17 15:47:12 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Jun 17 19:10:46 2019 +0200

simplify code

...following up on b70ab9e9e5630a965c5e6cc40c2480dddf1e2384 "Fix swapping of
vector elements"

Change-Id: Ib67b43345fa808bc25dff5aff11b387bb3455464
Reviewed-on: https://gerrit.libreoffice.org/74173
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f45a796dcad7..d8238120b04c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -731,7 +731,7 @@ void bubbleSortVersion(vector >& 
vec)
 }
 if(nCmp == 1) // cur > next
 {
-std::swap(vec.at(j-1), vec.at(j));
+std::swap(cur, next);
 }
 }
 ++cIter;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: jvmfwk/plugins

2019-06-10 Thread Stephan Bergmann (via logerrit)
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit b70ab9e9e5630a965c5e6cc40c2480dddf1e2384
Author: Stephan Bergmann 
AuthorDate: Fri Jun 7 22:06:46 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 11 08:34:34 2019 +0200

Fix swapping of vector elements

...which had been broken with edc85fb55f8adc30a1416c6c854c89097060fb21
"clang-tidy performance-unnecessary-copy-init in idl..reportdesign" (and 
could
cause "Tools - Options... - LibreOffice - Advanced - Java Options" to
erroneously list a single JRE multiple times, instead of listing different
JREs).

Change-Id: I6799903be39a5c6aa601131fad6eab3edea8d9e4
Reviewed-on: https://gerrit.libreoffice.org/73679
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 5824448b51d7..f45a796dcad7 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -731,8 +731,7 @@ void bubbleSortVersion(vector >& 
vec)
 }
 if(nCmp == 1) // cur > next
 {
-vec.at(j-1)= cur;
-vec.at(j)= next;
+std::swap(vec.at(j-1), vec.at(j));
 }
 }
 ++cIter;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: jvmfwk/plugins

2019-02-04 Thread Libreoffice Gerrit user
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx |   28 +++
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx |   11 ++---
 2 files changed, 17 insertions(+), 22 deletions(-)

New commits:
commit 91fcd999225e8525dc1765787cb110600cc92d48
Author: Stephan Bergmann 
AuthorDate: Mon Feb 4 14:20:33 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Feb 4 15:54:22 2019 +0100

Get rid of some macros

Change-Id: I9bbb1e41a687b62b32ed00f1c7cf5d82d66b4915
Reviewed-on: https://gerrit.libreoffice.org/67360
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index c9195fb4730f..60911f8a63ca 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -34,25 +34,25 @@ namespace jfw_plugin
the string contains an a umlaut then it must be expressed
by "\xXX\xXX"
  */
-BEGIN_VENDOR_MAP()
+VendorSupportMapEntry const gVendorMap[] ={
 // For macOS, don't bother with implementations that aren't relevant (or have 
never existed)
 #ifdef MACOSX
-VENDOR_MAP_ENTRY("Apple Inc.", OtherInfo)
-VENDOR_MAP_ENTRY("Apple Computer, Inc.", OtherInfo)
+VENDOR_MAP_ENTRY("Apple Inc."),
+VENDOR_MAP_ENTRY("Apple Computer, Inc."),
 #endif
-VENDOR_MAP_ENTRY("Sun Microsystems Inc.", SunInfo)
-VENDOR_MAP_ENTRY("Oracle Corporation", SunInfo)
-VENDOR_MAP_ENTRY("AdoptOpenJdk", SunInfo)
-VENDOR_MAP_ENTRY("Amazon.com Inc.", SunInfo)
+VENDOR_MAP_ENTRY("Sun Microsystems Inc."),
+VENDOR_MAP_ENTRY("Oracle Corporation"),
+VENDOR_MAP_ENTRY("AdoptOpenJdk"),
+VENDOR_MAP_ENTRY("Amazon.com Inc."),
 #ifndef MACOSX
-VENDOR_MAP_ENTRY("IBM Corporation", OtherInfo)
-VENDOR_MAP_ENTRY("Blackdown Java-Linux Team", OtherInfo)
-VENDOR_MAP_ENTRY("BEA Systems, Inc.", OtherInfo)
-VENDOR_MAP_ENTRY("Free Software Foundation, Inc.", GnuInfo)
-VENDOR_MAP_ENTRY("The FreeBSD Foundation", OtherInfo)
+VENDOR_MAP_ENTRY("IBM Corporation"),
+VENDOR_MAP_ENTRY("Blackdown Java-Linux Team"),
+VENDOR_MAP_ENTRY("BEA Systems, Inc."),
+VENDOR_MAP_ENTRY("Free Software Foundation, Inc."),
+VENDOR_MAP_ENTRY("The FreeBSD Foundation"),
 #endif
-VENDOR_MAP_ENTRY("Azul Systems, Inc.", OtherInfo)
-END_VENDOR_MAP()
+VENDOR_MAP_ENTRY("Azul Systems, Inc."),
+{nullptr, nullptr, nullptr} };
 
 
 bool isVendorSupported(const OUString& sVendor)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
index b6b1f3113545..10e3cec10518 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
@@ -37,14 +37,9 @@ struct VendorSupportMapEntry
 
 extern VendorSupportMapEntry const gVendorMap[];
 
-#define BEGIN_VENDOR_MAP() \
-VendorSupportMapEntry const gVendorMap[] ={
-
-#define VENDOR_MAP_ENTRY(x,y) \
-{x, & y::getJavaExePaths, & y::createInstance},
-
-#define END_VENDOR_MAP() \
-{nullptr, nullptr, nullptr} };
+template constexpr VendorSupportMapEntry VENDOR_MAP_ENTRY(char 
const * x) {
+return {x, & y::getJavaExePaths, & y::createInstance};
+}
 
 /* Examines if the vendor supplied in parameter sVendor is part of the
list of supported vendors. That is the arry of VendorSupportMapEntry
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2019-01-22 Thread Libreoffice Gerrit user
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 58f30cf1fe401452c0297703fe08a9aa14bd55f3
Author: Stephan Bergmann 
AuthorDate: Tue Jan 22 08:12:50 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 22 09:05:43 2019 +0100

Silence bogus -Werror=clobbered (GCC 7 --enable-optimized)

> In file included from gcc/include/c++/7.1.1/vector:69:0,
>  from 
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx:39:
> gcc/include/c++/7.1.1/bits/vector.tcc: In function ‘javaPluginError 
jfw_plugin_startJavaVirtualMachine(const JavaInfo*, const JavaVMOption*, 
sal_Int32, JavaVM**, JNIEnv**)’:
> gcc/include/c++/7.1.1/bits/vector.tcc:407:15: error: variable 
‘__new_finish’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
>pointer __new_finish(__new_start);
>^~~~

Change-Id: Iefabac65871ed79bcfa333f0193fcbbd1369f7f1
Reviewed-on: https://gerrit.libreoffice.org/66714
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index c6f8eeb6a5c8..f1b0ee485480 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -849,7 +849,14 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #endif
 
return errorcode;
+#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wclobbered"
+#endif
 }
+#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__
+#pragma GCC diagnostic pop
+#endif
 
 javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, bool *exist)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2018-03-27 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ec18927455416e34e5d1b315a698db09fc24c9d0
Author: Stephan Bergmann 
Date:   Tue Mar 27 17:38:22 2018 +0200

Improve error reporting

Change-Id: Ic990e00d14b083f35b44915de3b048a683f269f4
Reviewed-on: https://gerrit.libreoffice.org/51962
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 671ce5634f82..d02a43edacbc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -822,7 +822,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 if( err < 0)
 {
 fprintf(stderr,"[Java framework] sunjavaplugin" SAL_DLLEXTENSION
-"Can not create Java Virtual Machine\n");
+"Can not create Java Virtual Machine, %" SAL_PRIdINT32 
"\n", sal_Int32(err));
 errorcode = javaPluginError::VmCreationFailed;
 }
 else if( err > 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2018-02-01 Thread Mike Kaganski
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |6 --
 jvmfwk/source/fwkutil.cxx  |6 --
 2 files changed, 12 deletions(-)

New commits:
commit 94a5665ef3c0fa594048dd425772c4be29d9d7da
Author: Mike Kaganski 
Date:   Wed Jan 31 16:16:37 2018 +0300

jvmfwk: MSVC: pragma warning: make more specific, remove obsolete

Change-Id: Ibb69ba9c994e44c162318e40c4469c311309f326
Reviewed-on: https://gerrit.libreoffice.org/48996
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index fd6680ae07e1..fb6ec2ba6eb4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -39,16 +39,10 @@
 #include 
 
 #if defined(_WIN32)
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
 #if !defined WIN32_LEAN_AND_MEAN
 # define WIN32_LEAN_AND_MEAN
 #endif
 #include 
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
 #endif
 #include 
 
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index 3d0a2ac22804..e8c13021ce48 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -19,16 +19,10 @@
 
 
 #if defined(_WIN32)
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
 #if !defined WIN32_LEAN_AND_MEAN
 # define WIN32_LEAN_AND_MEAN
 #endif
 #include 
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
 #endif
 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2017-10-12 Thread Julien Nabet
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx|   50 +---
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   40 ++--
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx  |   33 +
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx|   37 ++
 jvmfwk/source/elements.cxx  |   15 ++
 jvmfwk/source/framework.cxx |   26 +++---
 6 files changed, 84 insertions(+), 117 deletions(-)

New commits:
commit 2ea531c0578bb7f0a34ec7de0aaea595e0387928
Author: Julien Nabet 
Date:   Thu Oct 12 20:32:17 2017 +0200

Use loop ranges in jvmfwk

to simplify and avoid all the typedefs

Change-Id: Ia14337dd71b55fc24f162b5436af76aeeb8d2575
Reviewed-on: https://gerrit.libreoffice.org/43346
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index 4485828a8926..22285bb0c18c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -97,7 +97,6 @@ bool GnuInfo::initialize(vector > 
props)
 //javax.accessibility.assistive_technologies from system properties
 
 OUString sJavaLibraryPath;
-typedef vector >::const_iterator it_prop;
 OUString const sVendorProperty("java.vendor");
 OUString const sVersionProperty("java.version");
 OUString const sJavaHomeProperty("java.home");
@@ -112,28 +111,27 @@ bool GnuInfo::initialize(vector 
> props)
 bool bJavaLibraryPath = false;
 bool bAccess = false;
 
-typedef vector >::const_iterator it_prop;
-for (it_prop i = props.begin(); i != props.end(); ++i)
+for (auto const& prop : props)
 {
-if(! bVendor && sVendorProperty == i->first)
+if(! bVendor && sVendorProperty == prop.first)
 {
-m_sVendor = i->second;
+m_sVendor = prop.second;
 bVendor = true;
 }
-else if (!bVersion && sVersionProperty == i->first)
+else if (!bVersion && sVersionProperty == prop.first)
 {
-m_sVersion = i->second;
+m_sVersion = prop.second;
 bVersion = true;
 }
-else if (!bHome && sGNUHomeProperty == i->first)
+else if (!bHome && sGNUHomeProperty == prop.first)
 {
-m_sHome = i->second;
+m_sHome = prop.second;
 bHome = true;
 }
-else if (!bJavaHome && sJavaHomeProperty == i->first)
+else if (!bJavaHome && sJavaHomeProperty == prop.first)
 {
OUString fileURL;
-   if (osl_getFileURLFromSystemPath(i->second.pData,& fileURL.pData) ==
+   if (osl_getFileURLFromSystemPath(prop.second.pData,& fileURL.pData) 
==
osl_File_E_None)
{
//make sure that the drive letter have all the same case
@@ -146,15 +144,15 @@ bool GnuInfo::initialize(vector 
> props)
}
}
 }
-else if (!bJavaLibraryPath && sJavaLibraryPathProperty == i->first)
+else if (!bJavaLibraryPath && sJavaLibraryPathProperty == prop.first)
 {
 sal_Int32 nIndex = 0;
-osl_getFileURLFromSystemPath(i->second.getToken(0, ':', 
nIndex).pData, &sJavaLibraryPath.pData);
+osl_getFileURLFromSystemPath(prop.second.getToken(0, ':', 
nIndex).pData, &sJavaLibraryPath.pData);
 bJavaLibraryPath = true;
 }
-else if (!bAccess && sAccessProperty == i->first)
+else if (!bAccess && sAccessProperty == prop.first)
 {
-if (!i->second.isEmpty())
+if (!prop.second.isEmpty())
 {
 m_bAccessibility = true;
 bAccess = true;
@@ -179,11 +177,10 @@ bool GnuInfo::initialize(vector 
> props)
 vector libpaths = getVectorFromCharArray(arRtPaths, size);
 
 bool bRt = false;
-typedef vector::const_iterator i_path;
-for(i_path ip = libpaths.begin(); ip != libpaths.end(); ++ip)
+for (auto const& libpath : libpaths)
 {
 //Construct an absolute path to the possible runtime
-OUString usRt= m_sHome + *ip;
+OUString usRt= m_sHome + libpath;
 DirectoryItem item;
 if(DirectoryItem::get(usRt, item) == File::E_None)
 {
@@ -197,10 +194,10 @@ bool GnuInfo::initialize(vector 
> props)
 if (!bRt)
 {
 m_sHome = m_sJavaHome;
-for(i_path ip = libpaths.begin(); ip != libpaths.end(); ++ip)
+for (auto const& libpath : libpaths)
 {
 //Construct an absolute path to the possible runtime
-OUString usRt= m_sHome + *ip;
+OUString usRt= m_sHome + libpath;
 DirectoryItem item;
 if(DirectoryItem::get(usRt, item) == File::E_None)
 {
@@ -216,10 +213,10 @@ bool GnuInfo::initialize(vector 
> props)
 

[Libreoffice-commits] core.git: jvmfwk/plugins

2017-08-28 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cda4cea7cdfc9a8de814b901b3b957f029d36aaf
Author: Stephan Bergmann 
Date:   Mon Aug 28 18:18:12 2017 +0200

tdf#100501: Fix thinko

...in previous 52ffad9bb7be800790de6d918154dbeade88cadd "tdf#100501: Adapt 
to
Java 9 (at least on Linux x86-64)"

Change-Id: I4d6bc31e0a7051a2657bb3d1ffc20c7a03d69038

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 23c5983dcbc4..f5b60e6702d4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -97,7 +97,7 @@ bool SunVersion::init(const char *szVersion)
 pCur + 1 != pEnd
 || rtl::isAsciiDigit(static_cast(*pCur))) )
 {
-bool afterMaint = pCur != pEnd && (*pCur == '_' || *pCur == '-');
+bool afterMaint = pCur == pEnd || *pCur == '_' || *pCur == '-';
 
 int len = pCur - pLast;
 if (len >= 127)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2017-08-28 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx |3 ++-
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |7 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 52ffad9bb7be800790de6d918154dbeade88cadd
Author: Stephan Bergmann 
Date:   Mon Aug 28 15:35:43 2017 +0200

tdf#100501: Adapt to Java 9 (at least on Linux x86-64)

Checking with both jdk-9+181_linux-x64_bin.tar.gz and
jre-9+181_linux-x64_bin.tar.gz as currently available at
 "JDK 9 Early-Access Builds":

For one, make SunVersion::init understand 
"JEP 223: New Version-String Scheme" at least insofar as to accept strings 
like
"9" with less than three dot-separated segments (where the missing segments 
are
treated like "0").

For another, at least for Linux x86-64, libjvm.so is now apparently located 
in a
path without an "amd64" architecture segment, "lib/server/libjvm.so".  (But
could that also be "client"?)  Other platforms may need further adjustments.

Change-Id: Idcebc833472c81a1dc74dcdd481b0a37274a8713

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 7f7c4943c8be..7543f497eb83 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -68,7 +68,8 @@ char const* const* SunInfo::getRuntimePaths(int * size)
 "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so",
 "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so",
 "/lib/" JFW_PLUGIN_ARCH "/classic/libjvm.so",
-"/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so"
+"/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so",
+"/lib/server/libjvm.so"
 #endif
 };
 *size = SAL_N_ELEMENTS(ar);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 9646ba3a6f87..23c5983dcbc4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -88,7 +88,7 @@ bool SunVersion::init(const char *szVersion)
 ! (nPartPos == 0) // prevents: ".4.1", "..1", part must start with 
digit
 && (
 //separators after maintenance (1.4.1_01, 1.4.1-beta, or 1.4.1)
-((pCur == pEnd || *pCur == '_' || *pCur == '-') && (nPart == 2 
))
+(pCur == pEnd || *pCur == '_' || *pCur == '-')
 ||
 //separators between major-minor and minor-maintenance
 (nPart < 2 && *pCur == '.') )
@@ -97,6 +97,8 @@ bool SunVersion::init(const char *szVersion)
 pCur + 1 != pEnd
 || rtl::isAsciiDigit(static_cast(*pCur))) )
 {
+bool afterMaint = pCur != pEnd && (*pCur == '_' || *pCur == '-');
+
 int len = pCur - pLast;
 if (len >= 127)
 return false;
@@ -107,6 +109,9 @@ bool SunVersion::init(const char *szVersion)
 pLast = pCur;
 
 m_arVersionParts[nPart] = atoi(buf);
+
+if (afterMaint)
+nPart = 2;
 nPart ++;
 nPartPos = 0;
 if (nPart == 3)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2017-05-19 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 89e9f804ca480f53a5a53ead8d60e32146dcfa41
Author: Stephan Bergmann 
Date:   Sat May 20 00:00:49 2017 +0200

loplugin:stringcopy (macOS)

Change-Id: I855db37cdcd17920cf02d804e5cfa38d316ba236

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 0bd412408b3b..c95849e77ac2 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -631,8 +631,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 if ( ! isVendorSupported(pInfo->sVendor))
 return javaPluginError::WrongVendor;
 #ifdef MACOSX
-rtl::Reference aVendorInfo = getJREInfoByPath( OUString( 
pInfo->sLocation ) );
-if ( !aVendorInfo.is() || aVendorInfo->compareVersions( OUString( 
pInfo->sVersion ) ) < 0 )
+rtl::Reference aVendorInfo = getJREInfoByPath( 
pInfo->sLocation );
+if ( !aVendorInfo.is() || aVendorInfo->compareVersions( pInfo->sVersion ) 
< 0 )
 return javaPluginError::VmCreationFailed;
 #endif
 OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2017-04-21 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   71 ++--
 1 file changed, 38 insertions(+), 33 deletions(-)

New commits:
commit 74b193e86b7bd7e3fabac94041a8d0b08280cc15
Author: Stephan Bergmann 
Date:   Fri Apr 21 19:33:31 2017 +0200

Clean up do_msvcr_magic

Change-Id: I932d903d04b03d3a437db3d3c549c21a1a330965

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index a725b2cec55d..0bd412408b3b 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -468,64 +468,67 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 // think it should be, do nothing, and just let the implicit loading
 // that happens when loading the JVM take care of it.
 
-static void load_msvcr(LPCWSTR jvm_dll, wchar_t const* msvcr)
+static void load_msvcr(OUString const & jvm_dll, OUStringLiteral msvcr)
 {
-wchar_t msvcr_dll[MAX_PATH];
-wchar_t *slash;
-
-if (wcslen(jvm_dll) > MAX_PATH - 15)
-return;
-
-wcscpy(msvcr_dll, jvm_dll);
-
 // First check if msvcr71.dll is in the same folder as jvm.dll. It
 // normally isn't, at least up to 1.6.0_22, but who knows if it
 // might be in the future.
-slash = wcsrchr(msvcr_dll, L'\\');
+sal_Int32 slash = jvm_dll.lastIndexOf('\\');
 
-if (!slash)
+if (slash == -1)
 {
 // Huh, weird path to jvm.dll. Oh well.
+SAL_WARN("jfw", "JVM pathname <" + jvm_dll + "> w/o backslash");
 return;
 }
 
-wcscpy(slash+1, msvcr);
-if (LoadLibraryW(msvcr_dll))
+if (LoadLibraryW(
+reinterpret_cast(
+OUString(jvm_dll.copy(0, slash+1) + msvcr).getStr(
 return;
 
 // Then check if msvcr71.dll is in the parent folder of where
 // jvm.dll is. That is currently (1.6.0_22) as far as I know the
 // normal case.
-*slash = 0;
-slash = wcsrchr(msvcr_dll, L'\\');
+slash = jvm_dll.lastIndexOf('\\', slash);
 
-if (!slash)
+if (slash == -1)
 return;
 
-wcscpy(slash+1, msvcr);
-LoadLibraryW(msvcr_dll);
+LoadLibraryW(
+reinterpret_cast(
+OUString(jvm_dll.copy(0, slash+1) + msvcr).getStr()));
 }
 
 // Check if the jvm DLL imports msvcr71.dll, and in that case try
 // loading it explicitly. In case something goes wrong, do nothing,
 // and just let the implicit loading try to take care of it.
-static void do_msvcr_magic(rtl_uString *jvm_dll)
+static void do_msvcr_magic(OUString const &jvm_dll)
 {
-rtl_uString* Module(nullptr);
 struct stat st;
 
-oslFileError nError = osl_getSystemPathFromFileURL(jvm_dll, &Module);
+OUString Module;
+osl::FileBase::RC nError = osl::FileBase::getSystemPathFromFileURL(
+jvm_dll, Module);
 
-if ( osl_File_E_None != nError )
-rtl_uString_assign(&Module, jvm_dll);
+if ( osl::FileBase::E_None != nError )
+{
+SAL_WARN(
+"jfw", "getSystemPathFromFileURL(" << jvm_dll << "): " << +nError);
+return;
+}
 
-FILE *f = _wfopen(reinterpret_cast(Module->buffer), L"rb");
+FILE *f = _wfopen(reinterpret_cast(Module.getStr()), L"rb");
 
 if (!f)
+{
+SAL_WARN("jfw", "_wfopen(" << Module << ") failed");
 return;
+}
 
 if (fstat(fileno(f), &st) == -1)
 {
+SAL_WARN("jfw", "fstat(" << Module << ") failed");
 fclose(f);
 return;
 }
@@ -537,6 +540,7 @@ static void do_msvcr_magic(rtl_uString *jvm_dll)
 dos_hdr->e_lfanew < 0 ||
 dos_hdr->e_lfanew > (LONG) (st.st_size - sizeof(IMAGE_NT_HEADERS)))
 {
+SAL_WARN("jfw", "analyzing <" << Module << "> failed");
 free(dos_hdr);
 fclose(f);
 return;
@@ -564,6 +568,7 @@ static void do_msvcr_magic(rtl_uString *jvm_dll)
 }
 if (-1 == VAtoPhys) // not found?
 {
+SAL_WARN("jfw", "analyzing <" << Module << "> failed");
 free(dos_hdr);
 return;
 }
@@ -574,20 +579,20 @@ static void do_msvcr_magic(rtl_uString *jvm_dll)
imports->Name != 0 &&
imports->Name + VAtoPhys < (DWORD) st.st_size)
 {
-static struct { char const * name; wchar_t const * wname; } msvcrts[] =
+static OUStringLiteral msvcrts[] =
 {
-{ "msvcr71.dll" , L"msvcr71.dll"  },
-{ "msvcr100.dll", L"msvcr100.dll" },
+"msvcr71.dll",
+"msvcr100.dll"
 };
 char const* importName = reinterpret_cast(dos_hdr) + 
imports->Name + VAtoPhys;
+sal_Int32 importNameLen = rtl_str_getLength(importName);
 for (size_t i = 0; i < SAL_N_ELEMENTS(msvcrts); ++i)
 {
-if (0 == strnicmp(importName,
-// Intentional strlen() + 1 here to include terminating zero
-msvcrts[i].name, strlen(msvcrts[i].name) + 1))
+if (0 == rtl_str_compareIgnoreAsciiCase_With

[Libreoffice-commits] core.git: jvmfwk/plugins

2017-04-12 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e2ba48e50d30a4cbcf7a9b0208baaa395114f6e8
Author: Stephan Bergmann 
Date:   Wed Apr 12 09:24:35 2017 +0200

Silence -Werror=unused-parameter on Android

Change-Id: I69cd0724c2c4a6f82f89080b0622e734617c5704

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index d237de95451a..9f3822a3772c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -867,6 +867,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #else
 (void) arOptions;
 (void) cOptions;
+(void) ppEnv;
 // On Android we always have a Java VM as we only expect this code
 // to be run in an Android app anyway.
 *ppVm = lo_get_javavm();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2017-03-22 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 25ecb6f627852bc23ec8395ef24d8e90467d5758
Author: Stephan Bergmann 
Date:   Wed Mar 22 21:40:55 2017 +0100

Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)

Change-Id: I18f9a2ad4506edc76b74dde229f2fd296bffed88

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index b4ad7019d449..290faed43ab6 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -23,6 +23,7 @@
 #include "osl/thread.h"
 #include "osl/process.h"
 #include "osl/security.hxx"
+#include 
 #include 
 #include 
 #include "diagnostics.h"
@@ -77,7 +78,7 @@ bool SunVersion::init(const char *szVersion)
 //char must me a number 0 - 999 and no leading
 while (true)
 {
-if (pCur < pEnd && isdigit(*pCur))
+if (pCur < pEnd && rtl::isAsciiDigit(static_cast(*pCur)))
 {
 if (pCur < pEnd)
 pCur ++;
@@ -94,7 +95,8 @@ bool SunVersion::init(const char *szVersion)
 (nPart < 2 && *pCur == '.') )
 && (
 //prevent 1.4.0. 1.4.0-
-pCur + 1 != pEnd || isdigit(*(pCur))) )
+pCur + 1 != pEnd
+|| rtl::isAsciiDigit(static_cast(*pCur))) )
 {
 int len = pCur - pLast;
 if (len >= 127)
@@ -113,7 +115,9 @@ bool SunVersion::init(const char *szVersion)
 
 //check next character
 if (! ( (pCur < pEnd)
-&& ( (nPart < 3) && isdigit(*pCur
+&& ( (nPart < 3)
+ && rtl::isAsciiDigit(
+ static_cast(*pCur)
 return false;
 }
 else
@@ -133,7 +137,7 @@ bool SunVersion::init(const char *szVersion)
 {
 if (pCur <= pEnd)
 {
-if ( ! isdigit(*pCur))
+if ( ! rtl::isAsciiDigit(static_cast(*pCur)))
 {
 //1.8.0_102-, 1.8.0_01a,
 size_t len = pCur - pLast;
@@ -184,7 +188,8 @@ bool SunVersion::init(const char *szVersion)
   if (m_preRelease == Rel_FreeBSD)
   {
   pCur++; //eliminate 'p'
-  if (pCur < pEnd && isdigit(*pCur))
+  if (pCur < pEnd
+  && rtl::isAsciiDigit(static_cast(*pCur)))
   pCur ++;
   int len = pCur - pLast -1; //eliminate 'p'
   if (len >= 127)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2017-03-13 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |   16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 849c82495e838afb09c3c0d63fa506a7f3e2a82c
Author: Stephan Bergmann 
Date:   Mon Mar 13 17:43:38 2017 +0100

Unnecessary OUString instances

Change-Id: I81a59c7847e2109198a35cbdb49f5bcf3505c4ba

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index ef9da17..cb8063e 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -59,11 +59,6 @@ bool VendorBase::initialize(vector 
> props)
 //javax.accessibility.assistive_technologies from system properties
 
 typedef vector >::const_iterator it_prop;
-OUString sVendorProperty("java.vendor");
-OUString sVersionProperty("java.version");
-OUString sHomeProperty("java.home");
-OUString sArchProperty("os.arch");
-OUString sAccessProperty("javax.accessibility.assistive_technologies");
 
 bool bVersion = false;
 bool bVendor = false;
@@ -74,17 +69,17 @@ bool VendorBase::initialize(vector 
> props)
 typedef vector >::const_iterator it_prop;
 for (it_prop i = props.begin(); i != props.end(); ++i)
 {
-if(! bVendor && sVendorProperty.equals(i->first))
+if(! bVendor && i->first == "java.vendor")
 {
 m_sVendor = i->second;
 bVendor = true;
 }
-else if (!bVersion && sVersionProperty.equals(i->first))
+else if (!bVersion && i->first == "java.version")
 {
 m_sVersion = i->second;
 bVersion = true;
 }
-else if (!bHome && sHomeProperty.equals(i->first))
+else if (!bHome && i->first == "java.home")
 {
 #ifndef JVM_ONE_PATH_CHECK
OUString fileURL;
@@ -105,12 +100,13 @@ bool VendorBase::initialize(vector > props)
bHome = true;
 #endif
 }
-else if (!bArch && sArchProperty.equals(i->first))
+else if (!bArch && i->first == "os.arch")
 {
 m_sArch = i->second;
 bArch = true;
 }
-else if (!bAccess && sAccessProperty.equals(i->first))
+else if (!bAccess
+ && i->first == "javax.accessibility.assistive_technologies")
 {
 if (!i->second.isEmpty())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2017-03-09 Thread Samuel Mehrbrodt
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 89bfaa58e5b6421ee272f77e8d542eb2344e3fa5
Author: Samuel Mehrbrodt 
Date:   Thu Mar 9 15:41:52 2017 +0100

jvmfwk: Improve logging output

Change-Id: I476fc3190902e44bedfd2e713bd1a7cfb0733688
Reviewed-on: https://gerrit.libreoffice.org/35024
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 5694256..3c31e60 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -499,6 +499,7 @@ bool getJavaProps(const OUString & exePath,
 
 //Use this thread to read output stream
 FileHandleReader::Result rs = FileHandleReader::RESULT_OK;
+JFW_TRACE2("Properties found:");
 while (true)
 {
 OString aLine;
@@ -508,7 +509,7 @@ bool getJavaProps(const OUString & exePath,
 OUString sLine;
 if (!decodeOutput(aLine, &sLine))
 continue;
-JFW_TRACE2(" \"" << sLine << " \"");
+JFW_TRACE2("  \"" << sLine << "\"");
 sLine = sLine.trim();
 if (sLine.isEmpty())
 continue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins librelogo/source lingucomponent/source linguistic/source lotuswordpro/source mysqlc/source odk/examples offapi/com offapi/org offapi/type_reference oox/s

2017-03-02 Thread Andrea Gelmini
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx|
2 +-
 librelogo/source/LibreLogo/LibreLogo.py   |
2 +-
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx   |
2 +-
 linguistic/source/gciterator.hxx  |
2 +-
 lotuswordpro/source/filter/lwpbackgroundstuff.cxx |
2 +-
 lotuswordpro/source/filter/lwppara.cxx|
2 +-
 lotuswordpro/source/filter/xfilter/xfofficemeta.cxx   |
2 +-
 lotuswordpro/source/filter/xfilter/xfutil.hxx |
2 +-
 mysqlc/source/mysqlc_connection.cxx   |
2 +-
 mysqlc/source/mysqlc_driver.cxx   |
2 +-
 odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java|
2 +-
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx  |
2 +-
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx  |
2 +-
 odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java|   
10 +-
 odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java |
2 +-
 odk/examples/java/MinimalComponent/MinimalComponent.java  |
2 +-
 offapi/com/sun/star/ui/XSidebar.idl   |
2 +-
 offapi/org/freedesktop/PackageKit/XQuery.idl  |
2 +-
 offapi/type_reference/typelibrary_history.txt |
2 +-
 oox/source/drawingml/customshapepresetdata.cxx|   
10 +-
 20 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit 5bea199bae9986d7276a9b2379a577c6cea552ed
Author: Andrea Gelmini 
Date:   Thu Mar 2 12:24:24 2017 +0100

Fix typos

Change-Id: Ic6c41fbcc36c11a7528cde0986593a39c2d6738b
Reviewed-on: https://gerrit.libreoffice.org/34803
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 01169a7..0f5e126 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1297,7 +1297,7 @@ void addJavaInfosDirScan(
 {
 //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
+//look for certain java directories, such as jre, jdk, 
etc. We do not want
 //to examine the whole directory because of performance 
reasons.
 DirectoryItem item2;
 if(DirectoryItem::get(usDir2, item2) == File::E_None)
diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index f51202c..287404d 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -1728,7 +1728,7 @@ def __compil__(s):
 
 if len(subnames) > 0:
 globs = "global %s" % ", ".join(subnames)
-# search user functions (function calls with two or more arguments 
need explicite Python parentheses)
+# search user functions (function calls with two or more arguments 
need explicit Python parentheses)
 ends = __l12n__(_.lng)["END"] # support multiple names of "END"
 firstend = ends.split("|")[0]
 s = re.sub(r"(? > 
SAL_CALL Thesaurus::queryM
 {
 if (rLocale == aTLocs[i])
 {
-// open up and intialize this thesaurus if need be
+// open up and initialize this thesaurus if need be
 if (!aThes[i])
 {
 OUString datpath = aTNames[i] + ".dat";
diff --git a/linguistic/source/gciterator.hxx b/linguistic/source/gciterator.hxx
index a4d6fc1..0d7a185 100644
--- a/linguistic/source/gciterator.hxx
+++ b/linguistic/source/gciterator.hxx
@@ -109,7 +109,7 @@ class GrammarCheckingIterator:
 osl::Condition  m_aWakeUpThread;
 oslThread   m_thread;
 
-//! beware of initilization order !
+//! beware of initialization order!
 struct MyMutex : public rtl::Static< osl::Mutex, MyMutex > {};
 comphelper::OInterfaceContainerHelper2 m_aEventListeners;
 comphelper::OInterfaceContainerHelper2 m_aNotifyListeners;
diff --git a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx 
b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
index 6193168..bd2500f 100644
--- a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
+++ b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
@@ -56,7 +56,7 @@
 /**
  * @file
  * For LWP filter architecture prototype
- *  Implemention of class LwpBackgroundStuff.
+ *  Implementation of class LwpBackgroundStuff.
  */
 
 #include "lwpbackgroundstuff.hx

[Libreoffice-commits] core.git: jvmfwk/plugins

2017-02-24 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit f21994e7a240563283b7a17dcb435ce7c5156b60
Author: Stephan Bergmann 
Date:   Fri Feb 24 17:00:28 2017 +0100

Make JVM -Xrunjdwp option work on macOS

I hope loading the jvm library as SAL_LOADMODULE_GLOBAL has no negative
consequences (at least, there is prior art in the LINUX case already).

Change-Id: If18b65bd96f7205fdf9fd41389e64e786c15af16

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 5053fda..63791bc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -670,6 +670,16 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 osl::Module moduleRt;
 #if defined(LINUX)
 if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_GLOBAL | 
SAL_LOADMODULE_NOW))
+#elif defined MACOSX
+// Must be SAL_LOADMODULE_GLOBAL when e.g. specifying a
+// -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 option to
+// JDK 1.8.0_121 at least, as JNI_CreateJavaVM -> Threads::create_vm ->
+// JvmtiExport::post_vm_initialized -> cbEarlyVMInit -> initialize ->
+// util_initialize -> sun.misc.VMSupport.getAgentProperties ->
+// Java_sun_misc_VMSupport_initAgentProperties ->
+// JDK_FindJvmEntry("JVM_INitAgentProperties") ->
+// dlsym(RTLD_DEFAULT, "JVM_INitAgentProperties"):
+if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_GLOBAL))
 #else
 #if defined(_WIN32)
 do_msvcr_magic(sRuntimeLib.pData);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2016-07-22 Thread Caolán McNamara
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 64d3270a89fd88d4d0cf70329af2c66f722fd95e
Author: Caolán McNamara 
Date:   Fri Jul 22 08:22:47 2016 +0100

Related: tdf#101057 allow java update version number > 99

Change-Id: Icc37cf248fbf35f108eb5bbb25c36fbd54a9fe85

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 4787440..b4ad701 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -135,9 +135,9 @@ bool SunVersion::init(const char *szVersion)
 {
 if ( ! isdigit(*pCur))
 {
-//1.4.1_01-, 1.4.1_01a, the numerical part may only be 2 
chars.
-int len = pCur - pLast;
-if (len > 2)
+//1.8.0_102-, 1.8.0_01a,
+size_t len = pCur - pLast;
+if (len > sizeof(buf) - 1)
 return false;
 //we've got the update: 01, 02 etc
 strncpy(buf, pLast, len);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2016-06-15 Thread Markus Mohrhard
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b5876bfcb69a65c87d602bae687b3c0634c0a1e7
Author: Markus Mohrhard 
Date:   Wed Jun 15 20:15:20 2016 +0200

passing a NULL pointer to fileno is not allowed

See crash reports at
http://crashreport.libreoffice.org/stats/signature/do_msvcr_magic+0x7
and documentation at
https://msdn.microsoft.com/en-us/library/zs6wbdhx.aspx

Change-Id: Ia9166d3b9fa10b87585821504e39cdfecbd22eda
Reviewed-on: https://gerrit.libreoffice.org/26317
Reviewed-by: Michael Stahl 
Tested-by: Markus Mohrhard 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index fad3c0a9..43ddc82 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -548,6 +548,9 @@ static void do_msvcr_magic(rtl_uString *jvm_dll)
 
 FILE *f = _wfopen(reinterpret_cast(Module->buffer), L"rb");
 
+if (!f)
+return;
+
 if (fstat(fileno(f), &st) == -1)
 {
 fclose(f);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2016-01-06 Thread Douglas Mencken
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |   19 ---
 1 file changed, 4 insertions(+), 15 deletions(-)

New commits:
commit b3afc03bcce7156f7ec5ee662776aee54eb0761f
Author: Douglas Mencken 
Date:   Tue Jan 5 10:35:11 2016 -0500

jvmfwk/plugins: clean-up in util.cxx

These are some remnants from the-good-old-days of Mac OS X 10.4 support
and 2005's commit b8871d23ea14d72ba1a22376e7812ea5840d1084

Change-Id: I9a14aaac94e4a6e4961a2fa9a5020d9cf3a07c9d
Reviewed-on: https://gerrit.libreoffice.org/21124
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f16f96f..0e63598 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -68,8 +68,7 @@ using ::rtl::Reference;
 #define HKEY_SUN_SDK L"Software\\JavaSoft\\Java Development Kit"
 #endif
 
-#ifdef UNX
-#if !(defined MACOSX && defined X86_64)
+#if defined( UNX ) && !defined( MACOSX )
 namespace {
 char const *g_arJavaNames[] = {
 "",
@@ -78,10 +77,9 @@ char const *g_arJavaNames[] = {
 "j2sdk",
 "jdk",
 "jre",
-"java",
-"Home",
-"IBMJava2-ppc-142"
+"java"
 };
+
 /* These are directory names which could contain multiple java installations.
  */
 char const *g_arCollectDirs[] = {
@@ -101,17 +99,10 @@ char const *g_arCollectDirs[] = {
looked for.
 */
 char const *g_arSearchPaths[] = {
-#ifdef MACOSX
-"",
-"Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin",
-"System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/"
-#else
 #ifndef JVM_ONE_PATH_CHECK
 "",
 "usr/",
 "usr/local/",
-"usr/local/IBMJava2-ppc-142",
-"usr/local/j2sdk1.3.1",
 #ifdef X86_64
 "usr/lib64/",
 #endif
@@ -120,11 +111,9 @@ char const *g_arSearchPaths[] = {
 #else
 JVM_ONE_PATH_CHECK
 #endif
-#endif
 };
 }
-#endif
-#endif //  UNX
+#endif //  UNX && !MACOSX
 
 namespace jfw_plugin
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2015-11-04 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.hxx |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c3b48b26a09e53aac973c3669b9faec6d784665e
Author: Stephan Bergmann 
Date:   Wed Nov 4 13:52:43 2015 +0100

loplugin:passstuffbyref

Change-Id: If6e877b326bb630f1b4631a60241a93a6e6cbaca

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.hxx
index 9a7c7b9..0b1717a 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.hxx
@@ -1,6 +1,6 @@
 #ifndef __UTIL_COCOA_H__
 #define __UTIL_COCOA_H__
 
-bool JvmfwkUtil_isLoadableJVM( OUString aURL );
+bool JvmfwkUtil_isLoadableJVM( OUString const & aURL );
 
 #endif
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm 
b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm
index 47bab8c..d374ae9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm
@@ -8,7 +8,7 @@
 
 using namespace rtl;
 
-bool JvmfwkUtil_isLoadableJVM( OUString aURL )
+bool JvmfwkUtil_isLoadableJVM( OUString const & aURL )
 {
 bool bRet = false;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2015-08-23 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c571bcd775ebcb3ad69099bdc0c326d28c00c78c
Author: Stephan Bergmann 
Date:   Sun Aug 23 21:55:05 2015 +0200

loplugin:defaultparams

Change-Id: I797b986b227381bc066ea3aa305c0abf78cd156a

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 634f65b..90bcd37 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -669,7 +669,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #if defined(WNT)
 do_msvcr_magic(sRuntimeLib.pData);
 #endif
-if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_DEFAULT))
+if (!moduleRt.load(sRuntimeLib))
 #endif
 {
 JFW_ENSURE(false,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2015-07-11 Thread Christian Lohmaier
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1b4d27a3ba2648c3f02cd234ca74c5a40e6b
Author: Christian Lohmaier 
Date:   Sat Jul 11 02:03:01 2015 +0200

tdf#92483 fix initializing JRE on Win 64bit (load java's msvcr100.dll)

problem is that the offsets/sizes are of different type than ptrdiff_t,
and when using without casting, the resulting address is way off...

Change-Id: I7b1cdd611c8c4b317cd33ca8fbbda2e7e8f5f4fc
Reviewed-on: https://gerrit.libreoffice.org/16938
Reviewed-by: David Ostrovsky 
Tested-by: Jenkins 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index a19b26a..c7a273c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -588,7 +588,7 @@ static void do_msvcr_magic(rtl_uString *jvm_dll)
 if (sections->VirtualAddress <= importsVA &&
 importsVA < sections->VirtualAddress + sections->SizeOfRawData)
 {
-VAtoPhys = sections->PointerToRawData - sections->VirtualAddress;
+VAtoPhys = static_cast(sections->PointerToRawData) - 
static_cast(sections->VirtualAddress);
 break;
 }
 ++sections;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2015-05-27 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |3 
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx|7 --
 jvmfwk/source/fwkbase.cxx   |   61 
 jvmfwk/source/fwkutil.hxx   |9 --
 4 files changed, 29 insertions(+), 51 deletions(-)

New commits:
commit f9d2bfec02042c5391cb838786577ad32365a56b
Author: Stephan Bergmann 
Date:   Wed May 27 17:24:02 2015 +0200

fprintf -> SAL_INFO

Change-Id: I4808e89cf5b90c99df3d4c4474c578a8c8f611a6

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 18c7280..4094600 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -28,9 +28,6 @@
 # include 
 #endif
 
-#if OSL_DEBUG_LEVEL > 0
-#include 
-#endif
 #include 
 
 #include "boost/scoped_array.hpp"
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index ee4d6d0..ef81466 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -61,11 +61,8 @@ bool isVendorSupported(const OUString& sVendor)
 if (sVendor.equalsAscii(gVendorMap[pos].sVendorName))
 return true;
 }
-#if OSL_DEBUG_LEVEL >= 2
-OString sVendorName = OUStringToOString(sVendor, 
osl_getThreadTextEncoding());
-fprintf(stderr, "[Java frameworksunjavaplugin.so]sunjavaplugin does not 
support vendor: %s.\n",
-sVendorName.getStr());
-#endif
+SAL_INFO(
+"jfw.level2", "sunjavaplugin does not support vendor: " << sVendor);
 return false;
 }
 
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 9c79344..0a7e414 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -239,11 +239,9 @@ std::vector VendorSettings::getSupportedVendors()
 OString sParam =
 OUStringToOString(sValue, osl_getThreadTextEncoding());
 vecParams.push_back(sParam);
-#if OSL_DEBUG_LEVEL >=2
-OString sParamName = OUStringToOString(sName, 
osl_getThreadTextEncoding());
-fprintf(stderr,"[Java framework] Using bootstrap parameter %s"
-" = %s.\n", sParamName.getStr(), sParam.getStr());
-#endif
+SAL_INFO(
+"jfw.level2",
+"Using bootstrap parameter " << sName << " = " << sParam);
 }
 else
 break;
@@ -270,10 +268,10 @@ OString BootParams::getClasspath()
 sCP))
 {
 sClassPath = OUStringToOString(sCP, osl_getThreadTextEncoding());
-#if OSL_DEBUG_LEVEL >=2
-fprintf(stderr,"[Java framework] Using bootstrap parameter "
-UNO_JAVA_JFW_CLASSPATH " = %s.\n", sClassPath.getStr());
-#endif
+SAL_INFO(
+"jfw.level2",
+"Using bootstrap parameter " UNO_JAVA_JFW_CLASSPATH " = "
+<< sClassPath);
 }
 
 OUString sEnvCP;
@@ -287,10 +285,10 @@ OString BootParams::getClasspath()
 char szSep[] = {SAL_PATHSEPARATOR,0};
 sClassPath += OString(szSep) + OString(pCp);
 }
-#if OSL_DEBUG_LEVEL >=2
-fprintf(stderr,"[Java framework] Using bootstrap parameter "
-UNO_JAVA_JFW_ENV_CLASSPATH " and class path is:\n %s.\n", pCp ? 
pCp : "");
-#endif
+SAL_INFO(
+"jfw.level2",
+"Using bootstrap parameter " UNO_JAVA_JFW_ENV_CLASSPATH
+" and class path is: " << (pCp ? pCp : ""));
 }
 
 return sClassPath;
@@ -326,11 +324,10 @@ OUString BootParams::getVendorSettings()
  UNO_JAVA_JFW_VENDOR_SETTINGS));
 }
 }
-#if OSL_DEBUG_LEVEL >=2
-OString sValue = OUStringToOString(sVendor, osl_getThreadTextEncoding());
-fprintf(stderr,"[Java framework] Using bootstrap parameter "
-UNO_JAVA_JFW_VENDOR_SETTINGS" = %s.\n", sValue.getStr());
-#endif
+SAL_INFO(
+"jfw.level2",
+"Using bootstrap parameter " UNO_JAVA_JFW_VENDOR_SETTINGS " = "
+<< sVendor);
 }
 return sVendor;
 }
@@ -372,10 +369,10 @@ OUString BootParams::getJREHome()
 JFW_E_ERROR,
 OString("[Java framework] Error in function 
BootParams::getJREHome() "
  "(fwkbase.cxx)."));
-#if OSL_DEBUG_LEVEL >=2
-fprintf(stderr,"[Java framework] Using bootstrap parameter "
-UNO_JAVA_JFW_ENV_JREHOME" with JAVA_HOME = %s.\n", pJRE);
-#endif
+SAL_INFO(
+"jfw.level2",
+"Using bootstrap parameter " UNO_JAVA_JFW_ENV_JREHOME
+" with JAVA_HOME = " << pJRE);
 }
 else if (getMode() == JFW_MODE_DIRECT
 && !bEnvJRE
@@ -388,14 +385,9 @@ OUString BootParams::getJREHome()
  " must be set in direct mode."));
 }
 
-#if OSL_DEBUG_LEVEL >=2
-if (bJRE == 

[Libreoffice-commits] core.git: jvmfwk/plugins

2015-01-08 Thread Michael Weghorn
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   24 +---
 1 file changed, 7 insertions(+), 17 deletions(-)

New commits:
commit bb65b09678d4b6da657f6ccc180d8ff5096e3006
Author: Michael Weghorn 
Date:   Mon Dec 15 20:27:00 2014 +0100

avoid copying of vector

Change-Id: I06ce27f4fa52637bbeaa6d84fdecdf81364e15a7
Reviewed-on: https://gerrit.libreoffice.org/13489
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index de1d979..a73a007 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -456,13 +456,13 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 vector> vecInfosFromPath;
 addJavaInfosFromPath(infos, vecInfosFromPath);
 
-vector > vecVerifiedInfos;
+vector vecVerifiedInfos;
 
-// copy JREs that meet version requirements to vecVerifiedInfos
+// copy infos of JREs that meet version requirements to vecVerifiedInfos
 typedef vector >::iterator it;
 for (it i= vecInfosFromPath.begin(); i != vecInfosFromPath.end(); ++i)
 {
-const rtl::Reference& cur = *i;
+const rtl::Reference& currentInfo = *i;
 
 typedef std::vector>::const_iterator 
ci_pl;
 for (ci_pl vendorInfo = vecVendorInfos.begin(); vendorInfo != 
vecVendorInfos.end(); ++vendorInfo)
@@ -470,10 +470,10 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 const OUString& vendor = vendorInfo->first;
 jfw::VersionInfo versionInfo = vendorInfo->second;
 
-if (vendor.equals(cur->getVendor()))
+if (vendor.equals(currentInfo->getVendor()))
 {
 javaPluginError errorcode = checkJavaVersionRequirements(
-cur,
+currentInfo,
 versionInfo.sMinVersion,
 versionInfo.sMaxVersion,
 versionInfo.getExcludeVersions(),
@@ -481,7 +481,7 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 
 if (errorcode == JFW_PLUGIN_E_NONE)
 {
-vecVerifiedInfos.push_back(*i);
+vecVerifiedInfos.push_back(createJavaInfo(currentInfo));
 }
 }
 }
@@ -490,17 +490,7 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 if (vecVerifiedInfos.empty())
 return JFW_PLUGIN_E_NO_JRE;
 
-// Now vecVerifiedInfos contains all those JREs which meet the version 
requirements
-// Transfer them into the vector that is passed out.
-vector infosFromPath;
-
-typedef vector >::const_iterator cit;
-for (cit ii = vecVerifiedInfos.begin(); ii != vecVerifiedInfos.end(); ++ii)
-{
-infosFromPath.push_back(createJavaInfo(*ii));
-}
-
-javaInfosFromPath = infosFromPath;
+javaInfosFromPath = vecVerifiedInfos;
 
 return JFW_PLUGIN_E_NONE;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins vcl/opengl vcl/source

2014-12-18 Thread Julien Nabet
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |6 +++---
 vcl/opengl/program.cxx |2 +-
 vcl/source/opengl/OpenGLContext.cxx|2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 5a4c549d3252ef371656cbb5dedeb8c9c5c60994
Author: Julien Nabet 
Date:   Thu Dec 18 21:13:39 2014 +0100

Some cppcheck cleanings: Prefer prefix ++/-- operators for non-primitive 
types

Change-Id: I899164412ad90653b4228423283f9fbd4cb5fccc

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 2ef2429..eb43be0 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -595,7 +595,7 @@ void addJavaInfoFromWinReg(
 // create impl objects
 typedef std::vector::iterator ItHome;
 for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end();
-it_home++)
+++it_home)
 {
 getAndAddJREInfoByPath(*it_home, allInfos, addedInfos);
 }
@@ -606,7 +606,7 @@ void addJavaInfoFromWinReg(
 {
 typedef std::vector::iterator ItHome;
 for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end();
-it_home++)
+++it_home)
 {
 getAndAddJREInfoByPath(*it_home, allInfos, addedInfos);
 }
@@ -657,7 +657,7 @@ bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
 //iterate over the vector with java home strings
 typedef vector::iterator ItHome;
 for(ItHome itHome= vecJavaHome.begin();
-itHome != vecJavaHome.end(); itHome++)
+itHome != vecJavaHome.end(); ++itHome)
 {
 if(usHomeUrl.equals(*itHome))
 {
diff --git a/vcl/opengl/program.cxx b/vcl/opengl/program.cxx
index 46552fd..434b724 100644
--- a/vcl/opengl/program.cxx
+++ b/vcl/opengl/program.cxx
@@ -57,7 +57,7 @@ bool OpenGLProgram::Clean()
 {
 glActiveTexture( GL_TEXTURE0 + nIndex-- );
 it->Unbind();
-it++;
+++it;
 }
 maTextures.clear();
 }
diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 04e19ba..182a2e9 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1168,7 +1168,7 @@ void OpenGLContext::reset()
 while( it != maPrograms.end() )
 {
 delete it->second;
-it++;
+++it;
 }
 maPrograms.clear();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-12-18 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 39733239d317fbfbfc1c7bfc8cc7bfb8392c6926
Author: Stephan Bergmann 
Date:   Thu Dec 18 15:00:28 2014 +0100

jvmfwk: Use appropriate OUString functions on string constants

Change-Id: I5a16fdd9217f0523212842650d74f504f17848fd

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index d79ed47..2ef2429 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1287,8 +1287,8 @@ void addJavaInfosDirScan(
 }
 
 JFW_ENSURE(errNext == File::E_None || errNext == 
File::E_NOENT,
-OUString("[Java framework] sunjavaplugin: ")
-+ "Error while iterating over contens of "
+"[Java framework] sunjavaplugin: "
+"Error while iterating over contens of "
 + usDir2 + ". Osl file error: "
 + OUString::number(openErr));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-12-16 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 555f024f16d4407be3c9b0dbb15fb18c2f6f3b20
Author: Stephan Bergmann 
Date:   Tue Dec 16 09:38:59 2014 +0100

Related fdo#83753: Fix JVM_ONE_PATH_CHECK feature again

Change-Id: I1dc3b0db6295c43a9d29576b81870b4a293a61aa

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 7b29faf..7ea4d1b 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -817,14 +817,12 @@ vector > addAllJREInfos(
 addJavaInfoFromWinReg(allInfos, addedInfos);
 #endif // WNT
 
-#ifndef JVM_ONE_PATH_CHECK
 if (checkJavaHomeAndPath) {
 addJavaInfoFromJavaHome(allInfos, addedInfos);
 //this function should be called after addJavaInfosDirScan.
 //Otherwise in SDKs Java may be started twice
 addJavaInfosFromPath(allInfos, addedInfos);
 }
-#endif
 
 #ifdef UNX
 addJavaInfosDirScan(allInfos, addedInfos);
@@ -1103,6 +1101,7 @@ void addJavaInfosFromPath(
 std::vector> & allInfos,
 std::vector> & addedInfos)
 {
+#if !defined JVM_ONE_PATH_CHECK
 // Get Java from PATH environment variable
 static const char sCurDir[] = ".";
 static const char sParentDir[] = "..";
@@ -1147,6 +1146,7 @@ void addJavaInfosFromPath(
 }
 while ( nIndex >= 0 );
 }
+#endif
 }
 
 
@@ -1154,6 +1154,7 @@ void addJavaInfoFromJavaHome(
 std::vector> & allInfos,
 std::vector> & addedInfos)
 {
+#if !defined JVM_ONE_PATH_CHECK
 // Get Java from JAVA_HOME environment
 
 // Note that on OS X is it not normal at all to have a JAVA_HOME 
environment
@@ -1170,6 +1171,7 @@ void addJavaInfoFromJavaHome(
 getAndAddJREInfoByPath(sHomeUrl, allInfos, addedInfos);
 }
 }
+#endif
 }
 
 bool makeDriveLetterSame(OUString * fileURL)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins reportbuilder/java scripting/java swext/mediawiki

2014-12-10 Thread Noel Grandin
 jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java   
  |1 -
 
reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
 |1 -
 
scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
|1 -
 swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java  
  |1 -
 4 files changed, 4 deletions(-)

New commits:
commit 7d812b09b5f5959d3a315c514ac59a536bc15e59
Author: Noel Grandin 
Date:   Tue Dec 9 14:32:40 2014 +0200

java: unused imports

Change-Id: I05824a6f19a5f3048a52101b96f6bf3d3099df08
Reviewed-on: https://gerrit.libreoffice.org/13403
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java 
b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
index 65c273b..081a362 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
+++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
@@ -17,7 +17,6 @@
  */
 
 import java.util.*;
-import java.awt.*;
 
 /** This class prints out the system properties.
 
diff --git 
a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
 
b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
index 9f07ace..903726c 100644
--- 
a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
+++ 
b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
@@ -43,7 +43,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 
 import java.awt.Image;
diff --git 
a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
 
b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
index 5e6686b..5a5 100644
--- 
a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
+++ 
b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
@@ -46,7 +46,6 @@ import com.sun.star.uno.Type;
 import com.sun.star.uno.XComponentContext;
 
 import java.util.ArrayList;
-import java.util.Map;
 
 public class ScriptProviderForJava {
 
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java 
b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
index 8abc01b..1e89e5c 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
@@ -41,7 +41,6 @@ import com.sun.star.lib.uno.helper.Factory;
 import com.sun.star.lib.uno.helper.WeakBase;
 import com.sun.star.uno.UnoRuntime;
 import com.sun.star.uno.XComponentContext;
-import com.sun.star.util.XCloseBroadcaster;
 
 
 public final class WikiEditorImpl extends WeakBase
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-11-18 Thread Michael Weghorn
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 7bd4d1e9180e8c380e634bc231286034db151716
Author: Michael Weghorn 
Date:   Tue Nov 18 12:04:36 2014 +

remove duplicate code line

Change-Id: Ia1e9d2b31698db23029e4dd5f0f7659acff5d30f
Reviewed-on: https://gerrit.libreoffice.org/12951
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 9954f8a..e680b4d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -217,7 +217,6 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 OSL_ASSERT(sMinVersion);
 OSL_ASSERT(sMaxVersion);
 OSL_ASSERT(parJavaInfo);
-OSL_ASSERT(parJavaInfo);
 OSL_ASSERT(nLenInfoList);
 if (!sVendor || !sMinVersion || !sMaxVersion || !parJavaInfo || 
!nLenInfoList)
 return JFW_PLUGIN_E_INVALID_ARG;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-10-27 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   40 
 1 file changed, 40 insertions(+)

New commits:
commit f66cbdb948c6c43909a18be10aa838c69338dcb0
Author: Stephan Bergmann 
Date:   Mon Oct 27 18:26:33 2014 +0100

Work around OpenJDK's os::workaround_expand_exec_shield_cs_limit

Change-Id: Iea1b6354764db0a22976b3de49bf3e22ccb7243e

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 8bcca85..2b72408 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -70,6 +70,10 @@
 #endif
 #endif
 
+#if defined LINUX && defined X86
+#include 
+#endif
+
 using namespace osl;
 using namespace std;
 using namespace jfw_plugin;
@@ -676,6 +680,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 // all some directories of the Java installation. This is necessary for
 // all versions below 1.5.1
 options.push_back(Option("abort", reinterpret_cast(abort_handler)));
+bool hasStackSize = false;
 for (int i = 0; i < cOptions; i++)
 {
 OString opt(arOptions[i].optionString);
@@ -692,11 +697,46 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 if (opt == "-Xint") {
 addForceInterpreted = false;
 }
+if (opt.startsWith("-Xss")) {
+hasStackSize = true;
+}
 options.push_back(Option(opt, arOptions[i].extraInfo));
 }
 if (addForceInterpreted) {
 options.push_back(Option("-Xint", nullptr));
 }
+if (!hasStackSize) {
+#if defined LINUX && defined X86
+// At least OpenJDK 1.8.0's os::workaround_expand_exec_shield_cs_limit
+// (hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp) can mmap an rwx
+// page into the area that the main stack can grow down to according to
+// "ulimit -s", as os::init_2's (hotspot/src/os/linux/vm/os_linux.cpp)
+// call to
+//
+//   Linux::capture_initial_stack(JavaThread::stack_size_at_create());
+//
+// caps _initial_thread_stack_size at threadStackSizeInBytes ,i.e.,
+// -Xss, which appears to default to only 327680, whereas "ulimit -s"
+// defaults to 8192 * 1024 at least on Fedora 20; so attempt to pass in
+// a useful -Xss argument:
+rlimit l;
+if (getrlimit(RLIMIT_STACK, &l) == 0) {
+if (l.rlim_cur == RLIM_INFINITY) {
+SAL_INFO("jfw", "RLIMIT_STACK RLIM_INFINITY -> 8192K");
+l.rlim_cur = 8192 * 1024;
+} else if (l.rlim_cur > 512 * 1024 * 1024) {
+SAL_INFO(
+"jfw", "huge RLIMIT_STACK " << l.rlim_cur << " -> 8192K");
+l.rlim_cur = 8192 * 1024;
+}
+options.push_back(
+Option("-Xss" + OString::number(l.rlim_cur), nullptr));
+} else {
+int e = errno;
+SAL_WARN("jfw", "getrlimit(RLIMIT_STACK) failed with errno " << e);
+}
+#endif
+}
 
 boost::scoped_array sarOptions(new 
JavaVMOption[options.size()]);
 for (std::vector::size_type i = 0; i != options.size(); ++i) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-10-27 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   70 +---
 1 file changed, 34 insertions(+), 36 deletions(-)

New commits:
commit 564fe4e36a9fdf313dc1abb86f6c24f61e03f31e
Author: Stephan Bergmann 
Date:   Mon Oct 27 17:59:06 2014 +0100

Clean up JNI_CreateJavaVM option code

Change-Id: I1902c73a72f29e948e479a2ae4776f2dff77b2b5

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 3d4e3f4..8bcca85 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -655,60 +655,58 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 
 // Valgrind typically emits many false errors when executing JIT'ed JVM
 // code, so force the JVM into interpreted mode:
-bool forceInterpreted = FORCE_INTERPRETED > 0;
+bool addForceInterpreted = FORCE_INTERPRETED > 0;
 
 // Some testing with Java 1.4 showed that JavaVMOption.optionString has to
 // be encoded with the system encoding (i.e., osl_getThreadTextEncoding):
 JavaVMInitArgs vm_args;
 
-sal_Int32 nOptions = 1 + cOptions + (forceInterpreted ? 1 : 0);
-//TODO: check for overflow
-boost::scoped_array sarOptions(new JavaVMOption[nOptions]);
-JavaVMOption * options = sarOptions.get();
+struct Option {
+Option(OString const & theOptionString, void * theExtraInfo):
+optionString(theOptionString), extraInfo(theExtraInfo)
+{}
+
+OString optionString;
+void * extraInfo;
+};
+std::vector options;
 
 // We set an abort handler which is called when the VM calls _exit during
 // JNI_CreateJavaVM. This happens when the LD_LIBRARY_PATH does not contain
 // all some directories of the Java installation. This is necessary for
 // all versions below 1.5.1
-int n = 0;
-options[n].optionString= (char *) "abort";
-options[n].extraInfo= reinterpret_cast(abort_handler);
-++n;
-OString sClassPathOption;
+options.push_back(Option("abort", reinterpret_cast(abort_handler)));
 for (int i = 0; i < cOptions; i++)
 {
+OString opt(arOptions[i].optionString);
 #ifdef UNX
-// Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
-// in the class path in order to have applet support.
-OString sClassPath = arOptions[i].optionString;
-if (sClassPath.startsWith("-Djava.class.path="))
+// Until java 1.5 we need to put a plugin.jar or javaplugin.jar 
(<1.4.2)
+// in the class path in order to have applet support:
+if (opt.startsWith("-Djava.class.path="))
 {
 OString sAddPath = getPluginJarPath(pInfo->sVendor, 
pInfo->sLocation,pInfo->sVersion);
 if (!sAddPath.isEmpty())
-sClassPathOption = sClassPath + OString(SAL_PATHSEPARATOR)
-+ sAddPath;
-else
-sClassPathOption = sClassPath;
-options[n].optionString = (char *) sClassPathOption.getStr();
-options[n].extraInfo = arOptions[i].extraInfo;
+opt += OString(SAL_PATHSEPARATOR) + sAddPath;
 }
-else
-{
 #endif
-options[n].optionString = arOptions[i].optionString;
-options[n].extraInfo = arOptions[i].extraInfo;
-#ifdef UNX
+if (opt == "-Xint") {
+addForceInterpreted = false;
 }
-#endif
-#if OSL_DEBUG_LEVEL >= 2
-JFW_TRACE2("VM option: " << options[n].optionString);
-#endif
-++n;
+options.push_back(Option(opt, arOptions[i].extraInfo));
 }
-if (forceInterpreted) {
-options[n].optionString = const_cast("-Xint");
-options[n].extraInfo = 0;
-++n;
+if (addForceInterpreted) {
+options.push_back(Option("-Xint", nullptr));
+}
+
+boost::scoped_array sarOptions(new 
JavaVMOption[options.size()]);
+for (std::vector::size_type i = 0; i != options.size(); ++i) {
+SAL_INFO(
+"jfw",
+"VM option \"" << options[i].optionString << "\" "
+<< options[i].extraInfo);
+sarOptions[i].optionString = const_cast(
+options[i].optionString.getStr());
+sarOptions[i].extraInfo = options[i].extraInfo;
 }
 
 #ifdef MACOSX
@@ -716,8 +714,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #else
 vm_args.version= JNI_VERSION_1_2;
 #endif
-vm_args.options= options;
-vm_args.nOptions= nOptions;
+vm_args.options= sarOptions.get();
+vm_args.nOptions= options.size(); //TODO overflow
 vm_args.ignoreUnrecognized= JNI_TRUE;
 
 /* We set a global flag which is used by the abort handler in order to
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-10-20 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx |   19 ++-
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx |3 ---
 2 files changed, 2 insertions(+), 20 deletions(-)

New commits:
commit 42a05b4b2aa980cc8443813e6ab903034f9f4dbc
Author: Stephan Bergmann 
Date:   Tue Oct 21 08:52:43 2014 +0200

Remove unnecessary jfw_plugin::getVendorNames

Change-Id: I3c134c27db4c1496fcacc519da68af10ab3ce574

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index 3f23ff3..ee4d6d0 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -53,27 +53,12 @@ BEGIN_VENDOR_MAP()
 END_VENDOR_MAP()
 
 
-Sequence getVendorNames()
+bool isVendorSupported(const OUString& sVendor)
 {
 const size_t count = sizeof(gVendorMap) / sizeof (VendorSupportMapEntry) - 
1;
-OUString arNames[count];
 for ( size_t pos = 0; pos < count; ++pos )
 {
-OString sVendor(gVendorMap[pos].sVendorName);
-arNames[pos] = OStringToOUString(sVendor, RTL_TEXTENCODING_UTF8);
-}
-return Sequence(arNames, count);
-}
-
-bool isVendorSupported(const OUString& sVendor)
-{
-Sequence seqNames = getVendorNames();
-const OUString * arNames = seqNames.getConstArray();
-sal_Int32 count = seqNames.getLength();
-
-for (int i = 0; i < count; i++)
-{
-if (sVendor.equals(arNames[i]))
+if (sVendor.equalsAscii(gVendorMap[pos].sVendorName))
 return true;
 }
 #if OSL_DEBUG_LEVEL >= 2
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
index 72fd317..5709e79 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
@@ -45,9 +45,6 @@ VendorSupportMapEntry gVendorMap[] ={
 #define END_VENDOR_MAP() \
 {NULL, NULL, NULL} };
 
-
-com::sun::star::uno::Sequence getVendorNames();
-
 /* Examines if the vendor supplied in parameter sVendor is part of the
list of supported vendors. That is the arry of VendorSupportMapEntry
is search for an respective entry.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-10-20 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx |5 +++
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx |2 +
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |   10 --
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx |   33 +++
 4 files changed, 23 insertions(+), 27 deletions(-)

New commits:
commit af748c7fff9e57a5b95bdc569456cc0da93a1f90
Author: Stephan Bergmann 
Date:   Mon Oct 20 18:01:05 2014 +0200

Clean up VendorBase (virtual) member functions further

Change-Id: If6b9355c6992eb6651f71c0944a93af0856ef1c7

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index 4f5a877..9fc69d6 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -84,6 +84,11 @@ char const* const* GnuInfo::getRuntimePaths(int * size)
 return ar;
 }
 
+char const* const* GnuInfo::getLibraryPaths(int* /*size*/)
+{
+return NULL;
+}
+
 bool GnuInfo::initialize(vector > props)
 {
 //get java.vendor, java.version, java.home,
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
index 4c364a6..f4683d5 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
@@ -37,6 +37,8 @@ public:
 
 virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE;
 
+virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE;
+
 virtual bool initialize(
 std::vector > props) SAL_OVERRIDE;
 virtual int compareVersions(const OUString& sSecond) const SAL_OVERRIDE;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 563c850..f91f75e 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -179,16 +179,6 @@ bool VendorBase::initialize(vector > props)
 return true;
 }
 
-char const* const* VendorBase::getRuntimePaths(int* /*size*/)
-{
-return NULL;
-}
-
-char const* const* VendorBase::getLibraryPaths(int* /*size*/)
-{
-return NULL;
-}
-
 const OUString & VendorBase::getVendor() const
 {
 return m_sVendor;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
index 7210173..2ecd01f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
@@ -117,23 +117,6 @@ public:
Key - value pairs of the system properties of the JRE.
  */
 
-/* called automatically on the instance created by createInstance.
-
-   @return
-   true - the object could completely initialize.
-   false - the object could not completely initialize. In this case
-   it will be discarded by the caller.
-*/
-virtual bool initialize(
-std::vector > props);
-
-/* returns relative file URLs to the runtime library.
-   For example "/bin/client/jvm.dll"
-*/
-virtual char const* const* getRuntimePaths(int* size);
-
-virtual char const* const* getLibraryPaths(int* size);
-
 const OUString & getVendor() const;
 const OUString & getVersion() const;
 const OUString & getHome() const;
@@ -163,6 +146,22 @@ public:
 virtual int compareVersions(const OUString& sSecond) const = 0;
 
 protected:
+/* called automatically on the instance created by createInstance.
+
+   @return
+   true - the object could completely initialize.
+   false - the object could not completely initialize. In this case
+   it will be discarded by the caller.
+*/
+virtual bool initialize(
+std::vector > props);
+
+/* returns relative file URLs to the runtime library.
+   For example "/bin/client/jvm.dll"
+*/
+virtual char const* const* getRuntimePaths(int* size) = 0;
+
+virtual char const* const* getLibraryPaths(int* size) = 0;
 
 OUString m_sVendor;
 OUString m_sVersion;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-10-20 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx  |1 
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |4 +-
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx|1 
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx|   20 +--
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx|   36 ++--
 5 files changed, 23 insertions(+), 39 deletions(-)

New commits:
commit 5dcfbe57c8c35814d0e8e20c7069be340151da8f
Author: Stephan Bergmann 
Date:   Mon Oct 20 17:58:30 2014 +0200

Clean up VendorBase (virtual) member functions

Change-Id: I1377dfded1246c8e96db3addc28489886c7f2d99

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx
index 2c2b1b7..d95a9a4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx
@@ -34,7 +34,6 @@ public:
 
 static rtl::Reference createInstance();
 
-using VendorBase::getLibraryPaths;
 virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE;
 virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE;
 virtual int compareVersions(const OUString& sSecond) const SAL_OVERRIDE;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index db58c54..3d4e3f4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -157,10 +157,10 @@ JavaInfo* createJavaInfo(const rtl::Reference 
& info)
 pInfo->nRequirements = info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0;
 OUStringBuffer buf(1024);
 buf.append(info->getRuntimeLibrary());
-if (!info->getLibraryPaths().isEmpty())
+if (!info->getLibraryPath().isEmpty())
 {
 buf.appendAscii("\n");
-buf.append(info->getLibraryPaths());
+buf.append(info->getLibraryPath());
 buf.appendAscii("\n");
 }
 
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx
index a25a8e5..1d63794 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx
@@ -33,7 +33,6 @@ public:
 
 static rtl::Reference createInstance();
 
-using VendorBase::getLibraryPaths;
 virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE;
 virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE;
 
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index c72ac27..563c850 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -54,12 +54,6 @@ VendorBase::VendorBase(): m_bAccessibility(false)
 {
 }
 
-rtl::Reference VendorBase::createInstance()
-{
-VendorBase *pBase = new VendorBase();
-return rtl::Reference(pBase);
-}
-
 bool VendorBase::initialize(vector > props)
 {
 //get java.vendor, java.version, java.home,
@@ -209,7 +203,7 @@ const OUString & VendorBase::getHome() const
 return m_sHome;
 }
 
-const OUString & VendorBase::getLibraryPaths() const
+const OUString & VendorBase::getLibraryPath() const
 {
 return m_sLD_LIBRARY_PATH;
 }
@@ -225,21 +219,11 @@ bool VendorBase::supportsAccessibility() const
 
 bool VendorBase::needsRestart() const
 {
-if (!getLibraryPaths().isEmpty())
+if (!getLibraryPath().isEmpty())
 return true;
 return false;
 }
 
-int VendorBase::compareVersions(const OUString& /*sSecond*/) const
-{
-OSL_FAIL("[Java framework] VendorBase::compareVersions must be "
-   "overridden in derived class.");
-return 0;
-}
-
-
-
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
index 29f2641..7210173 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
@@ -88,7 +88,9 @@ class VendorBase: public salhelper::SimpleReferenceObject
 {
 public:
 VendorBase();
-/* returns relative paths to the java executable as
+/* static char const* const *  getJavaExePaths(int* size);
+
+   returns relative paths to the java executable as
file URLs.
 
For example "bin/java.exe". You need
@@ -103,9 +105,10 @@ public:
The signature of this function must correspond to
getJavaExePaths_func.
  */
-static char const* const *  getJavaExePaths(int* size);
 
-/* creates an instance of this class. MUST be overridden
+/* static rtl::Reference createInstance();
+
+   creates an instance of this class. MUST be overridden
in a derived class.

OVERRIDE in derived class
@@ -113,7 +116,6 @@ public:
@param
Key - value pairs of the system properties of the JRE.
  */
-sta

[Libreoffice-commits] core.git: jvmfwk/plugins

2014-10-20 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e3dc8cb177a3ab6a4fb47018763a08ada8eccaf9
Author: Stephan Bergmann 
Date:   Mon Oct 20 11:02:44 2014 +0200

Missing "

Change-Id: I5d596f85fe11bc9336e1669d571795f3dfc70c6c

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 6d46121..8bf31e7 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1239,7 +1239,7 @@ void 
createJavaInfoDirScan(vector >& vecInfos)
 JFW_TRACE2("Could not read directory " << usDir2 << " 
because of missing access rights");
 continue;
 default:
-JFW_TRACE2("Could not read directory << usDir2 << ". 
Osl file error: " << openErr);
+JFW_TRACE2("Could not read directory " << usDir2 << ". 
Osl file error: " << openErr);
 continue;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-08-21 Thread rbuj
 jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java |   16 +---
 1 file changed, 1 insertion(+), 15 deletions(-)

New commits:
commit 8daebc0c343f79e6ded1f35a19ed83358ec3fcb3
Author: rbuj 
Date:   Thu Aug 21 13:04:37 2014 +0200

jvmfwk: Removes the checking for W98 in JREProperties.java

Change-Id: Ia5be6b5893abef084b5e4203f9f02919289ce055
Reviewed-on: https://gerrit.libreoffice.org/11054
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java 
b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
index 525fb22..3f7bc48 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
+++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
@@ -43,27 +43,13 @@ public class JREProperties
 bNoAccess = true;
 }
 
-//Find out on what operation system we are running. On Windows 98
-//we must not call getDefaultToolkit, because the office may freeze
-//#i44608.
-boolean bW98 = false;
-String os = System.getProperty("os.name");
-
-if (os != null)
-{
-os = os.trim();
-if (os.equalsIgnoreCase("Windows 98") ||
-os.indexOf("Windows 98") != -1)
-bW98 = true;
-}
-
 //We need to be able to switch this part off because
 //it causes an exception if the DISPLAY variable has
 //a false value. Setting the noaccessibility argument
 //can be done by providing a sunjavaplugin.ini with
 //the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY
 //set to "1"
-if (!bNoAccess && ! bW98)
+if (!bNoAccess)
 {
 try{
 //This line is needed to get the accessibility properties
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-07-01 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 3818cc53291008f0ad2ebe6f898e2c58d6974b09
Author: Stephan Bergmann 
Date:   Tue Jul 1 12:26:51 2014 +0200

simplify

Change-Id: I1f44dd938bd0033ad4a5b6af4d24d1ba3e76d852

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 217c6ce..d32beff 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -635,10 +635,9 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 
 #if defined UNX && !defined MACOSX
 //Setting the JAVA_HOME is needed for awt
-OUString javaHome("JAVA_HOME");
 OUString sPathLocation;
 osl_getSystemPathFromFileURL(pInfo->sLocation, & sPathLocation.pData);
-osl_setEnvironment(javaHome.pData, sPathLocation.pData);
+osl_setEnvironment(OUString("JAVA_HOME").pData, sPathLocation.pData);
 #endif
 
 typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-07-01 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 732b8be76f5fff8a039667eb116f1d158696c0b3
Author: Stephan Bergmann 
Date:   Tue Jul 1 12:25:36 2014 +0200

Fix osl_setEnvironment args

Change-Id: I243ecb42d7ba2ce58f4c1a0bf97ad74de947d8bd

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index cffb0b3..217c6ce 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -638,8 +638,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 OUString javaHome("JAVA_HOME");
 OUString sPathLocation;
 osl_getSystemPathFromFileURL(pInfo->sLocation, & sPathLocation.pData);
-javaHome += sPathLocation;
-osl_setEnvironment(javaHome.pData, javaHome.pData);
+osl_setEnvironment(javaHome.pData, sPathLocation.pData);
 #endif
 
 typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-06-27 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |   10 --
 1 file changed, 10 deletions(-)

New commits:
commit b97c5480e9bb6372cd21d1b168a0d9973f91ee0c
Author: Stephan Bergmann 
Date:   Fri Jun 27 22:16:35 2014 +0200

Unused declaration

(which loplugin:unreffun did not catch, as it was referenced by a
friend declaration in vendorbase.hxx)

Change-Id: I8a1afd4699b56425b580c1e63557342ee7ec1cb2

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 9fc8e83..3288c2f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -30,16 +30,6 @@ using namespace osl;
 
 namespace jfw_plugin
 {
-rtl::Reference createInstance(createInstance_func pFunc,
-  vector > 
properties);
-
-
-
-
-
-
-
-
 
 MalformedVersionException::MalformedVersionException()
 {}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-05-22 Thread Michael Stahl
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   67 ++--
 1 file changed, 50 insertions(+), 17 deletions(-)

New commits:
commit 831c8e02ca4640ddc7fb4966c0026f99b6e6296a
Author: Michael Stahl 
Date:   Fri May 23 00:01:45 2014 +0200

jvmfwk: generalize (and fix) the do_msvcr71_magic to Oracle JRE 7

With just the Oracle JRE installed, it is not possible to load the
"jvm.dll" directly, because the required MSVC runtime DLL is not
found (unless some other software happens to install it system-wide),
as described in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7184978

There was a hack "do_msvcr71_magic" to manually load the runtime that
is bundled with Oracle JRE 6 and this generalizes that to work with the
MSVCR100.DLL that is bundled with Oracle JRE 7 as well.

An additional adaption of the virtual addresses in the file is done,
and it's a mystery whether it even worked before without that.

This issue was not user-visible before because LO releases 3.5 - 4.2
bundle the MSVCR100.DLL themselves.

Change-Id: If61565df80ff8a68472a76000ab5b10d6c78e11c

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 266cdc6..ef91401 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -449,20 +449,20 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
 // think it should be, do nothing, and just let the implicit loading
 // that happens when loading the JVM take care of it.
 
-static void load_msvcr71(LPCWSTR jvm_dll)
+static void load_msvcr(LPCWSTR jvm_dll, wchar_t const* msvcr)
 {
-wchar_t msvcr71_dll[MAX_PATH];
+wchar_t msvcr_dll[MAX_PATH];
 wchar_t *slash;
 
 if (wcslen(jvm_dll) > MAX_PATH - 15)
 return;
 
-wcscpy(msvcr71_dll, jvm_dll);
+wcscpy(msvcr_dll, jvm_dll);
 
 // First check if msvcr71.dll is in the same folder as jvm.dll. It
 // normally isn't, at least up to 1.6.0_22, but who knows if it
 // might be in the future.
-slash = wcsrchr(msvcr71_dll, L'\\');
+slash = wcsrchr(msvcr_dll, L'\\');
 
 if (!slash)
 {
@@ -470,27 +470,27 @@ static void load_msvcr71(LPCWSTR jvm_dll)
 return;
 }
 
-wcscpy(slash+1, L"msvcr71.dll");
-if (LoadLibraryW(msvcr71_dll))
+wcscpy(slash+1, msvcr);
+if (LoadLibraryW(msvcr_dll))
 return;
 
 // Then check if msvcr71.dll is in the parent folder of where
 // jvm.dll is. That is currently (1.6.0_22) as far as I know the
 // normal case.
 *slash = 0;
-slash = wcsrchr(msvcr71_dll, L'\\');
+slash = wcsrchr(msvcr_dll, L'\\');
 
 if (!slash)
 return;
 
-wcscpy(slash+1, L"msvcr71.dll");
-LoadLibraryW(msvcr71_dll);
+wcscpy(slash+1, msvcr);
+LoadLibraryW(msvcr_dll);
 }
 
 // Check if the jvm DLL imports msvcr71.dll, and in that case try
 // loading it explicitly. In case something goes wrong, do nothing,
 // and just let the implicit loading try to take care of it.
-static void do_msvcr71_magic(rtl_uString *jvm_dll)
+static void do_msvcr_magic(rtl_uString *jvm_dll)
 {
 rtl_uString* Module(0);
 struct stat st;
@@ -524,18 +524,51 @@ static void do_msvcr71_magic(rtl_uString *jvm_dll)
 
 IMAGE_NT_HEADERS *nt_hdr = (IMAGE_NT_HEADERS *) ((char *)dos_hdr + 
dos_hdr->e_lfanew);
 
+DWORD importsVA = nt_hdr->OptionalHeader
+.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
+// first determine Virtual-to-File-address mapping for the section
+// that contains the import directory
+IMAGE_SECTION_HEADER *sections = IMAGE_FIRST_SECTION(nt_hdr);
+ptrdiff_t VAtoPhys = -1;
+for (int i = 0; i < nt_hdr->FileHeader.NumberOfSections; ++i)
+{
+if (sections->VirtualAddress <= importsVA &&
+importsVA < sections->VirtualAddress + sections->SizeOfRawData)
+{
+VAtoPhys = sections->PointerToRawData - sections->VirtualAddress;
+break;
+}
+++sections;
+}
+if (-1 == VAtoPhys) // not found?
+{
+free(dos_hdr);
+return;
+}
 IMAGE_IMPORT_DESCRIPTOR *imports =
-(IMAGE_IMPORT_DESCRIPTOR *) ((char *) dos_hdr + 
nt_hdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
+(IMAGE_IMPORT_DESCRIPTOR *) ((char *) dos_hdr + importsVA + VAtoPhys);
 
 while (imports <= (IMAGE_IMPORT_DESCRIPTOR *) ((char *) dos_hdr + 
st.st_size - sizeof (IMAGE_IMPORT_DESCRIPTOR)) &&
imports->Name != 0 &&
-   imports->Name < (DWORD) st.st_size)
+   imports->Name + VAtoPhys < (DWORD) st.st_size)
 {
-// Intentional use of sizeof("msvcr71.dll") here to include the 
terminating zero byte
-if (strnicmp((char *) dos_hdr + imports->Name, "msvcr71.dll", 
sizeof("msvcr71.dll")) == 0)
+static struct { char const * name; wchar

[Libreoffice-commits] core.git: jvmfwk/plugins

2014-05-08 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit f5ed2f4e926016d23617355c94dd2292b40e6986
Author: Stephan Bergmann 
Date:   Thu May 8 13:10:46 2014 +0200

Resolves: rhbz#1092589 Thoroughly check whether JRE is still present

...not only on Mac OS X.  Was able to reproduce this on Fedora 20 where 
current
JRE was /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.5.x86_64 but for whatever 
reason
there was also a left-behind /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64 
tree
(containing just a handful of sub-dirs, but no real content) that was still
recorded in my 
~/.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml

Change-Id: Ie477c5a506a430f6c29525f6c558dbc18bbf1c48

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 0069aec..ca816cb 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -772,10 +772,10 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo 
*pInfo, sal_Bool *exist)
 {
 ret = JFW_PLUGIN_E_ERROR;
 }
-#ifdef MACOSX
 //We can have the situation that the JavaVM runtime library is not
 //contained within JAVA_HOME. Then the check for JAVA_HOME would return
 //true although the runtime library may not be loadable.
+//Or the JAVA_HOME directory of a deinstalled JRE left behind.
 if (ret == JFW_PLUGIN_E_NONE && *exist == sal_True)
 {
 OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
@@ -803,7 +803,6 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, 
sal_Bool *exist)
+ sRuntimeLib + " \n");
 }
 }
-#endif
 return ret;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-04-09 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 5180805c3f74998c27b0ab0af3292f9d35a61a1b
Author: Stephan Bergmann 
Date:   Wed Apr 9 10:42:38 2014 +0200

Clean up function declarations

Change-Id: I0ad09f02d1d09d6ce45bc204c8cd8d26ef663ddb

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 5c1..8ac2b4e 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -31,6 +31,7 @@
 #include "rtl/instance.hxx"
 #include "salhelper/linkhelper.hxx"
 #include "salhelper/thread.hxx"
+#include "boost/noncopyable.hpp"
 #include "boost/scoped_array.hpp"
 #include "com/sun/star/uno/Sequence.hxx"
 #include 
@@ -124,8 +125,11 @@ namespace jfw_plugin
 {
 extern VendorSupportMapEntry gVendorMap[];
 
+#if defined WNT
 bool getSDKInfoFromRegistry(vector & vecHome);
 bool getJREInfoFromRegistry(vector& vecJavaHome);
+#endif
+
 bool decodeOutput(const OString& s, OUString* out);
 
 
@@ -179,7 +183,7 @@ rtl::Bootstrap * getBootstrap()
 
 
 
-class FileHandleGuard
+class FileHandleGuard: private boost::noncopyable
 {
 public:
 inline FileHandleGuard(oslFileHandle & rHandle) SAL_THROW(()):
@@ -191,9 +195,6 @@ public:
 
 private:
 oslFileHandle & m_rHandle;
-
-FileHandleGuard(FileHandleGuard &); // not implemented
-void operator =(FileHandleGuard); // not implemented
 };
 
 inline FileHandleGuard::~FileHandleGuard() SAL_THROW(())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2014-02-26 Thread Alexander Wilms
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |4 ++--
 jvmfwk/source/elements.cxx   |8 
 jvmfwk/source/libxmlutil.cxx |6 +++---
 jvmfwk/source/libxmlutil.hxx |6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 132d7941e01a6b385f17ebd768341debd49f8847
Author: Alexander Wilms 
Date:   Tue Feb 25 19:15:10 2014 +0100

Remove visual noise from jvmfwk

Change-Id: Ie9ad9478532b395bd6a2bddd54bbe0d10b1b5eb2
Reviewed-on: https://gerrit.libreoffice.org/8277
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 6fa931d..9fc8e83 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -39,7 +39,7 @@ rtl::Reference createInstance(createInstance_func 
pFunc,
 
 
 
-//##
+
 
 MalformedVersionException::MalformedVersionException()
 {}
@@ -54,7 +54,7 @@ MalformedVersionException::operator =(
 {
 return *this;
 }
-//##
+
 
 
 VendorBase::VendorBase(): m_bAccessibility(false)
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index ec30fc2..6b6ec8b 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -168,7 +168,7 @@ void createSettingsStructure(xmlDoc * document, bool * 
bNeedsSave)
 }
 
 
-//
+
 VersionInfo::VersionInfo(): arVersions(NULL)
 {
 }
@@ -204,7 +204,7 @@ sal_Int32 VersionInfo::getExcludeVersionSize()
 {
 return vecExcludeVersions.size();
 }
-//==
+
 
 NodeJava::NodeJava(Layer layer):
 m_layer(layer)
@@ -797,7 +797,7 @@ bool NodeJava::createSettingsDocument() const
 return true;
 }
 
-//=
+
 CNodeJavaInfo::CNodeJavaInfo() :
 m_bEmptyNode(false), bNil(true), bAutoSelect(true),
 nFeatures(0), nRequirements(0)
@@ -1048,7 +1048,7 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
 return pInfo;
 }
 
-//
+
 MergedSettings::MergedSettings():
 m_bEnabled(false),
 m_sClassPath(),
diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx
index 30b1d07..bb2640e 100644
--- a/jvmfwk/source/libxmlutil.cxx
+++ b/jvmfwk/source/libxmlutil.cxx
@@ -53,7 +53,7 @@ CXPathObjectPtr::operator xmlXPathObject*() const
 {
 return _object;
 }
-//===
+
 CXPathContextPtr::CXPathContextPtr(xmlXPathContextPtr aContext)
 : _object(aContext)
 {
@@ -85,7 +85,7 @@ CXPathContextPtr::operator xmlXPathContext*() const
 {
 return _object;
 }
-//===
+
 CXmlDocPtr::CXmlDocPtr(xmlDoc* aDoc)
 : _object(aDoc)
 {
@@ -118,7 +118,7 @@ CXmlDocPtr::operator xmlDoc*() const
 return _object;
 }
 
-//===
+
 CXmlCharPtr::CXmlCharPtr(xmlChar * aChar)
 : _object(aChar)
 {
diff --git a/jvmfwk/source/libxmlutil.hxx b/jvmfwk/source/libxmlutil.hxx
index 4ee92d1..b99c04f 100644
--- a/jvmfwk/source/libxmlutil.hxx
+++ b/jvmfwk/source/libxmlutil.hxx
@@ -43,7 +43,7 @@ public:
 operator xmlXPathObject* () const;
 };
 
-//===
+
 class CXPathContextPtr
 {
 xmlXPathContext* _object;
@@ -59,7 +59,7 @@ public:
 operator xmlXPathContext* () const;
 };
 
-//===
+
 class CXmlDocPtr
 {
 xmlDoc* _object;
@@ -78,7 +78,7 @@ public:
 operator xmlDoc* () const;
 };
 
-//===
+
 class CXmlCharPtr
 {
 xmlChar* _object;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins jvmfwk/source

2014-02-18 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx |8 
 jvmfwk/source/elements.cxx   |2 +-
 jvmfwk/source/elements.hxx   |2 +-
 jvmfwk/source/framework.cxx  |2 +-
 jvmfwk/source/fwkbase.cxx|   12 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit f2529fc7441ced32daef09c0ca767080998d1792
Author: Stephan Bergmann 
Date:   Tue Feb 18 12:01:43 2014 +0100

jvmfwk: sal_Bool -> bool

Change-Id: I35f302006cb9ef6e98a041dea811818b98c0e876

diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx 
b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index fb99974..09e0435 100644
--- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -29,7 +29,7 @@
 #include "jvmfwk/framework.h"
 
 
-static sal_Bool hasOption(char const * szOption, int argc, char** argv);
+static bool hasOption(char const * szOption, int argc, char** argv);
 static OString getLD_LIBRARY_PATH(const rtl::ByteSequence & vendorData);
 static bool findAndSelect(JavaInfo**);
 
@@ -132,14 +132,14 @@ OString getLD_LIBRARY_PATH(const rtl::ByteSequence & 
vendorData)
 return paths;
 }
 
-static sal_Bool hasOption(char const * szOption, int argc, char** argv)
+static bool hasOption(char const * szOption, int argc, char** argv)
 {
-sal_Bool retVal= sal_False;
+bool retVal= false;
 for(sal_Int16 i= 1; i < argc; i++)
 {
 if( ! strcmp(argv[i], szOption))
 {
-retVal= sal_True;
+retVal= true;
 break;
 }
 }
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 9fdab7a..ec30fc2 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -586,7 +586,7 @@ void NodeJava::write() const
 throw FrameworkException(JFW_E_ERROR, sExcMsg);
 }
 
-void NodeJava::setEnabled(sal_Bool bEnabled)
+void NodeJava::setEnabled(bool bEnabled)
 {
 m_enabled =  boost::optional(bEnabled);
 }
diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx
index 36fbd3e..f716fe4 100644
--- a/jvmfwk/source/elements.hxx
+++ b/jvmfwk/source/elements.hxx
@@ -186,7 +186,7 @@ public:
 /** sets m_enabled.
 /java/enabled@xsi:nil will be set to false when write is called.
  */
-void setEnabled(sal_Bool bEnabled);
+void setEnabled(bool bEnabled);
 
 /** sets m_sUserClassPath. See setEnabled.
  */
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index f0b9d69..dcaac1b 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -40,7 +40,7 @@ static bool g_bEnabledSwitchedOn = false;
 
 static JavaVM * g_pJavaVM = NULL;
 
-sal_Bool areEqualJavaInfo(
+bool areEqualJavaInfo(
 JavaInfo const * pInfoA,JavaInfo const * pInfoB)
 {
 return jfw_areEqualJavaInfo(pInfoA, pInfoB);
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 29949c6..3b4fba3 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -424,12 +424,12 @@ OUString BootParams::getJREHome()
 {
 OUString sJRE;
 OUString sEnvJRE;
-sal_Bool bJRE = Bootstrap::get()->getFrom(
+bool bJRE = Bootstrap::get()->getFrom(
 OUString(UNO_JAVA_JFW_JREHOME) ,sJRE);
-sal_Bool bEnvJRE = Bootstrap::get()->getFrom(
+bool bEnvJRE = Bootstrap::get()->getFrom(
 OUString(UNO_JAVA_JFW_ENV_JREHOME) ,sEnvJRE);
 
-if (bJRE == sal_True && bEnvJRE == sal_True)
+if (bJRE && bEnvJRE)
 {
 throw FrameworkException(
 JFW_E_CONFIGURATION,
@@ -439,7 +439,7 @@ OUString BootParams::getJREHome()
  "Check bootstrap parameters: environment 
variables, command line "
  "arguments, rc/ini files for executable and java 
framework library."));
 }
-else if (bEnvJRE == sal_True)
+else if (bEnvJRE)
 {
 const char * pJRE = getenv("JAVA_HOME");
 if (pJRE == NULL)
@@ -463,8 +463,8 @@ OUString BootParams::getJREHome()
 #endif
 }
 else if (getMode() == JFW_MODE_DIRECT
-&& bEnvJRE == sal_False
-&& bJRE == sal_False)
+&& !bEnvJRE
+&& !bJRE)
 {
 throw FrameworkException(
 JFW_E_CONFIGURATION,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-02-11 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 237d2c923b77479dbdf07db7bd926c45b01b8fc8
Author: Stephan Bergmann 
Date:   Tue Feb 11 18:36:42 2014 +0100

Don't set JAVA_HOME on Mac OS X

...for one, it doesn't appear necessary there ("needed for awt"), and for
another setting it according to Oracle's JRE 7 would prevent a subsequent
visit to the Advanced preferences pane from listing Apple's JRE 6, as 
launching
that java and reading its system properties would be fooled by the 
JAVA_HOME and
report the Oracle system properties instead.

Change-Id: I02d82de6113b44b3cae3fb55cd83177fe852d769

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index a7ee90a..0069aec 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -595,7 +595,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
  return JFW_PLUGIN_E_VM_CREATION_FAILED;
  }
 
-#ifdef UNX
+#if defined UNX && !defined MACOSX
 //Setting the JAVA_HOME is needed for awt
 OUString javaHome("JAVA_HOME=");
 OUString sPathLocation;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2014-02-11 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 6c697a99c90a40492eb8c16466a2082cc2be927e
Author: Stephan Bergmann 
Date:   Tue Feb 11 14:10:43 2014 +0100

Related fdo#74597: Java on Mac doesn't use javaldx/library path fiddling

...so no need to return non-empty SunInfo::getLibraryPaths (for the Oracle 
JRE,
cf. how this had always returned an empty set for the Apple JRE in
otherjre.cxx).

This fixes the bug that selecting the Oracle JRE in the Advanced options 
pane
didn't stick, because jfw_areEqualJavaInfo was called on a JavaInfo read 
back
from XML where nRequirements had been cleared (in 
CNodeJavaInfo::loadFromNode)
and a JavaInfo where non-empty SunInfo::getLibraryPaths ->
VendorBase::needsRestart() == true -> nRequirements == 
JFW_REQUIRE_NEEDRESTART,
so always returned false.

(There's multiple errors here.  It is questionable whether 
jfw_areEqualJavaInfo
should take nRequirements into account, at least when used from
SvxJavaOptionsPage.  And VendorBase::getLibraryPaths appears to be only 
used to
compute VendorBase::needsRestart, ignoring the actual path data.  But leave 
that
for future clean-up.)

Change-Id: I5f004434b1cb7e909a153c43c474a2317f24b0c1

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 180bbb9..e38ecf8 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -76,18 +76,12 @@ char const* const* SunInfo::getRuntimePaths(int * size)
 
 char const* const* SunInfo::getLibraryPaths(int* size)
 {
-#if defined UNX
+#if defined UNX && !defined MACOSX
 static char const * ar[] = {
-#if defined MACOSX && defined X86_64
-// Oracle Java 7, under /Library/Internet 
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
-"/lib/server",
-"/lib"
-#else
 "/lib/" JFW_PLUGIN_ARCH "/client",
 "/lib/" JFW_PLUGIN_ARCH "/server",
 "/lib/" JFW_PLUGIN_ARCH "/native_threads",
 "/lib/" JFW_PLUGIN_ARCH
-#endif
 };
 *size = SAL_N_ELEMENTS(ar);
 return ar;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2013-10-13 Thread Markus Mohrhard
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |   22 --
 1 file changed, 22 deletions(-)

New commits:
commit 4badcfda55996891d99b1f0a8cc47028acd1c0c1
Author: Markus Mohrhard 
Date:   Mon Oct 14 06:10:15 2013 +0200

Revert "Related: #i119525# List only JREs whose jvm library can be loaded"

This reverts commit 37ca14359b8c4027f1d9f9569ddfa2740cd2731e.

This breaks the loading of the jvm.dll on Windows if the msvcr*.dll is
not in the system path.

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index b1cd722..6fa931d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -19,9 +19,6 @@
 
 
 #include "osl/file.hxx"
-#include "osl/diagnose.h"
-#include "osl/module.hxx"
-#include "osl/thread.hxx"
 
 #include "vendorbase.hxx"
 #include "util.hxx"
@@ -161,25 +158,6 @@ bool VendorBase::initialize(vector > props)
 if (!bRt)
 return false;
 
-#if defined(WNT)
-oslModule moduleRt = 0;
-rtl::OUString sRuntimeLib;
-if( File::getSystemPathFromFileURL( m_sRuntimeLibrary, sRuntimeLib ) == 
File::E_None )
-{
-if ( ( moduleRt = osl_loadModule( sRuntimeLib.pData, 
SAL_LOADMODULE_DEFAULT ) ) == 0 )
-{
-OSL_TRACE( "jfw_plugin::VendorBase::initialize - cannot load 
library %s",
-   rtl::OUStringToOString( sRuntimeLib, 
osl_getThreadTextEncoding() ).getStr() );
-return false;
-}
-else
-{
-// do not leave the module loaded!
-osl_unloadModule( moduleRt );
-}
-}
-#endif
-
 // init m_sLD_LIBRARY_PATH
 OSL_ASSERT(!m_sHome.isEmpty());
 size = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2013-05-28 Thread Herbert Dürr
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b828a6f494cc90e1a135e7442589679993eb2a5c
Author: Herbert Dürr 
Date:   Fri Apr 26 08:51:11 2013 +

Related: #i121715# find official JRE>=7 on OSX

(cherry picked from commit a3eded9728647bde4af68b9f3c75a51dc0676fc7)

Conflicts:
jvmfwk/distributions/OpenOfficeorg/javavendors_macosx.xml
jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx

Change-Id: I5ec6aa62147f9b3fb3e5142fbc2658c0b54f21b8

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f488b15..38279a6 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -95,6 +95,7 @@ char const *g_arCollectDirs[] = {
 char const *g_arSearchPaths[] = {
 #ifdef MACOSX
 "",
+"Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin",
 "System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/"
 #else
 #ifndef JVM_ONE_PATH_CHECK
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: jvmfwk/plugins

2013-05-18 Thread Ariel Constenla-Haile
 jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c0b455a664bae6047992a98e3c991b8b5dc84736
Author: Ariel Constenla-Haile 
Date:   Sun Aug 26 11:51:55 2012 +

Clearer javaldx message

(cherry picked from commit fdebe4193ae0f3f8a8281dfc0a2f053e578cf1b9)

Conflicts:
jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx

Change-Id: I4c26c704ce85a273d7022260bb721e295041c260

diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx 
b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index 718844d..fb99974 100644
--- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -59,7 +59,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 }
 else if (errcode != JFW_E_NONE && errcode != JFW_E_DIRECT_MODE)
 {
-fprintf(stderr,"javaldx failed! \n");
+fprintf(stderr,"javaldx failed!\n");
 return -1;
 }
 
@@ -69,7 +69,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 
 if (errcode != JFW_E_NONE && errcode != JFW_E_INVALID_SETTINGS)
 {
-fprintf(stderr,"javaldx failed! \n");
+fprintf(stderr,"javaldx failed!\n");
 return -1;
 }
 
@@ -151,7 +151,7 @@ static bool findAndSelect(JavaInfo ** ppInfo)
 javaFrameworkError errcode = jfw_findAndSelectJRE(ppInfo);
 if (errcode == JFW_E_NO_JAVA_FOUND)
 {
-fprintf(stderr,"javaldx: Could not find a Java Runtime Environment! 
\n");
+fprintf(stderr,"javaldx: Could not find a Java Runtime 
Environment!\n");
 return false;
 }
 else if (errcode != JFW_E_NONE && errcode != JFW_E_DIRECT_MODE)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits