summaryrefslogtreecommitdiffstats
path: root/jvmfwk/plugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-11 21:13:31 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-11 21:13:31 +0200
commit1c1d29027bee64177ec3b14cb8e10df03e2ce8d2 (patch)
treee72398d04c7038fc486a3ff67a8f356eac63ef8f /jvmfwk/plugins
parentPDF export of PDF images: compress page stream if requested (diff)
downloadcore-1c1d29027bee64177ec3b14cb8e10df03e2ce8d2.tar.gz
core-1c1d29027bee64177ec3b14cb8e10df03e2ce8d2.zip
Assert obvious preconditions instead of returning javaPluginError:InvalidArg
Change-Id: I93bb3aaa0106bce98995f843ee036c9570f6aaf0
Diffstat (limited to 'jvmfwk/plugins')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 84e60a9cf254..d237de95451a 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -306,16 +306,12 @@ javaPluginError jfw_plugin_getAllJavaInfos(
sal_Int32 *nLenInfoList,
std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos)
{
- OSL_ASSERT(parJavaInfo);
- OSL_ASSERT(nLenInfoList);
- if (!parJavaInfo || !nLenInfoList)
- return javaPluginError::InvalidArg;
+ assert(parJavaInfo);
+ assert(nLenInfoList);
//nLenlist contains the number of elements in arExcludeList.
//If no exclude list is provided then nLenList must be 0
- OSL_ASSERT( ! (arExcludeList == nullptr && nLenList > 0));
- if (arExcludeList == nullptr && nLenList > 0)
- return javaPluginError::InvalidArg;
+ assert( ! (arExcludeList == nullptr && nLenList > 0));
OSL_ASSERT(!sVendor.isEmpty());
if (sVendor.isEmpty())
@@ -371,17 +367,14 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
sal_Int32 nLenList,
JavaInfo ** ppInfo)
{
- if (!ppInfo)
- return javaPluginError::InvalidArg;
+ assert(ppInfo != nullptr);
OSL_ASSERT(!sPath.isEmpty());
if (sPath.isEmpty())
return javaPluginError::InvalidArg;
//nLenlist contains the number of elements in arExcludeList.
//If no exclude list is provided then nLenList must be 0
- OSL_ASSERT( ! (arExcludeList == nullptr && nLenList > 0));
- if (arExcludeList == nullptr && nLenList > 0)
- return javaPluginError::InvalidArg;
+ assert( ! (arExcludeList == nullptr && nLenList > 0));
OSL_ASSERT(!sVendor.isEmpty());
if (sVendor.isEmpty())
@@ -407,8 +400,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
std::vector<pair<OUString, jfw::VersionInfo>> const& vecVendorInfos,
JavaInfo ** ppInfo, std::vector<rtl::Reference<VendorBase>> & infos)
{
- if (!ppInfo)
- return javaPluginError::InvalidArg;
+ assert(ppInfo);
std::vector<rtl::Reference<VendorBase>> infoJavaHome;
addJavaInfoFromJavaHome(infos, infoJavaHome);