From 927e66058a0a29dcb327c6751984e19373a476c2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 9 May 2024 13:37:42 +0200 Subject: [PATCH] loplugin:ostr in jvmfwk Change-Id: Ie21df5b25d15a15ba7a1660970ff7064bb8ec1d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167385 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../sunmajor/pluginlib/sunjavaplugin.cxx | 8 +++--- jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 8 +++--- jvmfwk/source/fwkbase.cxx | 28 +++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index 3ad5f79fbafc..6c31efb7adf4 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -106,8 +106,8 @@ OString getPluginJarPath( std::u16string_view sVersion) { OString ret; - OUString sName1("javaplugin.jar"); - OUString sName2("plugin.jar"); + OUString sName1(u"javaplugin.jar"_ustr); + OUString sName2(u"plugin.jar"_ustr); OUString sPath; if ( sVendor == u"Sun Microsystems Inc." ) { @@ -667,10 +667,10 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( //Setting the JAVA_HOME is needed for awt OUString sPathLocation; osl::FileBase::getSystemPathFromFileURL(pInfo->sLocation, sPathLocation); - osl_setEnvironment(OUString("JAVA_HOME").pData, sPathLocation.pData); + osl_setEnvironment(u"JAVA_HOME"_ustr.pData, sPathLocation.pData); #endif - OUString sSymbolCreateJava("JNI_CreateJavaVM"); + OUString sSymbolCreateJava(u"JNI_CreateJavaVM"_ustr); JNI_CreateVM_Type * pCreateJavaVM = reinterpret_cast(moduleRt.getFunctionSymbol(sSymbolCreateJava)); diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 6eb96d731c8f..1610188f55ac 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -388,9 +388,9 @@ bool getJavaProps(const OUString & exePath, //prepare the arguments sal_Int32 const cArgs = 3; - OUString arg1 = "-classpath";// + sClassPath; + OUString arg1 = u"-classpath"_ustr;// + sClassPath; OUString arg2 = sClassPath; - OUString arg3("JREProperties"); + OUString arg3(u"JREProperties"_ustr); rtl_uString *args[cArgs] = {arg1.pData, arg2.pData, arg3.pData}; oslProcess javaProcess= nullptr; @@ -1161,8 +1161,8 @@ void addJavaInfosDirScan( aDir.close(); } #else // MACOSX - OUString excMessage = "[Java framework] sunjavaplugin: " - "Error in function addJavaInfosDirScan in util.cxx."; + OUString excMessage = u"[Java framework] sunjavaplugin: " + "Error in function addJavaInfosDirScan in util.cxx."_ustr; int cJavaNames= SAL_N_ELEMENTS(g_arJavaNames); std::unique_ptr sarJavaNames(new OUString[cJavaNames]); OUString *arNames = sarJavaNames.get(); diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 8275359cebc8..197bc43dc08f 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -137,9 +137,9 @@ VersionInfo VendorSettings::getVersionInformation(std::u16string_view sVendor) c #if defined MACOSX && defined __aarch64__ "17", #else - "1.8.0", + u"1.8.0"_ustr, #endif - ""}; + u""_ustr}; } VersionInfo aVersionInfo; @@ -233,19 +233,19 @@ VersionInfo VendorSettings::getVersionInformation(std::u16string_view sVendor) c OUString BootParams::getUserData() { - return getParamFirstUrl("UNO_JAVA_JFW_USER_DATA"); + return getParamFirstUrl(u"UNO_JAVA_JFW_USER_DATA"_ustr); } OUString BootParams::getSharedData() { - return getParamFirstUrl("UNO_JAVA_JFW_SHARED_DATA"); + return getParamFirstUrl(u"UNO_JAVA_JFW_SHARED_DATA"_ustr); } OString BootParams::getClasspath() { OString sClassPath; OUString sCP; - if (Bootstrap()->getFrom( UNO_JAVA_JFW_CLASSPATH, sCP )) + if (Bootstrap()->getFrom( u"" UNO_JAVA_JFW_CLASSPATH ""_ustr, sCP )) { sClassPath = OUStringToOString(sCP, PathEncoding()); SAL_INFO( @@ -255,7 +255,7 @@ OString BootParams::getClasspath() } OUString sEnvCP; - if (Bootstrap()->getFrom( UNO_JAVA_JFW_ENV_CLASSPATH, sEnvCP )) + if (Bootstrap()->getFrom( u"" UNO_JAVA_JFW_ENV_CLASSPATH ""_ustr, sEnvCP )) { char * pCp = getenv("CLASSPATH"); if (pCp) @@ -274,7 +274,7 @@ OString BootParams::getClasspath() OUString BootParams::getVendorSettings() { OUString sVendor; - if (Bootstrap()->getFrom(UNO_JAVA_JFW_VENDOR_SETTINGS, sVendor)) + if (Bootstrap()->getFrom(u"" UNO_JAVA_JFW_VENDOR_SETTINGS ""_ustr, sVendor)) { //check the value of the bootstrap variable jfw::FileStatus s = checkFileURL(sVendor); @@ -311,8 +311,8 @@ OUString BootParams::getJREHome() { OUString sJRE; OUString sEnvJRE; - bool bJRE = Bootstrap()->getFrom(UNO_JAVA_JFW_JREHOME, sJRE); - bool bEnvJRE = Bootstrap()->getFrom(UNO_JAVA_JFW_ENV_JREHOME, sEnvJRE); + bool bJRE = Bootstrap()->getFrom(u"" UNO_JAVA_JFW_JREHOME ""_ustr, sJRE); + bool bEnvJRE = Bootstrap()->getFrom(u"" UNO_JAVA_JFW_ENV_JREHOME ""_ustr, sEnvJRE); if (bJRE && bEnvJRE) { @@ -365,7 +365,7 @@ OUString BootParams::getJREHome() OUString BootParams::getClasspathUrls() { OUString sParams; - Bootstrap()->getFrom( UNO_JAVA_JFW_CLASSPATH_URLS, sParams); + Bootstrap()->getFrom( u"" UNO_JAVA_JFW_CLASSPATH_URLS ""_ustr, sParams); SAL_INFO( "jfw.level2", "Using bootstrap parameter " UNO_JAVA_JFW_CLASSPATH_URLS " = " @@ -384,13 +384,13 @@ JFW_MODE getMode() bool bDirectMode = true; OUString sValue; const rtl::Bootstrap * aBoot = Bootstrap(); - if (!aBoot->getFrom(UNO_JAVA_JFW_JREHOME, sValue)) + if (!aBoot->getFrom(u"" UNO_JAVA_JFW_JREHOME ""_ustr, sValue)) { - if (!aBoot->getFrom(UNO_JAVA_JFW_ENV_JREHOME, sValue)) + if (!aBoot->getFrom(u"" UNO_JAVA_JFW_ENV_JREHOME ""_ustr, sValue)) { - if (!aBoot->getFrom(UNO_JAVA_JFW_CLASSPATH, sValue)) + if (!aBoot->getFrom(u"" UNO_JAVA_JFW_CLASSPATH ""_ustr, sValue)) { - if (!aBoot->getFrom(UNO_JAVA_JFW_ENV_CLASSPATH, sValue)) + if (!aBoot->getFrom(u"" UNO_JAVA_JFW_ENV_CLASSPATH ""_ustr, sValue)) { OUString sParams = UNO_JAVA_JFW_PARAMETER + OUString::number(1);