summaryrefslogtreecommitdiff
path: root/jvmfwk/plugins
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-25 09:59:16 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-12 22:06:19 -0400
commitc5cdfe39d3afca716e7b11f8f8e169ce378861ea (patch)
tree5b804fa2e78405afe16db734f88f24a7b9714209 /jvmfwk/plugins
parent0c4c31576fe03b3b59217bf9990b75f32d193d0d (diff)
update loplugin stylepolice to check local pointers vars
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> (cherry picked from commit e8fd5a07eca70912ddee45aaa34d434809b59fb7) Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1
Diffstat (limited to 'jvmfwk/plugins')
-rw-r--r--jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index f824e0cc82fc..718902caba6f 100644
--- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -26,7 +26,7 @@
#include "osl/thread.h"
#include "rtl/ustring.hxx"
#include "rtl/byteseq.hxx"
-#include "jvmfwk/framework.h"
+#include "jvmfwk/framework.hxx"
static bool hasOption(char const * szOption, int argc, char** argv);
@@ -51,7 +51,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(stdout, HELP_TEXT);// default
return 0;
}
- sal_Bool bEnabled = sal_False;
+ sal_Bool bEnabled = false;
javaFrameworkError errcode = jfw_getEnabled( & bEnabled);
if (errcode == JFW_E_NONE && !bEnabled)
{
@@ -64,8 +64,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
return -1;
}
- JavaInfo * pInfo = nullptr;
- errcode = jfw_getSelectedJRE( & pInfo);
+ jfw::JavaInfoGuard aInfo;
+ errcode = jfw_getSelectedJRE(&aInfo.info);
if (errcode != JFW_E_NONE && errcode != JFW_E_INVALID_SETTINGS)
{
@@ -73,19 +73,19 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
return -1;
}
- if (pInfo == nullptr)
+ if (aInfo.info == nullptr)
{
- if (!findAndSelect(&pInfo))
+ if (!findAndSelect(&aInfo.info))
return -1;
}
else
{
//check if the JRE was not uninstalled
- sal_Bool bExist = sal_False;
- errcode = jfw_existJRE(pInfo, &bExist);
+ sal_Bool bExist = false;
+ errcode = jfw_existJRE(aInfo.info, &bExist);
if (errcode == JFW_E_NONE)
{
- if (!bExist && !findAndSelect(&pInfo))
+ if (!bExist && !findAndSelect(&aInfo.info))
return -1;
}
else
@@ -95,9 +95,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
}
}
- OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData);
+ OString sPaths = getLD_LIBRARY_PATH(aInfo.info->arVendorData);
fprintf(stdout, "%s\n", sPaths.getStr());
- jfw_freeJavaInfo(pInfo);
}
catch (const std::exception&)
{
@@ -153,5 +152,4 @@ static bool findAndSelect(JavaInfo ** ppInfo)
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */