diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-02-21 11:55:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-02-21 15:37:27 +0100 |
commit | 5e8f64e50f97d39e83a3358697be14db03566878 (patch) | |
tree | 137530cc1516a071153f02b38794e8301ec39417 /jvmfwk/source | |
parent | d39f886ea541f71a09d1d7140c77852b01c847f0 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'jvmfwk/source')
-rw-r--r-- | jvmfwk/source/framework.cxx | 8 | ||||
-rw-r--r-- | jvmfwk/source/fwkbase.cxx | 3 |
2 files changed, 9 insertions, 2 deletions
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; |