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

2022-04-15 Thread Noel Grandin (via logerrit)
 jvmfwk/inc/fwkutil.hxx |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |6 +++---
 jvmfwk/plugins/sunmajor/pluginlib/util.hxx |2 +-
 jvmfwk/source/fwkutil.cxx  |6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 65e846d73c023cb8ed8a8393a91032d4a816f2a0
Author: Noel Grandin 
AuthorDate: Fri Apr 15 16:47:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 15 21:33:17 2022 +0200

use more string_view in jvmfwk

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

diff --git a/jvmfwk/inc/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx
index 825355f42a47..76d437ae76b9 100644
--- a/jvmfwk/inc/fwkutil.hxx
+++ b/jvmfwk/inc/fwkutil.hxx
@@ -46,7 +46,7 @@ osl::Mutex& FwkMutex();
 rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData);
 rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data);
 
-OUString getDirFromFile(const OUString& usFilePath);
+OUString getDirFromFile(std::u16string_view usFilePath);
 
 enum FileStatus
 {
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f7d786007544..b596e18cf480 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1023,10 +1023,10 @@ Reference 
createInstance(createInstance_func pFunc,
 return aBase;
 }
 
-inline OUString getDirFromFile(const OUString& usFilePath)
+inline OUString getDirFromFile(std::u16string_view usFilePath)
 {
-sal_Int32 index = usFilePath.lastIndexOf('/');
-return usFilePath.copy(0, index);
+size_t index = usFilePath.rfind('/');
+return OUString(usFilePath.substr(0, index));
 }
 
 void addJavaInfosFromPath(
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
index 78df074f9de3..9ba0055832ed 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
@@ -37,7 +37,7 @@ void addJREInfoFromBinPath(
 const OUString& path,
 std::vector> & allInfos,
 std::vector> & addedInfos);
-inline OUString getDirFromFile(const OUString& usFilePath);
+inline OUString getDirFromFile(std::u16string_view usFilePath);
 void addJavaInfosFromPath(
 std::vector> & allInfos,
 std::vector> & addedInfos);
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index ee083f064926..89cb2e5415cb 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -136,10 +136,10 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence& 
data)
 return ret;
 }
 
-OUString getDirFromFile(const OUString& usFilePath)
+OUString getDirFromFile(std::u16string_view usFilePath)
 {
-sal_Int32 index = usFilePath.lastIndexOf('/');
-return usFilePath.copy(0, index);
+size_t index = usFilePath.rfind('/');
+return OUString(usFilePath.substr(0, index));
 }
 
 OUString getLibraryLocation()


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

2021-11-16 Thread Noel Grandin (via logerrit)
 jvmfwk/inc/fwkutil.hxx  |   20 +---
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |6 +--
 jvmfwk/source/elements.cxx  |2 -
 jvmfwk/source/framework.cxx |   32 ++--
 jvmfwk/source/fwkbase.cxx   |   18 +--
 jvmfwk/source/fwkutil.cxx   |   28 +
 6 files changed, 59 insertions(+), 47 deletions(-)

New commits:
commit 1170db278db9f1067c05d5df95faf81c1ce861bc
Author: Noel Grandin 
AuthorDate: Mon Nov 15 21:44:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 16 12:29:38 2021 +0100

rtl::Static->thread-safe static in jvmfwk

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

diff --git a/jvmfwk/inc/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx
index fdef421f664f..e76a92769fc1 100644
--- a/jvmfwk/inc/fwkutil.hxx
+++ b/jvmfwk/inc/fwkutil.hxx
@@ -24,8 +24,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 namespace osl { class Mutex; }
 
@@ -40,23 +40,9 @@ OUString getLibraryLocation();
 /** provides a bootstrap class which already knows the values from the
 jvmfkwrc file.
 */
-struct Bootstrap :
-public ::rtl::StaticWithInit< const rtl::Bootstrap *, Bootstrap > {
-const rtl::Bootstrap * operator () () {
-OUString sIni = getLibraryLocation() +
-#ifdef MACOSX
-// For some reason the jvmfwk3rc file is traditionally in
-// LIBO_URE_ETC_FOLDER
-"/../" LIBO_URE_ETC_FOLDER
-#endif
-SAL_CONFIGFILE("/jvmfwk3");
-::rtl::Bootstrap *  bootstrap = new ::rtl::Bootstrap(sIni);
-SAL_INFO("jfw.level2", "Using configuration file " << sIni);
-return bootstrap;
-}
-};
+const rtl::Bootstrap * Bootstrap();
 
