summaryrefslogtreecommitdiff
path: root/jvmfwk/source/framework.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-03-08use more string_viewNoel Grandin1-12/+18
found by tweaking the stringview loplugin Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-20Extended loplugin:ostr: jvmfwkStephan Bergmann1-1/+1
Change-Id: Ibb17d89a5ed618b4d5e6be9ac9ee89e2751c3ed7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159696 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-21Allow bootstrap variables in Java user classpath settings, 2nd trySamuel Mehrbrodt1-2/+53
Add a second mode: When a classpath starts with '$', bootstrap variables are recognized. The classpath must then be provided as URL, not native path. Change-Id: Idcc229a2b4e9a512b0e712ea932a6e4293907db3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152899 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-06-08Revert "Allow bootstrap variables in Java user classpath settings"Samuel Mehrbrodt1-4/+1
This breaks existing paths which contain "\" or "$". This reverts commit cfc2376f804f13eb562f39182cb24fe7dc61d6ef. Change-Id: Ia58df0a4f061f45140575e89231bd18d044a9bc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152604 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-05-25Allow bootstrap variables in Java user classpath settingsSamuel Mehrbrodt1-1/+4
This allows for relative paths to be configured as Java class path. Change-Id: Ie3e6bc3836fb316457e5c9f11dfb77d2fcd49ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152271 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-09-19try harder to remove "OSL_PIPE" pipe on SIGTERMCaolán McNamara1-1/+6
a) When oosplash got SIGTERM it used SIGKILL on soffice.bin, (concealed behind osl_terminateProcess) so soffice.bin has no chance to cleanup. Try SIGTERM, followed by SIGKILL if that doesn't work, to give soffice.bin a chance. b) java intercepts SIGTERM so if JNI_CreateJavaVM was called then our SIGTERM handler doesn't get called. Add -Xrs to jvm args to avoid this. Change-Id: I09f93d8093bc7c094482eda73b4eadc5a6cebb83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140152 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-21Avoid unnecessary empty -Djava.class.path=Stephan Bergmann1-2/+6
Change-Id: Idcfe7321077b60381c0273910b1faeb444ef1fd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130242 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-27Recheck modules [i-l]* with IWYUGabor Kelemen1-0/+2
See tdf#42949 for motivation Change-Id: I758bb27e93779e3df21c463714e49354748f446f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128715 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-11-17Don't fail jfw_findAllJREs for just one JRE of WrongArchStephan Bergmann1-0/+2
...otherwise if one such JRE had found its way into a user's configuration, "Tools - Options... - LibreOffice - Advanced" would no longer show *any* JREs. Regression introduced with 9143dd4ebe37b608e43d04434cf831624bf55b65 "Related tdf#54443 List only matching JREs", which added WrongArch to the javaPluginError enum. Change-Id: I51fd47e585c6686be7a9282615c0978e4f6c460b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125396 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-16rtl::Static->thread-safe static in jvmfwkNoel Grandin1-16/+16
Change-Id: I049148d82eb306e8ba7fdc9f0cc650f45b05da0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125257 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-04Fix alternate JREs missing bin/ directory on java.library.pathSamuel Mehrbrodt1-0/+18
Exception looks like this: java stack trace: java.lang.UnsatisfiedLinkError: zulu11\bin\fontmanager.dll: Can't find depende nt libraries at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830) at java.base/java.lang.System.loadLibrary(System.java:1873) at java.desktop/sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:57) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/sun.font.FontManagerNativeLibrary.<clinit>(FontManagerNativeLibrary.java:32) at java.desktop/sun.font.SunFontManager$1.run(SunFontManager.java:279) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/sun.font.SunFontManager.<clinit>(SunFontManager.java:275) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at java.desktop/sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.ja va:189) at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnviron ment.java:223) at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnviron ment.java:251) Change-Id: I7a16bb5813d4c089ddb4de34a250280cf6fee137 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119880 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2020-10-22Only read Java settings files in application modeMichael Weghorn1-30/+35
The 'javasettings_${_OS}_${_ARCH}.xml' files are only meant to be used when the application mode of the Java framework is used, not in direct mode. From ure/source/README: > You can also use the > UNO_JAVA_JFW_JREHOME deployment variable to specify the location of a JDK/JRE > installation. For more information on this variable, see > http://udk.openoffice.org/common/man/spec/javavendorextension.sxw. From that http://udk.openoffice.org/common/man/spec/javavendorextension.sxw : > The direct mode of the framework is used within the build environment. > Java is needed there in order to register Java UNO components with the > regcomp tool. Direct mode means that no settings are written or read. > That is the parameters UNO_JAVA_JFW_USER_DATA and > UNO_JAVA_JFW_SHARED_DATA are not used. > [...] > Another example for using the direct mode is the SDK. The SDK uses the > libraries from the office installation. When an SDK is configured then > one specifies what Java is to be used. This Java shall then be used for > all task which require Java including registration of UNO components. In > order to override the java settings of the office the script which > prepares the SDK environment sets these environment variables: > UNO_JAVA_JFW_JREHOME=<file_URL_to_selected_Java> > UNO_JAVA_JFW_ENV_CLASSPATH=true > UNO_JAVA_JFW_VENDOR_SETTINGS=<file_URL_to_javavendors.xml_from_OOo> > By setting UNO_JAVA_JFW_JREHOME the framework is switched into direct mode > and the office settings are disregarded. Therefore, don't try to read the settings when using direct mode. This makes the relevant code path for accessing the settings conditional on 'jfw::JFW_MODE_APPLICATION' being used. Otherwise, using direct mode e.g. by starting LibreOffice using UNO_JAVA_JFW_JREHOME=file:///usr/lib/jvm/java-11-openjdk-amd64/ ./instdir/program/soffice --writer then going to the "Advanced" options in "Tools" -> "Options", where the Java settings reside would result in this SAL_WARN being triggered warn:jfw:10207:10207:jvmfwk/source/framework.cxx:119: [Java framework] Trying to access settings files in direct mode. and no JVM at all being shown in the list of available Java installations. Change-Id: I2b98d822aed2b160f970c50ca695a9f3beeacd34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104001 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: jvmfwkStephan Bergmann1-2/+2
Change-Id: I979e9142324df589229aafbb4a17f7495a79f0dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97594 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-22tdf#134167: jfw_plugin_getAllJavaInfos can successfully return empty listStephan Bergmann1-2/+1
Regression introduced with 6ba74150866d71469827de9f4f19268dfa7db137 "jfw::isAccessibilitySupportDesired is obsolete" Change-Id: I696f3240fa8760ae156ac3b8b1fd1fe42f81c539 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96821 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-15Drop the JVM "feature" concept supportStephan Bergmann1-5/+1
...now that 6ba74150866d71469827de9f4f19268dfa7db137 "jfw::isAccessibilitySupportDesired is obsolete" demonstrated that there is no more need for JFW_FEATURE_ACCESSBRIDGE, the sole feature that had been provided. * The javasettings_*.xml format still supports the <feature> tag, but it is ignored when reading and always written as "0". * There is no trace that "the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY" whose mention gets removed from jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java had ever been supported. (The only mention was 6873b3be47d71f94c38262003101576081acd241 "INTEGRATION: CWS jre5issues (1.3.18); FILE MERGED: 2005/01/18 12:48:48 jl 1.3.18.1: #i40879# in build environment the JRE is not tested for accessibility, because of potential X server problems" introducing that comment.) * The "Features" column is removed from the JRE table on the "LibreOffice - Advance" options page. Change-Id: I332d34b60548e7f2f852241ea8edfbee0ffcf510 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94329 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-07jfw::isAccessibilitySupportDesired is obsoleteThorsten Behrens1-93/+10
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 <Thorsten.Behrens@CIB.de>
2020-02-03tdf#96505: Get rid of cargo cult long integer literalsDesmin Alpaslan1-1/+1
Change-Id: Id64855e3879d21106930a4dc9c36b246deb3c6e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85818 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-19sal_Char->char in idlc..linguisticNoel Grandin1-1/+1
Change-Id: Ib30fe34123ad7e5d892e8db9c742e08c4ca8fcd2 Reviewed-on: https://gerrit.libreoffice.org/85477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-26tdf#42949 Fix IWYU warnings in jvmfwk/ & jvmaccess/Gabor Kelemen1-3/+3
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I6c1041f261ba5a6f81efd3dcbc12baf2746e1839 Reviewed-on: https://gerrit.libreoffice.org/71217 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-09tdf#124503: Support JRE installations with unknown java.vendor propertyStephan Bergmann1-180/+93
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 <sbergman@redhat.com>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov1-3/+2
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-06Add missing sal/log.hxx headersGabor Kelemen1-0/+1
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') in files formerly omitted for oversight or non-cxx extension Change-Id: I327c573f44076c6ccfecf737eafccba2da72e1bd Reviewed-on: https://gerrit.libreoffice.org/58600 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-12Keep strings alive again as necessaryStephan Bergmann1-0/+4
...fixing regression introduced with 49eb02f07a5af44da59008a238e828b4a9532bef "new loplugin:unusedvariablemore" Change-Id: Ib598d67add50031937c9c9f3e23ea16d0a1da107
2018-04-11new loplugin:unusedvariablemoreNoel Grandin1-2/+0
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28Don't pass empty option to JNI_CreateJavaVMStephan Bergmann1-6/+11
sUserClassPath may be empty (instead of containing "-Djava.class.path=...") here, which older versions of Java have apparently silently ignored. But Java 10 now fails with JNI_EINVAL (-6). (Happens e.g. during CppunitTest_dbaccess_hsqldb_test.) Change-Id: Ifd13222f0d0ae69547bd1a9fe0fd5eae47917d0a Reviewed-on: https://gerrit.libreoffice.org/51949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-23loplugin:includeform: jvmfwkStephan Bergmann1-8/+8
Change-Id: I7292ced23647692fdc85a3c234fb1469a91ad0ea
2017-10-13Use loop ranges in jvmfwkJulien Nabet1-18/+8
to simplify and avoid all the typedefs Change-Id: Ia14337dd71b55fc24f162b5436af76aeeb8d2575 Reviewed-on: https://gerrit.libreoffice.org/43346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-09-11clang-tidy modernize-use-emplace in hwpfilter..lotuswordproNoel Grandin1-2/+1
Change-Id: Ic11634ca28396fd156390c511087bae03bd5fb70 Reviewed-on: https://gerrit.libreoffice.org/42156 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06use OString::operator== in preference to ::equalsNoel Grandin1-1/+1
Change-Id: Ib291521963a791a9c6175964571e9d9895072acf Reviewed-on: https://gerrit.libreoffice.org/39646 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30cleanup some OString stuff in jvmfwkNoel Grandin1-31/+17
Change-Id: I80d221a348c4bd5fcec82cafc455a051237ae95d Reviewed-on: https://gerrit.libreoffice.org/38131 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-07revert OSL_ASSERT changesChris Sherlock1-3/+3
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert jvmfwk from OSL_ASSERT to assertChris Sherlock1-3/+3
Change-Id: Ie06633dd6a49ed9fc51dfb5e6066529020dcf268
2017-04-13Use std::unique_ptr<JavaInfo> in jfw_plugin_getAllJavaInfosStephan Bergmann1-32/+7
Change-Id: I2beb95c42c666a788a87a45f59bc15ccfcf25aa6
2017-04-13Use std::unique_ptr<JavaInfo> in jfw_plugin_getJavaInfoByPathStephan Bergmann1-9/+5
Change-Id: I3511eaa12bb689a374a775204a3480d7c667a915
2017-04-13Use std::unique_ptr<JavaInfo> in jfw_plugin_getJavaInfoFromJavaHomeStephan Bergmann1-6/+3
Change-Id: I8be48d1eec799f347a5edaa67837cf1bbf4d2cc3
2017-04-13Use std::unique_ptr<JavaInfo> in jfw_plugin_getJavaInfosFromPathStephan Bergmann1-22/+15
...thereby fixing a memory leak Change-Id: I1aa91eeb407987abcdaa5221f4abd447f881c5d2
2017-04-13Simplify jfw_findAllJREsStephan Bergmann1-123/+29
...dropping remaining uses of CJavaInfo Change-Id: I76afd5af927233712181f58b14fe6f4c1a9c15c2
2017-04-13Replace a use of CJavaInfo with std::unique_ptr<JavaInfo>Stephan Bergmann1-28/+23
Change-Id: Ib659d6edf362901a95cfb50ac008520805ad0fb0
2017-04-13Replace a use of CJavaInfo with std::unique_ptr<JavaInfo>Stephan Bergmann1-15/+11
Change-Id: I89cb19969285200a61c47d29e819a50845fa692b
2017-04-13More std::unique_ptr<JavaInfo> lifecycle managementStephan Bergmann1-2/+2
Change-Id: If53347633ec4b2f8c2b221ba2057e0c38fa97b67
2017-04-13Simplify passing options to jfw_startVMStephan Bergmann1-6/+8
Change-Id: Idac31e282fe4df69449298a03d491473e460c742 Reviewed-on: https://gerrit.libreoffice.org/36495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-13Removed duplicated includesAndrea Gelmini1-1/+0
No automatic tools. Manual checked and tested. Change-Id: Ife260fa4e1d786cf81f2917a901664cc54943754 Reviewed-on: https://gerrit.libreoffice.org/36371 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-12Remove unused jfw::VendorSettings instantiationsStephan Bergmann1-5/+0
Change-Id: I0af90fbb9eb77e5e65b29a79cc3b37af8cfc75e6
2017-04-12Remove unnecessary copyStephan Bergmann1-2/+0
Change-Id: Ib350999ddf3ed2753b9e615a07b963c459dc714b
2017-04-12Convert rtl_uString -> OUString in jfw_get/setVMParametersStephan Bergmann1-6/+4
Change-Id: I55f96873661f686cd9625d69523718ccb54659dc
2017-04-12Simplify jfw::VersionInfoStephan Bergmann1-10/+5
Change-Id: I2cc1071bbaf9c68fbd621d6c0c6953b7646b1a62
2017-04-12Convert some rtl_uString -> OUString in jvmfwkStephan Bergmann1-14/+8
Change-Id: I08de5cab29dabc6fd824d5df8bac12c8520a05ae
2017-04-11Calls to jvmfwk/framework.hxx must not pass in null, drop JFW_E_INVALID_ARGStephan Bergmann1-23/+12
Change-Id: Iff4b8ccc79e194f645791ac73818e3b677ae32a6
2017-04-11Fix missing derefStephan Bergmann1-1/+1
...lacking since recent f0454e72c1d1b11c3bcbacb23048a62fdecd037c "Use std::unique_ptr<JavaInfo> for lifecycle management in jvmfwk/framework.hxx" Change-Id: Ied39be52ccc8cbef48cdfb4933e4ac1914fd0fd3
2017-04-11sal_Bool -> boolStephan Bergmann1-1/+1
Change-Id: If632eb547aa5082ad13eac8c2ad39a1742309fc7