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

Stephan Bergmann sbergman at redhat.com
Tue Apr 11 16:25:33 UTC 2017


 include/jvmfwk/framework.hxx                        |    1 -
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |    6 ++++--
 jvmfwk/source/framework.cxx                         |    3 ---
 3 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 15c98f1740708ad7c05753ea28d5ad8ed4430e02
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 11 18:25:04 2017 +0200

    jfw_existJRE requires non-null args, never returns JFW_E_INVALID_ARG
    
    Change-Id: I2067b77393427a5a6a4273c2f609ff8d335f436a

diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 2373a3e713bc..139cda024766 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -722,7 +722,6 @@ JVMFWK_DLLPUBLIC javaFrameworkError jfw_addJRELocation(rtl_uString * sLocation);
    @return
     JFW_E_NONE the function ran successfully.</br>
     JFW_E_ERROR an error occurred during execution.</br>
-    JFW_E_INVALID_ARG pInfo contains invalid data</br>
  */
 JVMFWK_DLLPUBLIC javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, bool *exist);
 
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 860cbc4f2522..a5f11e6a3c21 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -30,6 +30,7 @@
 
 #include <string.h>
 
+#include <cassert>
 #include <memory>
 #include "config_options.h"
 #include "osl/diagnose.h"
@@ -884,9 +885,10 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 
 javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, bool *exist)
 {
+    assert(pInfo != nullptr);
+    assert(exist != nullptr);
+
     javaPluginError ret = javaPluginError::NONE;
-    if (!pInfo || !exist)
-        return javaPluginError::InvalidArg;
     OUString sLocation(pInfo->sLocation);
 
     if (sLocation.isEmpty())
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index c094ea6a8da1..a0208180dc30 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -987,9 +987,6 @@ javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, bool *exist)
     case javaPluginError::NONE:
         ret = JFW_E_NONE;
         break;
-    case javaPluginError::InvalidArg:
-        ret = JFW_E_INVALID_ARG;
-        break;
     case javaPluginError::Error:
         ret = JFW_E_ERROR;
         break;


More information about the Libreoffice-commits mailing list