summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-11 18:25:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-11 18:25:04 +0200
commit15c98f1740708ad7c05753ea28d5ad8ed4430e02 (patch)
treefa58c228a546401099a108f95d62475643ae7c11
parent583508ced26a422145111242c027b3fbd5687dc5 (diff)
jfw_existJRE requires non-null args, never returns JFW_E_INVALID_ARG
Change-Id: I2067b77393427a5a6a4273c2f609ff8d335f436a
-rw-r--r--include/jvmfwk/framework.hxx1
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx6
-rw-r--r--jvmfwk/source/framework.cxx3
3 files changed, 4 insertions, 6 deletions
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;