-struct FwkMutex: public ::rtl::Static {};
+osl::Mutex& FwkMutex();
 
 rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData);
 rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 70d6e7888097..29de226211f1 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -48,7 +48,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -100,8 +99,6 @@ using namespace jfw_plugin;
 
 namespace {
 
-struct PluginMutex: public ::rtl::Static {};
-
 #if defined(UNX) && !defined(ANDROID)
 OString getPluginJarPath(
 std::u16string_view sVendor,
@@ -616,10 +613,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 JavaVM ** ppVm,
 JNIEnv ** ppEnv)
 {
+static osl::Mutex aPluginMutex;
 assert(pInfo != nullptr);
 assert(ppVm != nullptr);
 assert(ppEnv != nullptr);
-osl::MutexGuard guard(PluginMutex::get());
+osl::MutexGuard guard(aPluginMutex);
 javaPluginError errorcode = javaPluginError::NONE;
 #ifdef MACOSX
 rtl::Reference aVendorInfo = getJREInfoByPath( 
pInfo->sLocation );
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index f5bdce32696d..c48f942ef8e8 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -961,7 +961,7 @@ void 
MergedSettings::getVmParametersArray(std::vector * parParams)
 const
 {
 assert(parParams != nullptr);
-osl::MutexGuard guard(FwkMutex::get());
+osl::MutexGuard guard(FwkMutex());
 
 *parParams = m_vmParams;
 }
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index ad1f636f00d0..40bbf629a36f 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -58,7 +58,7 @@ javaFrameworkError 
jfw_findAllJREs(std::vector> *pparI
 assert(pparInfo != nullptr);
 try
 {
-osl::MutexGuard guard(jfw::FwkMutex::get());
+osl::MutexGuard guard(jfw::FwkMutex());
 
 jfw::VendorSettings aVendorSettings;
 std::vector> vecInfo;
@@ -137,7 +137,7 @@ javaFrameworkError jfw_startVM(
 
 try
 {
-osl::MutexGuard guard(jfw::FwkMutex::get());
+osl::MutexGuard guard(jfw::FwkMutex());
 
 //We keep this pointer so we can determine if a VM has already
 //been created.
@@ -298,7 +298,7 @@ javaFrameworkError 
jfw_findAndSelectJRE(std::unique_ptr *pInfo)
 javaFrameworkError errcode = JFW_E_NONE;
 try
 {
-osl::MutexGuard guard(jfw::FwkMutex::get());
+osl::MutexGuard guard(jfw::FwkMutex());
 if (jfw::getMode() == jfw::JFW_MODE_DIRECT)
 return JFW_E_DIRECT_MODE;
 std::unique_ptr aCurrentInfo;
@@ -436,7 +436,7 @@ javaFrameworkError 
jfw_getSelectedJRE(std::unique_ptr *ppInfo)
 javaFrameworkError errcode = JFW_E_NONE;
 try
 {
-osl::MutexGuard gua

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

2021-10-21 Thread Stephan Bergmann (via logerrit)
 jvmfwk/inc/fwkbase.hxx  |3 -
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   46 
 jvmfwk/source/fwkbase.cxx   |4 -
 3 files changed, 23 insertions(+), 30 deletions(-)

New commits:
commit 3460c16d7f749d8d2a59d8b927df5ec31f64a083
Author: Stephan Bergmann 
AuthorDate: Thu Oct 21 10:14:38 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 21 12:42:03 2021 +0200

Make getVersionInformation always return a VersionInfo

...even for JREs not listed in javavendors.xml, making it default to a
VersionInfo with sMinVersion = "1.8.0".

3d27b2fa9c5a03f78e5145377402f8a88e3da1be "tdf#124503: Support JRE 
installations
with unknown java.vendor property", which had changed getVersionInformation 
to
return an optional,  said in the commit message:  "For 
simplicity,
assume that any versions of such JREs are supported.  Our baseline is Java 
6,
and there are unlikely any older versions of JREs from unknown vendors out
there."  Our baseline is Java 8 by now, and there are still unlikely any 
older
JREs out there, but for macOS ARM64 we may want to restrict to at least 
Java 17
implementing  "JEP 391: macOS/AArch64 
Port",
and this commit is a prerequisite for such a change (where we would then 
e.g.
change the hardcoded "1.8.0" to "17" for just that one platform).

(OtherInfo::compareVersions in 
jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
unconditionally returns 0, meaning "versions compare equal", so introducing 
a
default version of "1.8.0" should have no negative effect on any JREs that 
use
OtherInfo.)

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

diff --git a/jvmfwk/inc/fwkbase.hxx b/jvmfwk/inc/fwkbase.hxx
index 5f989cc08cee..61c3fa500138 100644
--- a/jvmfwk/inc/fwkbase.hxx
+++ b/jvmfwk/inc/fwkbase.hxx
@@ -21,7 +21,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 
@@ -40,7 +39,7 @@ class VendorSettings
 public:
 VendorSettings();
 
-std::optional getVersionInformation(std::u16string_view 
sVendor) const;
+VersionInfo getVersionInformation(std::u16string_view sVendor) const;
 };
 
 /* The class offers functions to retrieve verified bootstrap parameters.
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index d3b9b92a5b5e..70d6e7888097 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -348,16 +348,14 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 
 for (auto const& vecInfo : vecInfos)
 {
-if (auto const versionInfo = 
vendorSettings.getVersionInformation(vecInfo->getVendor()))
-{
-javaPluginError err = checkJavaVersionRequirements(
-vecInfo, versionInfo->sMinVersion, versionInfo->sMaxVersion, 
versionInfo->vecExcludeVersions);
+auto const versionInfo = 
vendorSettings.getVersionInformation(vecInfo->getVendor());
+javaPluginError err = checkJavaVersionRequirements(
+vecInfo, versionInfo.sMinVersion, versionInfo.sMaxVersion, 
versionInfo.vecExcludeVersions);
 
-if (err == javaPluginError::FailedVersion || err == 
javaPluginError::WrongArch)
-continue;
-else if (err == javaPluginError::WrongVersionFormat)
-return err;
-}
+if (err == javaPluginError::FailedVersion || err == 
javaPluginError::WrongArch)
+continue;
+else if (err == javaPluginError::WrongVersionFormat)
+return err;
 
 vecVerifiedInfos.push_back(vecInfo);
 }
@@ -388,11 +386,9 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
 
 //Check if the detected JRE matches the version requirements
 javaPluginError errorcode = javaPluginError::NONE;
-if (auto const versionInfo = 
vendorSettings.getVersionInformation(aVendorInfo->getVendor()))
-{
-errorcode = checkJavaVersionRequirements(
-aVendorInfo, versionInfo->sMinVersion, versionInfo->sMaxVersion, 
versionInfo->vecExcludeVersions);
-}
+auto const versionInfo = 
vendorSettings.getVersionInformation(aVendorInfo->getVendor());
+errorcode = checkJavaVersionRequirements(
+aVendorInfo, versionInfo.sMinVersion, versionInfo.sMaxVersion, 
versionInfo.vecExcludeVersions);
 
 if (errorcode == javaPluginError::NONE)
 *ppInfo = createJavaInfo(aVendorInfo);
@@ -416,13 +412,12 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
 
 //Check if the detected JRE matches the version requirements
 auto const versionInfo = 
vendorSettings.getVersionInformation(infoJavaHome[0]->getVendor());
-if (!versionInfo
-|| (checkJavaVersionRequirements(
+  

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

2021-10-11 Thread Noel Grandin (via logerrit)
 jvmfwk/inc/vendorbase.hxx|2 +-
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 47331ae6f95070ff7460e541895895b59eb15103
Author: Noel Grandin 
AuthorDate: Mon Oct 11 16:08:46 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 11 18:37:07 2021 +0200

loplugin:moveparam in jvmfwk

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

diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index 47e407a1b4a2..4a0190eb0bb8 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -154,7 +154,7 @@ protected:
false - the object could not completely initialize. In this case
it will be discarded by the caller.
 */
-virtual bool initialize(std::vector> props);
+virtual bool initialize(const std::vector>& 
props);
 
 /* returns relative file URLs to the runtime library.
For example "/bin/client/jvm.dll"
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index 99e07bda8c41..1003e6eec411 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -89,7 +89,7 @@ char const* const* GnuInfo::getLibraryPaths(int* /*size*/)
 return nullptr;
 }
 
-bool GnuInfo::initialize(std::vector > props)
+bool GnuInfo::initialize(const std::vector >& 
props)
 {
 //get java.vendor, java.version, java.home
 //from system properties
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
index dd3e15cb99c0..5d2f78d1fd17 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
@@ -38,7 +38,7 @@ public:
 
 virtual char const* const* getLibraryPaths(int* size) override;
 
-virtual bool initialize(std::vector> props) 
override;
+virtual bool initialize(const std::vector>& 
props) override;
 virtual int compareVersions(const OUString& sSecond) const override;
 };
 }
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index e9c26778a461..8863df3352ff 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -35,7 +35,7 @@ VendorBase::VendorBase()
 {
 }
 
-bool VendorBase::initialize(std::vector > props)
+bool VendorBase::initialize(const std::vector >& 
props)
 {
 //get java.vendor, java.version, java.home
 //from system properties


[Libreoffice-commits] core.git: jvmfwk/inc jvmfwk/plugins solenv/clang-format

2020-11-18 Thread Philipp Hofer (via logerrit)
 jvmfwk/inc/elements.hxx  |   69 +++
 jvmfwk/inc/fwkbase.hxx   |   13 +---
 jvmfwk/inc/libxmlutil.hxx|   40 ++---
 jvmfwk/inc/vendorbase.hxx|   40 +
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx |   13 +---
 jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx   |8 +-
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx |8 +-
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx |   21 +++
 jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.hxx |2 
 solenv/clang-format/excludelist  |9 ---
 10 files changed, 98 insertions(+), 125 deletions(-)

New commits:
commit 856bdfb0585cea3c67eedfb535c6477d51e4c352
Author: Philipp Hofer 
AuthorDate: Thu Nov 12 13:04:38 2020 +0100
Commit: Christian Lohmaier 
CommitDate: Wed Nov 18 12:55:23 2020 +0100

tdf#123936 Formatting files in module jvmfwk with clang-format

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

diff --git a/jvmfwk/inc/elements.hxx b/jvmfwk/inc/elements.hxx
index 58ad6044f300..3fde096c44a4 100644
--- a/jvmfwk/inc/elements.hxx
+++ b/jvmfwk/inc/elements.hxx
@@ -36,7 +36,6 @@ struct JavaInfo;
 
 namespace jfw
 {
-
 /** gets the value of the updated element from the javavendors.xml.
  */
 OString getElementUpdated();
@@ -47,9 +46,7 @@ OString getElementUpdated();
 [out]If true then the respective structure of elements was added and the
 document needs to be saved.
  */
-void createSettingsStructure(
-xmlDoc * document, bool * bNeedsSave);
-
+void createSettingsStructure(xmlDoc* document, bool* bNeedsSave);
 
 /** represents the settings saved in the /java/javaInfo element.
 It is used within class NodeJava which determines the settings
@@ -91,12 +88,12 @@ public:
 If javaInfo@xsi:nil = true then member bNil is set to true
 and no further elements are read.
  */
-void loadFromNode(xmlDoc * pDoc,xmlNode * pJavaInfo);
+void loadFromNode(xmlDoc* pDoc, xmlNode* pJavaInfo);
 /** The attribute nil will be set to false. The function gets the value
 javaSettings/updated from the javavendors.xml and writes it to
 javaInfo@vendorUpdate in javasettings.xml
  */
-void writeToNode(xmlDoc * pDoc, xmlNode * pJavaInfo) const;
+void writeToNode(xmlDoc* pDoc, xmlNode* pJavaInfo) const;
 
 /** returns NULL if javaInfo is nil.
  */
@@ -116,9 +113,13 @@ public:
 class NodeJava
 {
 public:
-enum Layer { USER, SHARED };
-private:
+enum Layer
+{
+USER,
+SHARED
+};
 
+private:
 /** creates settings file and fills it with default values.
 
 When this function is called then it creates the
@@ -147,7 +148,7 @@ private:
 
 /** Verifies if the respective settings file exist.
  */
-static jfw::FileStatus checkSettingsFileStatus(OUString const & sURL);
+static jfw::FileStatus checkSettingsFileStatus(OUString const& sURL);
 
 /** Determines the layer for which the instance the loads and writes the
 data.
@@ -164,7 +165,7 @@ private:
 If /java/userClassPath@xsi:nil == true then the value is uninitialized
 after a call to load().
 */
-std::optional< OUString> m_userClassPath;
+std::optional m_userClassPath;
 /** User configurable option.  /java/javaInfo
 If /java/javaInfo@xsi:nil == true then the value is uninitialized
 after a call to load.
@@ -174,15 +175,14 @@ private:
 If /java/vmParameters@xsi:nil == true then the value is uninitialized
 after a call to load.
 */
-std::optional< ::std::vector< OUString> > m_vmParameters;
+std::optional<::std::vector> m_vmParameters;
 /** User configurable option. /java/jreLocations
 If /java/jreLocations@xsi:nil == true then the value is uninitialized
 after a call to load.
 */
-std::optional< ::std::vector< OUString> > m_JRELocations;
+std::optional<::std::vector> m_JRELocations;
 
 public:
-
 explicit NodeJava(Layer theLayer);
 
 /** sets m_enabled.
@@ -192,14 +192,14 @@ public:
 
 /** sets m_sUserClassPath. See setEnabled.
  */
-void setUserClassPath(const OUString & sClassPath);
+void setUserClassPath(const OUString& sClassPath);
 
 /** sets m_aInfo. See setEnabled.
 @param bAutoSelect
 true- called by jfw_setSelectedJRE
 false called by jfw_findAndSelectJRE
  */
-void setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect);
+void setJavaInfo(const JavaInfo* pInfo, bool bAutoSelect);
 
 /** sets the /java/vmParameters/param elements.
 When this method all previous values are removed and replaced
@@ -207,12 +207,12 @@ public:
 /java/vmParameters@xsi:nil will be set to true when write() is
 called.
  

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

2020-09-17 Thread Jan-Marek Glogowski (via logerrit)
 jvmfwk/inc/vendorbase.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 451f346d0b918dcc83c3209deab7ff3ed0aa4ee9
Author: Jan-Marek Glogowski 
AuthorDate: Mon Aug 3 07:08:56 2020 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Thu Sep 17 09:24:12 2020 +0200

jvmfwk: add vendorbase entry for Windows Arm64

Change-Id: Iea89befded02ecfd7513cc3d8f116dd6ac2913be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102859
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index df536bc3477e..7e98a2409c35 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -39,6 +39,8 @@ namespace jfw_plugin
 #define JFW_PLUGIN_ARCH "sparc"
 #elif defined X86_64
 #define JFW_PLUGIN_ARCH "amd64"
+#elif defined ARM64
+#define JFW_PLUGIN_ARCH "arm64"
 #elif defined INTEL
 #define JFW_PLUGIN_ARCH "i386"
 #elif defined POWERPC64
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-07 Thread Thorsten Behrens (via logerrit)
 jvmfwk/inc/fwkutil.hxx  |2 
 jvmfwk/source/framework.cxx |  103 
 jvmfwk/source/fwkutil.cxx   |   48 
 3 files changed, 10 insertions(+), 143 deletions(-)

New commits:
commit 6ba74150866d71469827de9f4f19268dfa7db137
Author: Thorsten Behrens 
AuthorDate: Wed May 6 23:45:55 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu May 7 15:56:06 2020 +0200

jfw::isAccessibilitySupportDesired is obsolete

There's no platform left that would require java accessibility.

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

diff --git a/jvmfwk/inc/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx
index f2f6fcbdfb30..60ffa9fe89d0 100644
--- a/jvmfwk/inc/fwkutil.hxx
+++ b/jvmfwk/inc/fwkutil.hxx
@@ -89,8 +89,6 @@ enum FileStatus
  */
 FileStatus checkFileURL(const OUString & path);
 
-bool isAccessibilitySupportDesired();
-
 }
 #endif
 
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 67b65acb8a5c..d008b5d16ab2 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -153,32 +153,6 @@ javaFrameworkError jfw_startVM(
 if (!aInfo)
 return JFW_E_NO_SELECT;
 
-#ifdef _WIN32
-//Because on Windows there is no system setting that we can 
use to determine
-//if Assistive Technology Tool support is needed, we ship a 
.reg file that the
-//user can use to create a registry setting. When the user 
forgets to set
-//the key before he starts the office then a JRE may be 
selected without access bridge.
-//When he later sets the key then we select a JRE with 
accessibility support but
-//only if the user has not manually changed the selected JRE 
in the options dialog.
-if (jfw::isAccessibilitySupportDesired())
-{
-// If no JRE has been selected then we do not select one. 
This function shall then
-//return JFW_E_NO_SELECT
-if (aInfo &&
-(aInfo->nFeatures & JFW_FEATURE_ACCESSBRIDGE) == 0)
-{
-//has the user manually selected a JRE?
-if (settings.getJavaInfoAttrAutoSelect())
-{
-// if not then the automatism has previously 
selected a JRE
-//without accessibility support. We return 
JFW_E_NO_SELECT
-//to cause that we search for another JRE. The 
search code will
-//then prefer a JRE with accessibility support.
-return JFW_E_NO_SELECT;
-}
-}
-}
-#endif
 //check if the javavendors.xml has changed after a Java was 
selected
 OString sVendorUpdate = jfw::getElementUpdated();
 
@@ -304,12 +278,7 @@ javaFrameworkError 
jfw_findAndSelectJRE(std::unique_ptr *pInfo)
 osl::MutexGuard guard(jfw::FwkMutex::get());
 if (jfw::getMode() == jfw::JFW_MODE_DIRECT)
 return JFW_E_DIRECT_MODE;
-sal_uInt64 nFeatureFlags = 0;
 std::unique_ptr aCurrentInfo;
-//Determine if accessibility support is needed
-bool bSupportAccessibility = jfw::isAccessibilitySupportDesired();
-nFeatureFlags = bSupportAccessibility ?
-JFW_FEATURE_ACCESSBRIDGE : 0;
 
 
 // 'bInfoFound' indicates whether a Java installation has been found
@@ -327,13 +296,7 @@ javaFrameworkError 
jfw_findAndSelectJRE(std::unique_ptr *pInfo)
 aVendorSettings, &aCurrentInfo, infos)
 == javaPluginError::NONE)
 {
-// compare features
-// if the user does not require any features (nFeatureFlags = 0)
-// or the Java installation provides all features, then this 
installation is used
-if ((aCurrentInfo->nFeatures & nFeatureFlags) == nFeatureFlags)
-{
-bInfoFound = true;
-}
+bInfoFound = true;
 }
 
 // if no Java installation providing all features was detected by 
using JAVA_HOME,
@@ -345,24 +308,9 @@ javaFrameworkError 
jfw_findAndSelectJRE(std::unique_ptr *pInfo)
 aVendorSettings, vecJavaInfosFromPath, infos)
 == javaPluginError::NONE)
 {
-for (auto & pJInfo: vecJavaInfosFromPath)
-{
-// if the current Java installation implements all 
required features: use it
-if ((pJInfo->nFeatures & nFeatureFlags) == nFeatureFlags)
-{
-aCurrentInfo = std::move(pJInfo);
-bInfoFound 

[Libreoffice-commits] core.git: jvmfwk/inc jvmfwk/plugins jvmfwk/source solenv/clang-format

2019-04-09 Thread Stephan Bergmann (via logerrit)
 jvmfwk/inc/fwkbase.hxx  |   11 
 jvmfwk/inc/libxmlutil.hxx   |4 
 jvmfwk/inc/vendorplugin.hxx |   94 +-
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |  109 ++-
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx  |7 
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx|   18 -
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx|5 
 jvmfwk/source/elements.cxx  |4 
 jvmfwk/source/framework.cxx |  273 ++--
 jvmfwk/source/fwkbase.cxx   |   18 +
 jvmfwk/source/libxmlutil.cxx|2 
 solenv/clang-format/blacklist   |4 
 12 files changed, 191 insertions(+), 358 deletions(-)

New commits:
commit 3d27b2fa9c5a03f78e5145377402f8a88e3da1be
Author: Stephan Bergmann 
AuthorDate: Tue Apr 9 14:51:54 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 9 22:31:17 2019 +0200

tdf#124503: Support JRE installations with unknown java.vendor property

After recent additions of 61c4f96d6ae6a80370774e53287edb27cbce8067 "Support
AdoptOpenJDK" and 41507db590b24e1b9b45d95cad55c71ba2e4091d "Support Amazon
Corretto" to our hard-coded list, there is now reports that at least Debian 
and
Ubuntu tried to distribute versions of OpenJDK with the java.vendor propety 
set
to string like "Debian" or "Ubuntu".  Instead of trying to catch up with an
ever-growing hard-coded list, it is probably better to stop relying 
exclusively
on such a hard-coded list, and for unknown vendor values, try out whether 
the
SunInfo backend (which supports the "generic" OpenJDK) would be able to 
handle
the given JRE.  (For simplicity, assume that any versions of such JREs are
supported.  Our baseline is Java 6, and there are unlikely any older 
versions of
JREs from unknown vendors out there.  If this turns out to be problematic, 
we
could include information about problematic vendors after all, or add a 
general
check that JREs from unknown vendors are at least Java 6.)

Many functions in jvmfwk/inc/vendorplugin.hxx that used to take a set of
sVendor/sMinVersion/sMaxVerison/arExcludeList paramters had to be revised to
take a vendorSettings parameter instead, and
VendorSettings::getVersionInformation has been changed to return a
boost::optional, so that unknown vendors can be handled gracefully.

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

diff --git a/jvmfwk/source/fwkbase.hxx b/jvmfwk/inc/fwkbase.hxx
similarity index 93%
rename from jvmfwk/source/fwkbase.hxx
rename to jvmfwk/inc/fwkbase.hxx
index b3779cda96b6..8fe077b79a28 100644
--- a/jvmfwk/source/fwkbase.hxx
+++ b/jvmfwk/inc/fwkbase.hxx
@@ -16,10 +16,15 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
-#define INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
+#ifndef INCLUDED_JVMFWK_INC_FWKBASE_HXX
+#define INCLUDED_JVMFWK_INC_FWKBASE_HXX
+
+#include 
+
+#include 
 
 #include 
+#include "elements.hxx"
 #include "libxmlutil.hxx"
 
 namespace jfw
@@ -34,7 +39,7 @@ class VendorSettings
 public:
 VendorSettings();
 
-VersionInfo getVersionInformation(const OUString & sVendor) const;
+boost::optional getVersionInformation(const OUString & 
sVendor) const;
 
 ::std::vector< OUString> getSupportedVendors() const;
 };
diff --git a/jvmfwk/source/libxmlutil.hxx b/jvmfwk/inc/libxmlutil.hxx
similarity index 96%
rename from jvmfwk/source/libxmlutil.hxx
rename to jvmfwk/inc/libxmlutil.hxx
index 8a58280b406d..078d285ac78f 100644
--- a/jvmfwk/source/libxmlutil.hxx
+++ b/jvmfwk/inc/libxmlutil.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_JVMFWK_SOURCE_LIBXMLUTIL_HXX
-#define INCLUDED_JVMFWK_SOURCE_LIBXMLUTIL_HXX
+#ifndef INCLUDED_JVMFWK_INC_LIBXMLUTIL_HXX
+#define INCLUDED_JVMFWK_INC_LIBXMLUTIL_HXX
 
 #include 
 #include 
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index f370f1123375..0aa6d84276e3 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -28,10 +28,10 @@
 
 #include 
 #include 
-#include 
-#include "elements.hxx"
 #include "vendorbase.hxx"
 
+namespace jfw { class VendorSettings; }
+
 /**
@file

@@ -56,7 +56,6 @@ enum class javaPluginError
 WrongVersionFormat,
 FailedVersion,
 NoJre,
-WrongVendor,
 WrongArch,
 VmCreationFailed
 };
@@ -64,26 +63,14 @@ enum class javaPluginError
 
 /** obtains information about installations of Java Runtime Environments 
(JREs).
 
-The function gathers inform

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

2018-10-14 Thread Libreoffice Gerrit user
 jvmfwk/inc/vendorbase.hxx|6 --
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |   18 +-
 2 files changed, 1 insertion(+), 23 deletions(-)

New commits:
commit 7758115d15ded2afd81946df0865ecc831b179aa
Author: Arnaud Versini 
AuthorDate: Sun Oct 14 09:27:32 2018 +0200
Commit: Noel Grandin 
CommitDate: Sun Oct 14 17:13:25 2018 +0200

Remove useless constructor and destructor

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

diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index b2ae34915459..02684a62b675 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -85,13 +85,7 @@ OpenJDK at least, but probably not true for Lemotes JDK */
 class MalformedVersionException : public std::exception
 {
 public:
-MalformedVersionException();
-
-MalformedVersionException(const MalformedVersionException &);
-
 virtual ~MalformedVersionException() override;
-
-MalformedVersionException & operator =(const MalformedVersionException &);
 };
 
 class VendorBase: public salhelper::SimpleReferenceObject
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 5aaf385ecc69..254f17e16de9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -31,23 +31,7 @@ using namespace osl;
 namespace jfw_plugin
 {
 
-MalformedVersionException::MalformedVersionException()
-{}
-
-MalformedVersionException::MalformedVersionException(
-const MalformedVersionException & )
-{}
-
-MalformedVersionException::~MalformedVersionException()
-{}
-
-MalformedVersionException &
-MalformedVersionException::operator =(
-const MalformedVersionException &)
-{
-return *this;
-}
-
+MalformedVersionException::~MalformedVersionException() = default;
 
 VendorBase::VendorBase(): m_bAccessibility(false)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-26 Thread Libreoffice Gerrit user
 jvmfwk/inc/elements.hxx|1 -
 jvmfwk/source/elements.cxx |4 
 2 files changed, 5 deletions(-)

New commits:
commit 2b4b94e8f0b7a8484ce70c701580b5a20fd0d14d
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 11:38:32 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 26 15:26:15 2018 +0200

jvmfwk: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but may prevent implicitly declared copy
functions from being defined as non-deleted in the future.  (Even if a dtor 
was
declared non-inline in an include file, the apparently-used 
implicitly-defined
copy functions are already inline, so why bother with a non-inline dtor.)

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

diff --git a/jvmfwk/inc/elements.hxx b/jvmfwk/inc/elements.hxx
index eb174a4be3e9..5b540c567717 100644
--- a/jvmfwk/inc/elements.hxx
+++ b/jvmfwk/inc/elements.hxx
@@ -58,7 +58,6 @@ class CNodeJavaInfo
 {
 public:
 CNodeJavaInfo();
-~CNodeJavaInfo();
 
 /** if true, then javaInfo is empty. When writeToNode is called
 then all child elements are deleted.
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index ff083373f553..24c60e8379c8 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -694,10 +694,6 @@ CNodeJavaInfo::CNodeJavaInfo() :
 {
 }
 
-CNodeJavaInfo::~CNodeJavaInfo()
-{
-}
-
 void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
 {
 OString sExcMsg("[Java framework] Error in function 
NodeJavaInfo::loadFromNode "
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-04-11 Thread Stephan Bergmann
 jvmfwk/inc/vendorplugin.hxx |   13 ++---
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   20 ++--
 2 files changed, 8 insertions(+), 25 deletions(-)

New commits:
commit 1c1d29027bee64177ec3b14cb8e10df03e2ce8d2
Author: Stephan Bergmann 
Date:   Tue Apr 11 21:13:31 2017 +0200

Assert obvious preconditions instead of returning javaPluginError:InvalidArg

Change-Id: I93bb3aaa0106bce98995f843ee036c9570f6aaf0

diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index 6bae6370c710..d4febd726d18 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -101,9 +101,7 @@ enum class javaPluginError
 @return
 javaPluginError::NONE the function ran successfully.
 javaPluginError::Error an error occurred during execution.
-javaPluginError::InvalidArg an argument was not valid. For example
-nSizeExcludeList is greater null but 
arExcludeList
-is NULL or NULL pointer were passed for at least on of the strings.
+javaPluginError::InvalidArg an argument was not valid.
 javaPluginError::WrongVersionFormat the version strings in
 sMinVersion,sMaxVersion,arExcludeList are not recognized as 
valid
 version strings.
@@ -148,9 +146,7 @@ javaPluginError jfw_plugin_getAllJavaInfos(
@return
javaPluginError::NONE the function ran successfully.
javaPluginError::Error an error occurred during execution.
-   javaPluginError::InvalidArg an argument was not valid. For example
-nSizeExcludeList is greater null but 
arExcludeList
-is NULL, NULL pointer were passed for at least on of the strings, sLocation
+   javaPluginError::InvalidArg an argument was not valid. For example, 
sLocation
 is an empty string.
javaPluginError::WrongVersionFormat the version strings in
 sMinVersion,sMaxVersion,arExcludeList are not recognized as 
valid
@@ -191,8 +187,6 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
 
@return
javaPluginError::NONE the function ran successfully.
-   javaPluginError::InvalidArg an argument was not valid, for example
-ppInfo is an invalid pointer.
javaPluginError::NoJre no suitable JRE could be detected at the given 
location. However, that
does not mean necessarily that there is no JRE. There could be a JRE but it 
has
a vendor which is not supported by this API implementation or it does not
@@ -283,9 +277,6 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
 javaPluginError::Error an error occurred during execution.
 javaPluginError::WrongVendor the JavaInfo object was not 
created
 in by this library and the VM cannot be started.
-javaPluginError::InvalidArg an argument was not valid. For example
-pInfo or , ppVM or ppEnv are NULL.
-
 JFW_PLUGIN_E_VM_CREATION_FAILED a VM could not be created. The error was 
caused
 by the JRE.
  */
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 84e60a9cf254..d237de95451a 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -306,16 +306,12 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 sal_Int32 *nLenInfoList,
 std::vector> & infos)
 {
-OSL_ASSERT(parJavaInfo);
-OSL_ASSERT(nLenInfoList);
-if (!parJavaInfo || !nLenInfoList)
-return javaPluginError::InvalidArg;
+assert(parJavaInfo);
+assert(nLenInfoList);
 
 //nLenlist contains the number of elements in arExcludeList.
 //If no exclude list is provided then nLenList must be 0
-OSL_ASSERT( ! (arExcludeList == nullptr && nLenList > 0));
-if (arExcludeList == nullptr && nLenList > 0)
-return javaPluginError::InvalidArg;
+assert( ! (arExcludeList == nullptr && nLenList > 0));
 
 OSL_ASSERT(!sVendor.isEmpty());
 if (sVendor.isEmpty())
@@ -371,17 +367,14 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
 sal_Int32  nLenList,
 JavaInfo ** ppInfo)
 {
-if (!ppInfo)
-return javaPluginError::InvalidArg;
+assert(ppInfo != nullptr);
 OSL_ASSERT(!sPath.isEmpty());
 if (sPath.isEmpty())
 return javaPluginError::InvalidArg;
 
 //nLenlist contains the number of elements in arExcludeList.
 //If no exclude list is provided then nLenList must be 0
-OSL_ASSERT( ! (arExcludeList == nullptr && nLenList > 0));
-if (arExcludeList == nullptr && nLenList > 0)
-return javaPluginError::InvalidArg;
+assert( ! (arExcludeList == nullptr && nLenList > 0));
 
 OSL_ASSERT(!sVendor.isEmpty());
 if (sVendor.isEmpty())
@@ -407,8 +400,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
 std::vector> const& vecVendorInfos,
 JavaInfo ** ppInfo, std::vector> & infos)
 {
-if (!ppInfo)
-return javaPluginError::InvalidArg;
+assert(ppInfo);
 
 std::vector> infoJavaHome;
 addJavaInfoFromJavaHome(infos, infoJavaHome);
_

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

2017-03-13 Thread Samuel Mehrbrodt
 jvmfwk/inc/vendorbase.hxx   |2 +
 jvmfwk/inc/vendorplugin.hxx |1 
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |6 +++-
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx|   26 +++-
 4 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 9143dd4ebe37b608e43d04434cf831624bf55b65
Author: Samuel Mehrbrodt 
Date:   Thu Mar 9 20:43:09 2017 +0100

Related tdf#54443 List only matching JREs

I.e. show only 64bit JRE for 64bit LO and 32bit JRE for 32bit LO

Change-Id: Id5e890637c7e1014bcb4e6fdd9ed9a33765112d5
Reviewed-on: https://gerrit.libreoffice.org/35026
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index 2a24c95..c9ebcb2 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -133,6 +133,7 @@ public:
 const OUString & getRuntimeLibrary() const;
 const OUString & getLibraryPath() const;
 bool supportsAccessibility() const;
+bool isValidArch() const;
  /* determines if prior to running java something has to be done,
 like setting the LD_LIBRARY_PATH. This implementation checks
 if an LD_LIBRARY_PATH (getLD_LIBRARY_PATH) needs to be set and
@@ -178,6 +179,7 @@ protected:
 OUString m_sHome;
 OUString m_sRuntimeLibrary;
 OUString m_sLD_LIBRARY_PATH;
+OUString m_sArch;
 bool m_bAccessibility;
 
 
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index c9a2ccb..8d019f1 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -55,6 +55,7 @@ enum class javaPluginError
 FailedVersion,
 NoJre,
 WrongVendor,
+WrongArch,
 VmCreationFailed
 };
 
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 63791bc..d69b439 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -227,6 +227,10 @@ javaPluginError checkJavaVersionRequirements(
 rtl_uString * * arExcludeList,
 sal_Int32  nLenList)
 {
+if (!aVendorInfo->isValidArch())
+{
+return javaPluginError::WrongArch;
+}
 if (!sMinVersion.isEmpty())
 {
 try
@@ -334,7 +338,7 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 javaPluginError err = checkJavaVersionRequirements(
 cur, sMinVersion, sMaxVersion, arExcludeList, nLenList);
 
-if (err == javaPluginError::FailedVersion)
+if (err == javaPluginError::FailedVersion || err == 
javaPluginError::WrongArch)
 continue;
 else if (err == javaPluginError::WrongVersionFormat)
 return err;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 9b580cc..ef9da17 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -62,12 +62,14 @@ bool VendorBase::initialize(vector 
> props)
 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;
 bool bHome = false;
 bool bAccess = false;
+bool bArch = false;
 
 typedef vector >::const_iterator it_prop;
 for (it_prop i = props.begin(); i != props.end(); ++i)
@@ -103,6 +105,11 @@ bool VendorBase::initialize(vector > props)
bHome = true;
 #endif
 }
+else if (!bArch && sArchProperty.equals(i->first))
+{
+m_sArch = i->second;
+bArch = true;
+}
 else if (!bAccess && sAccessProperty.equals(i->first))
 {
 if (!i->second.isEmpty())
@@ -115,7 +122,7 @@ bool VendorBase::initialize(vector 
> props)
 //must search through all properties.
 
 }
-if (!bVersion || !bVendor || !bHome)
+if (!bVersion || !bVendor || !bHome || !bArch)
 return false;
 
 // init m_sRuntimeLibrary
@@ -201,6 +208,23 @@ const OUString & VendorBase::getRuntimeLibrary() const
 {
 return m_sRuntimeLibrary;
 }
+
+bool VendorBase::isValidArch() const
+{
+// Warning: These values come from the "os.arch" property.
+// 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 _WIN32
+return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
+#elif defined _WIN64
+return m_sArch == "amd64" || m_sArch == "x86_64";
+#else
+(void)this;
+return true;
+#endif
+}
+
 bool VendorBase::supportsAccessibility() const
 

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

2016-12-24 Thread tamsil1amani3
 jvmfwk/inc/elements.hxx |  347 
 jvmfwk/inc/fwkutil.hxx  |   97 
 jvmfwk/inc/vendorplugin.hxx |2 
 jvmfwk/source/elements.hxx  |  347 
 jvmfwk/source/fwkutil.hxx   |   97 
 5 files changed, 445 insertions(+), 445 deletions(-)

New commits:
commit 7a07610588893a2061eaafead36cdd8eabb2b52b
Author: tamsil1amani3 
Date:   Sun Dec 25 03:55:01 2016 +0530

tdf#95416 Fix include file

Moved elements.hxx and fwkutil.hxx to jvmfwk/inc and changed the #include 
line in vendorplugin.hxx

Change-Id: Ida7395e952c482af92c0561a7756be7cd0578b9f
Reviewed-on: https://gerrit.libreoffice.org/32415
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/inc/elements.hxx
similarity index 100%
rename from jvmfwk/source/elements.hxx
rename to jvmfwk/inc/elements.hxx
diff --git a/jvmfwk/source/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx
similarity index 100%
rename from jvmfwk/source/fwkutil.hxx
rename to jvmfwk/inc/fwkutil.hxx
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index 8df13b1..c9a2ccb 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -27,7 +27,7 @@
 #include "jni.h"
 #include 
 #include 
-#include "../source/elements.hxx"
+#include "elements.hxx"
 #include 
 
 /**
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-07-22 Thread Caolán McNamara
 jvmfwk/inc/vendorbase.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a3b3c5fcd7efd3e33a0f0078bd6fd23689c45c41
Author: Caolán McNamara 
Date:   Fri Jul 22 21:02:17 2016 +0100

Related: tdf#101057 inherit MalformedVersionException from std::exception

so we don't get std::terminate on MacOSX if its thrown up to
JavaVirtualMachine::getJavaVM

Change-Id: I1c6b79bf16cbaa66b8f79d495239e301d3ca58de

diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index da8a3e7..8f4fab5 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -82,7 +82,7 @@ OpenJDK at least, but probably not true for Lemotes JDK */
 #endif // SPARC, INTEL, POWERPC, MIPS, MIPS64, ARM, IA64, M68K, HPPA, ALPHA
 
 
-class MalformedVersionException
+class MalformedVersionException : public std::exception
 {
 public:
 MalformedVersionException();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-10 Thread Heiher
 jvmfwk/inc/vendorbase.hxx|   10 --
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx |2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0f6edce22b0424d99342b73adafcaf688f044139
Author: Heiher 
Date:   Tue Jul 7 17:49:01 2015 +0800

jvmfwk: pluginlib: Add support for mips64.

Change-Id: I525266468ae2ef04976d7835cc22c930293a0dc3
Reviewed-on: https://gerrit.libreoffice.org/16911
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index a01db56..7dc32cd 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -55,6 +55,12 @@ namespace jfw_plugin
 OpenJDK at least, but probably not true for Lemotes JDK */
 #  define JFW_PLUGIN_ARCH "mipsel"
 #endif
+#elif defined MIPS64
+#ifdef OSL_BIGENDIAN
+#  define JFW_PLUGIN_ARCH "mips64"
+#else
+#  define JFW_PLUGIN_ARCH "mips64el"
+#endif
 #elif defined S390X
 #define JFW_PLUGIN_ARCH "s390x"
 #elif defined S390
@@ -71,9 +77,9 @@ OpenJDK at least, but probably not true for Lemotes JDK */
 #define JFW_PLUGIN_ARCH "alpha"
 #elif defined AARCH64
 #define JFW_PLUGIN_ARCH "aarch64"
-#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA
+#else // SPARC, INTEL, POWERPC, MIPS, MIPS64, ARM, IA64, M68K, HPPA, ALPHA
 #error unknown platform
-#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA
+#endif // SPARC, INTEL, POWERPC, MIPS, MIPS64, ARM, IA64, M68K, HPPA, ALPHA
 
 
 class MalformedVersionException
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index 07ec21e..9abc978 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -53,6 +53,8 @@ char const* const* GnuInfo::getJavaExePaths(int * size)
 
 #if defined(MIPS) && defined(OSL_LITENDIAN)
 #define GCJ_JFW_PLUGIN_ARCH "mipsel"
+#elif defined(MIPS64) && defined(OSL_LITENDIAN)
+#define GCJ_JFW_PLUGIN_ARCH "mips64el"
 #else
 #define GCJ_JFW_PLUGIN_ARCH JFW_PLUGIN_ARCH
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-15 Thread Stephan Bergmann
 jvmfwk/inc/vendorplugin.hxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 72d8747ad95dbde1d3511b0fe48cd72999a43faf
Author: Stephan Bergmann 
Date:   Mon Dec 15 16:51:11 2014 +0100

Remove obsolete comment

Change-Id: I66dcf6284bd1b7afb1c60c8382052e06072b

diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index 25d9246..f96b094 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -44,11 +44,6 @@
version and vendor as one entity. One without the other does not guarantee
the existence of a particular set of features or bug fixes. An 
implementation
of this API may support multiple vendors. 
-   
-   Libraries which implement this interface will be dynamically loaded and
-   unloaded by the java framework (jvmfwk/framework.h). Therefore they must not
-   keep global variables.
-   
  */
 
 typedef enum
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-11-19 Thread Michael Weghorn
 jvmfwk/inc/vendorplugin.hxx |   22 ++
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   73 +++-
 jvmfwk/source/framework.cxx |   38 +-
 3 files changed, 58 insertions(+), 75 deletions(-)

New commits:
commit 772a36932e4803beaffdad87200e0162e1020e94
Author: Michael Weghorn 
Date:   Tue Nov 18 17:40:13 2014 +

changed type of parameters from rtl_uString to OUString

changed type of several parameters of the functions
jfw_plugin_getAllJavaInfos and jfw_plugin_getJavaInfoByPath
from rtl_uString to OUString

Change-Id: I80feb311542e6ccded9f9924f800c75a7e14a1e7
Signed-off-by: Stephan Bergmann 

diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index 02ea040..3fd4d35 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -36,7 +36,7 @@
what version a JRE must have then it relies on certain features and bug
fixes of that version. Because a version 1.4.2_1 from vendor X may contain
different fixes as the same version from vendor Y it is important to see
-   version an vendor as one entity. One without the other does not guarantee
+   version and vendor as one entity. One without the other does not guarantee
the existence of a particular set of features or bug fixes. An 
implementation
of this API may support multiple vendors. 

@@ -83,11 +83,9 @@ typedef enum
 [in] only JREs from this vendor are examined. This parameter always 
contains
 a vendor string. That is, the string it is not empty.
 @param sMinVersion
-[in] represents the minimum version of a JRE. The string can be empty 
but
-a null pointer is not allowed.
+[in] represents the minimum version of a JRE. The string can be empty.
 @param sMaxVersion
-[in] represents the maximum version of a JRE. The string can be empty 
but
-a null pointer is not allowed.
+[in] represents the maximum version of a JRE. The string can be empty.
 @param arExcludeList
 [in] contains a list of "bad" versions. JREs which have one 
of these
 versions must not be returned by this function. It can be NULL.
@@ -111,9 +109,9 @@ typedef enum
 version strings.
  */
 javaPluginError jfw_plugin_getAllJavaInfos(
-rtl_uString *sVendor,
-rtl_uString *sMinVersion,
-rtl_uString *sMaxVersion,
+OUString const& sVendor,
+OUString const& sMinVersion,
+OUString const& sMaxVersion,
 rtl_uString * * arExcludeList,
 sal_Int32  nSizeExcludeList,
 JavaInfo*** parJavaInfo,
@@ -162,10 +160,10 @@ javaPluginError jfw_plugin_getAllJavaInfos(
a vendor which is not supported by this API implementation.
  */
 javaPluginError jfw_plugin_getJavaInfoByPath(
-rtl_uString *sLocation,
-rtl_uString *sVendor,
-rtl_uString *sMinVersion,
-rtl_uString *sMaxVersion,
+OUString const& sLocation,
+OUString const& sVendor,
+OUString const& sMinVersion,
+OUString const& sMaxVersion,
 rtl_uString * *arExcludeList,
 sal_Int32  nSizeExcludeList,
 JavaInfo ** ppInfo);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index dd6335e..d0dac26 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -210,11 +210,9 @@ extern "C" void JNICALL abort_handler()
 @param aVendorInfo
 [in]  the object to be inspected whether it meets the version 
requirements
 @param sMinVersion
-[in] represents the minimum version of a JRE. The string can be empty 
but
-a null pointer is not allowed.
+[in] represents the minimum version of a JRE. The string can be empty.
 @param sMaxVersion
-[in] represents the maximum version of a JRE. The string can be empty 
but
-a null pointer is not allowed.
+[in] represents the maximum version of a JRE. The string can be empty.
 @param arExcludeList
 [in] contains a list of "bad" versions. JREs which have one 
of these
 versions must not be returned by this function. It can be NULL.
@@ -232,19 +230,16 @@ extern "C" void JNICALL abort_handler()
  */
 javaPluginError checkJavaVersionRequirements(
 rtl::Reference const & aVendorInfo,
-rtl_uString *sMinVersion,
-rtl_uString *sMaxVersion,
+OUString const& sMinVersion,
+OUString const& sMaxVersion,
 rtl_uString * * arExcludeList,
 sal_Int32  nLenList)
 {
-OUString ouMinVer(sMinVersion);
-OUString ouMaxVer(sMaxVersion);
-
-if (!ouMinVer.isEmpty())
+if (!sMinVersion.isEmpty())
 {
 try
 {
-if (aVendorInfo->compareVersions(ouMinVer) < 0)
+if (aVendorInfo->compareVersions(sMinVersion) < 0)
 return JFW_PLUGIN_E_FAILED_VERSION;
 }
 catch (MalformedVersionException&)
@@ -253,17 +