From c5cdcd8f5ac16b571e083d3222e7447e5c5ed03a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 11 Sep 2014 16:44:51 +0200 Subject: jvmfwk: print a warning if running java fa Change-Id: Ibfcd6678ed1503cfab0881f3ec67c4c158d798cb --- jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'jvmfwk') diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 4e46a67ad0d0..0815ea83a704 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -390,12 +390,16 @@ bool getJavaProps(const OUString & exePath, OUString sThisLib; if (osl_getModuleURLFromAddress((void *) (sal_IntPtr)& getJavaProps, & sThisLib.pData) == sal_False) + { return false; + } sThisLib = getDirFromFile(sThisLib); OUString sClassPath; if (osl_getSystemPathFromFileURL(sThisLib.pData, & sClassPath.pData) != osl_File_E_None) + { return false; + } #ifdef MACOSX if (sClassPath.endsWith("/")) @@ -456,6 +460,8 @@ bool getJavaProps(const OUString & exePath, { JFW_TRACE2("[Java framework] Execution failed. \n"); *bProcessRun = false; + SAL_WARN("jfw", + "osl_executeProcess failed (" << ret << "): \"" << exePath << "\""); return ret; } else @@ -885,7 +891,9 @@ rtl::Reference getJREInfoByPath( OUString sResolvedDir = resolveDirPath(path); // If this path is invalid then there is no chance to find a JRE here if (sResolvedDir.isEmpty()) + { return 0; + } //check if the directory path is good, that is a JRE was already recognized. //Then we need not detect it again @@ -936,13 +944,17 @@ rtl::Reference getJREInfoByPath( //The file path (to java exe) is not valid cit_path ifull = find(vecBadPaths.begin(), vecBadPaths.end(), sFullPath); if (ifull == vecBadPaths.end()) + { vecBadPaths.push_back(sFullPath); + } continue; } cit_path ifile = find(vecBadPaths.begin(), vecBadPaths.end(), sFilePath); if (ifile != vecBadPaths.end()) + { continue; + } MapIt entry = mapJREs.find(sFilePath); if (entry != mapJREs.end()) @@ -1008,7 +1020,9 @@ rtl::Reference getJREInfoByPath( } if (props.empty()) + { return rtl::Reference(); + } //find java.vendor property typedef vector >::const_iterator c_ip; @@ -1040,7 +1054,9 @@ rtl::Reference getJREInfoByPath( } } if (!ret.is()) + { vecBadPaths.push_back(sFilePath); + } else { JFW_TRACE2(OUString("[Java framework] sunjavaplugin") -- cgit