More loplugin:simplifybool
Change-Id: I51e7a11149676a8b5396d9eb993a509859cdf725
This commit is contained in:
@@ -76,7 +76,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
|
|||||||
|
|
||||||
if (pInfo == NULL)
|
if (pInfo == NULL)
|
||||||
{
|
{
|
||||||
if (false == findAndSelect(&pInfo))
|
if (!findAndSelect(&pInfo))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -281,7 +281,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bLdPath == false)
|
if (!bLdPath)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -94,7 +94,7 @@ bool SunVersion::init(const char *szVersion)
|
|||||||
(nPart < 2 && *pCur == '.') )
|
(nPart < 2 && *pCur == '.') )
|
||||||
&& (
|
&& (
|
||||||
//prevent 1.4.0. 1.4.0-
|
//prevent 1.4.0. 1.4.0-
|
||||||
pCur + 1 == pEnd ? isdigit(*(pCur)) : true) )
|
pCur + 1 != pEnd || isdigit(*(pCur))) )
|
||||||
{
|
{
|
||||||
int len = pCur - pLast;
|
int len = pCur - pLast;
|
||||||
if (len >= 127)
|
if (len >= 127)
|
||||||
|
@@ -976,11 +976,11 @@ rtl::Reference<VendorBase> getJREInfoByPath(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool bProcessRun= false;
|
bool bProcessRun= false;
|
||||||
if (getJavaProps(sFilePath,
|
if (!getJavaProps(sFilePath,
|
||||||
#ifdef JVM_ONE_PATH_CHECK
|
#ifdef JVM_ONE_PATH_CHECK
|
||||||
sResolvedDir,
|
sResolvedDir,
|
||||||
#endif
|
#endif
|
||||||
props, & bProcessRun) == false)
|
props, & bProcessRun))
|
||||||
{
|
{
|
||||||
//The java executable could not be run or the system properties
|
//The java executable could not be run or the system properties
|
||||||
//could not be retrieved. We can assume that this java is corrupt.
|
//could not be retrieved. We can assume that this java is corrupt.
|
||||||
@@ -991,7 +991,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
|
|||||||
//in jdk/jre/bin. We do not search any further, because we assume that if one java
|
//in jdk/jre/bin. We do not search any further, because we assume that if one java
|
||||||
//does not work then the other does not work as well. This saves us to run java
|
//does not work then the other does not work as well. This saves us to run java
|
||||||
//again which is quite costly.
|
//again which is quite costly.
|
||||||
if (bProcessRun == true)
|
if (bProcessRun)
|
||||||
{
|
{
|
||||||
// 1.3.1 special treatment: jdk/bin/java and /jdk/jre/bin/java are links to
|
// 1.3.1 special treatment: jdk/bin/java and /jdk/jre/bin/java are links to
|
||||||
//a script, named .java_wrapper. The script starts jdk/bin/sparc/native_threads/java
|
//a script, named .java_wrapper. The script starts jdk/bin/sparc/native_threads/java
|
||||||
@@ -1084,7 +1084,7 @@ Reference<VendorBase> createInstance(createInstance_func pFunc,
|
|||||||
Reference<VendorBase> aBase = (*pFunc)();
|
Reference<VendorBase> aBase = (*pFunc)();
|
||||||
if (aBase.is())
|
if (aBase.is())
|
||||||
{
|
{
|
||||||
if (aBase->initialize(properties) == false)
|
if (!aBase->initialize(properties))
|
||||||
aBase = 0;
|
aBase = 0;
|
||||||
}
|
}
|
||||||
return aBase;
|
return aBase;
|
||||||
|
@@ -173,7 +173,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bLdPath == false)
|
if (!bLdPath)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -777,7 +777,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
|
|||||||
bNil = false;
|
bNil = false;
|
||||||
else
|
else
|
||||||
throw FrameworkException(JFW_E_ERROR, sExcMsg);
|
throw FrameworkException(JFW_E_ERROR, sExcMsg);
|
||||||
if (bNil == true)
|
if (bNil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Get javaInfo@manuallySelected attribute
|
//Get javaInfo@manuallySelected attribute
|
||||||
@@ -890,7 +890,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
|
|||||||
|
|
||||||
//javaInfo@autoSelect
|
//javaInfo@autoSelect
|
||||||
xmlSetProp(pJavaInfoNode, reinterpret_cast<xmlChar const *>("autoSelect"),
|
xmlSetProp(pJavaInfoNode, reinterpret_cast<xmlChar const *>("autoSelect"),
|
||||||
reinterpret_cast<xmlChar const *>(bAutoSelect == true ? "true" : "false"));
|
reinterpret_cast<xmlChar const *>(bAutoSelect ? "true" : "false"));
|
||||||
|
|
||||||
//Set xsi:nil in javaInfo element to false
|
//Set xsi:nil in javaInfo element to false
|
||||||
//the xmlNs pointer must not be destroyed
|
//the xmlNs pointer must not be destroyed
|
||||||
@@ -977,7 +977,7 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
|
|||||||
|
|
||||||
JavaInfo * CNodeJavaInfo::makeJavaInfo() const
|
JavaInfo * CNodeJavaInfo::makeJavaInfo() const
|
||||||
{
|
{
|
||||||
if (bNil == true || m_bEmptyNode == true)
|
if (bNil || m_bEmptyNode)
|
||||||
return NULL;
|
return NULL;
|
||||||
JavaInfo * pInfo = static_cast<JavaInfo*>(rtl_allocateMemory(sizeof(JavaInfo)));
|
JavaInfo * pInfo = static_cast<JavaInfo*>(rtl_allocateMemory(sizeof(JavaInfo)));
|
||||||
if (pInfo == NULL)
|
if (pInfo == NULL)
|
||||||
|
@@ -276,8 +276,7 @@ javaFrameworkError SAL_CALL jfw_startVM(
|
|||||||
//Check if the selected Java was set in this process. If so it
|
//Check if the selected Java was set in this process. If so it
|
||||||
//must not have the requirments flag JFW_REQUIRE_NEEDRESTART
|
//must not have the requirments flag JFW_REQUIRE_NEEDRESTART
|
||||||
if ((aInfo->nRequirements & JFW_REQUIRE_NEEDRESTART)
|
if ((aInfo->nRequirements & JFW_REQUIRE_NEEDRESTART)
|
||||||
&&
|
&& jfw::wasJavaSelectedInSameProcess())
|
||||||
(jfw::wasJavaSelectedInSameProcess() == true))
|
|
||||||
return JFW_E_NEED_RESTART;
|
return JFW_E_NEED_RESTART;
|
||||||
|
|
||||||
vmParams = settings.getVmParametersUtf8();
|
vmParams = settings.getVmParametersUtf8();
|
||||||
@@ -533,7 +532,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
|
|||||||
jfw_freeJavaInfo(arInfos[j]);
|
jfw_freeJavaInfo(arInfos[j]);
|
||||||
rtl_freeMemory(arInfos);
|
rtl_freeMemory(arInfos);
|
||||||
|
|
||||||
if (bInfoFound == true)
|
if (bInfoFound)
|
||||||
break;
|
break;
|
||||||
//All Java installations found by the current plug-in lib
|
//All Java installations found by the current plug-in lib
|
||||||
//do not provide the required features. Try the next plug-in
|
//do not provide the required features. Try the next plug-in
|
||||||
@@ -591,7 +590,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//end iterate over paths
|
}//end iterate over paths
|
||||||
if (bInfoFound == true)
|
if (bInfoFound)
|
||||||
break;
|
break;
|
||||||
}// end iterate plug-ins
|
}// end iterate plug-ins
|
||||||
}
|
}
|
||||||
@@ -837,7 +836,7 @@ javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled)
|
|||||||
if (jfw::getMode() == jfw::JFW_MODE_DIRECT)
|
if (jfw::getMode() == jfw::JFW_MODE_DIRECT)
|
||||||
return JFW_E_DIRECT_MODE;
|
return JFW_E_DIRECT_MODE;
|
||||||
|
|
||||||
if (g_bEnabledSwitchedOn == false && bEnabled == sal_True)
|
if (!g_bEnabledSwitchedOn && bEnabled == sal_True)
|
||||||
{
|
{
|
||||||
//When the process started then Enabled was false.
|
//When the process started then Enabled was false.
|
||||||
//This is first time enabled is set to true.
|
//This is first time enabled is set to true.
|
||||||
|
@@ -418,7 +418,7 @@ JFW_MODE getMode()
|
|||||||
static bool g_bMode = false;
|
static bool g_bMode = false;
|
||||||
static JFW_MODE g_mode = JFW_MODE_APPLICATION;
|
static JFW_MODE g_mode = JFW_MODE_APPLICATION;
|
||||||
|
|
||||||
if (g_bMode == false)
|
if (!g_bMode)
|
||||||
{
|
{
|
||||||
//check if either of the "direct mode" bootstrap variables is set
|
//check if either of the "direct mode" bootstrap variables is set
|
||||||
bool bDirectMode = true;
|
bool bDirectMode = true;
|
||||||
@@ -555,7 +555,7 @@ void setJavaSelected()
|
|||||||
bool wasJavaSelectedInSameProcess()
|
bool wasJavaSelectedInSameProcess()
|
||||||
{
|
{
|
||||||
//g_setJavaProcId not set means no Java selected
|
//g_setJavaProcId not set means no Java selected
|
||||||
if (g_bJavaSet == true)
|
if (g_bJavaSet)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user