Kaydet (Commit) 110ae4e4 authored tarafından Robert Antoni Buj i Gelonch's avatar Robert Antoni Buj i Gelonch Kaydeden (comit) Noel Grandin

runner: The if statement is redundant

Change-Id: Ida40034bdfe6a44a936db1243ad6c71616caada3
Reviewed-on: https://gerrit.libreoffice.org/11895Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 999fb810
......@@ -79,12 +79,8 @@ public abstract class EnhancedComplexTestCase extends ComplexTestCase
{
sNEEDCHECK = "false";
}
if (sNEEDCHECK.equalsIgnoreCase("yes") ||
sNEEDCHECK.equalsIgnoreCase("true"))
{
return true;
}
return false;
return sNEEDCHECK.equalsIgnoreCase("yes") ||
sNEEDCHECK.equalsIgnoreCase("true");
}
......
......@@ -44,11 +44,7 @@ public class FileHelper
if (_sFile == null) return false;
File aFile = new File(_sFile);
if (aFile.exists())
{
return true;
}
return false;
return aFile.exists();
}
public static boolean isDir(String _sDir)
......
......@@ -246,11 +246,7 @@ abstract class FilenameHelper_impl implements Filenamer
{
String sPath = createAbsoluteFilename();
String sPathOther = _aOtherFN.createAbsoluteFilename();
if (sPath.equals(sPathOther))
{
return true;
}
return false;
return sPath.equals(sPathOther);
}
}
......
......@@ -196,15 +196,9 @@ public class GraphicalTestArguments
{
sREUSE_OFFICE = "false";
}
if (sREUSE_OFFICE.equalsIgnoreCase("yes") ||
sREUSE_OFFICE.equalsIgnoreCase("true"))
{
m_bResuseOffice = true;
}
else
{
m_bResuseOffice = false;
}
m_bResuseOffice =
sREUSE_OFFICE.equalsIgnoreCase("yes") ||
sREUSE_OFFICE.equalsIgnoreCase("true");
String sHTMLOutputPrefix = (String)param.get( PropertyName.DOC_COMPARATOR_HTML_OUTPUT_PREFIX);
......@@ -276,15 +270,9 @@ public class GraphicalTestArguments
String sCreateDefault = (String)param.get(PropertyName.CREATE_DEFAULT);
if (sCreateDefault != null)
{
if (sCreateDefault.equalsIgnoreCase("yes") ||
sCreateDefault.equalsIgnoreCase("true"))
{
m_bCreateDefaultReference = true;
}
else
{
m_bCreateDefaultReference = false;
}
m_bCreateDefaultReference =
sCreateDefault.equalsIgnoreCase("yes") ||
sCreateDefault.equalsIgnoreCase("true");
}
}
......@@ -293,17 +281,12 @@ public class GraphicalTestArguments
{
// @todo
// check if the name is in the leave out list and then return 'false'
if (_sName.toLowerCase().endsWith(".jpg") ||
return !(_sName.toLowerCase().endsWith(".jpg") ||
_sName.toLowerCase().endsWith(".png") ||
_sName.toLowerCase().endsWith(".gif") ||
_sName.toLowerCase().endsWith(".bmp") ||
_sName.toLowerCase().endsWith(".prn") ||
_sName.toLowerCase().endsWith(".ps"))
{
return false;
}
return true;
_sName.toLowerCase().endsWith(".ps"));
}
private static void showInternalFilterName(String _sFilterName, XMultiServiceFactory _xMSF)
......@@ -417,12 +400,7 @@ public class GraphicalTestArguments
*/
public boolean printAllPages()
{
if ( (getMaxPages() > 0) ||
(getOnlyPages().length() != 0))
{
return false;
}
return true;
return !((getMaxPages() > 0) || (getOnlyPages().length() != 0));
}
/**
......@@ -590,11 +568,7 @@ public class GraphicalTestArguments
public boolean restartOffice()
{
if (!m_bResuseOffice)
{
return true;
}
return false;
return !m_bResuseOffice;
}
private String m_sHTMLOutputPrefix = "";
......
......@@ -104,13 +104,9 @@ class IniFile
private boolean isRemark(String _sLine)
{
if ( ((_sLine.length() < 2) ) ||
( _sLine.startsWith("#")) ||
( _sLine.startsWith(";")) )
{
return true;
}
return false;
return _sLine.length() < 2 ||
_sLine.startsWith("#") ||
_sLine.startsWith(";");
}
private String getItem(int i)
......
......@@ -47,13 +47,9 @@ public class MSOfficePrint
private static boolean isWordDocument(String _sSuffix)
{
if (_sSuffix.toLowerCase().endsWith(".doc") ||
return _sSuffix.toLowerCase().endsWith(".doc") ||
_sSuffix.toLowerCase().endsWith(".rtf") ||
_sSuffix.toLowerCase().endsWith(".dot"))
{
return true;
}
return false;
_sSuffix.toLowerCase().endsWith(".dot");
}
private static boolean isExcelDocument(String _sSuffix)
......@@ -75,12 +71,8 @@ public class MSOfficePrint
private static boolean isPowerPointDocument(String _sSuffix)
{
if (_sSuffix.toLowerCase().endsWith(".pps") ||
_sSuffix.toLowerCase().endsWith(".ppt"))
{
return true;
}
return false;
return _sSuffix.toLowerCase().endsWith(".pps") ||
_sSuffix.toLowerCase().endsWith(".ppt");
}
/**
......
......@@ -120,24 +120,15 @@ public class IniFile implements Enumeration<String>
*/
public boolean hasValue(String _sSectionName, String _sKey)
{
int n = findKey(_sSectionName, _sKey);
if (n > 0)
{
return true;
}
return false;
return findKey(_sSectionName, _sKey) > 0;
}
private boolean isRemark(String _sLine)
{
if (((_sLine.length() < 2)) ||
(_sLine.startsWith("#")) ||
(_sLine.startsWith(";")))
{
return true;
}
return false;
return _sLine.length() < 2 ||
_sLine.startsWith("#") ||
_sLine.startsWith(";");
}
private String getItem(int i)
......@@ -199,12 +190,7 @@ public class IniFile implements Enumeration<String>
*/
public boolean hasSection(String _sSection)
{
int i = findSection(_sSection);
if (i == -1)
{
return false;
}
return true;
return findSection(_sSection) != -1;
}
// return the line number, where the key is found.
......@@ -494,12 +480,7 @@ public class IniFile implements Enumeration<String>
*/
public boolean hasMoreElements()
{
if (m_aEnumerationPos >= 0 &&
m_aEnumerationPos < m_aList.size())
{
return true;
}
return false;
return m_aEnumerationPos >= 0 && m_aEnumerationPos < m_aList.size();
}
/**
......
......@@ -113,13 +113,9 @@ public class MSOfficePostscriptCreator implements IOffice
private boolean isWordDocument(String _sSuffix)
{
if (_sSuffix.toLowerCase().endsWith(".doc") ||
return _sSuffix.toLowerCase().endsWith(".doc") ||
_sSuffix.toLowerCase().endsWith(".rtf") ||
_sSuffix.toLowerCase().endsWith(".dot"))
{
return true;
}
return false;
_sSuffix.toLowerCase().endsWith(".dot");
}
private boolean isExcelDocument(String _sSuffix)
......@@ -127,21 +123,13 @@ public class MSOfficePostscriptCreator implements IOffice
// xlt templates
// xlw
// xla addin
if (_sSuffix.toLowerCase().endsWith(".xls"))
{
return true;
}
return false;
return _sSuffix.toLowerCase().endsWith(".xls");
}
private boolean isPowerPointDocument(String _sSuffix)
{
if (_sSuffix.toLowerCase().endsWith(".pps") ||
_sSuffix.toLowerCase().endsWith(".ppt"))
{
return true;
}
return false;
return _sSuffix.toLowerCase().endsWith(".pps") ||
_sSuffix.toLowerCase().endsWith(".ppt");
}
/**
......
......@@ -314,12 +314,7 @@ public class ParameterHelper
*/
public boolean printAllPages()
{
if ( (getMaxPages() > 0) ||
(getOnlyPages().length() != 0))
{
return false;
}
return true;
return !((getMaxPages() > 0) || (getOnlyPages().length() != 0));
}
public boolean getOverwrite()
......@@ -348,13 +343,7 @@ public class ParameterHelper
public boolean createSmallPictures()
{
// boolean bCreateSmallPictures = true;
boolean bNoSmallPictures = m_aCurrentParams.getBool( PropertyName.NO_SMALL_PICTURES);
if (bNoSmallPictures)
{
return false;
}
return true;
return !m_aCurrentParams.getBool(PropertyName.NO_SMALL_PICTURES);
}
}
......@@ -25,52 +25,31 @@ public class OSHelper
{
public static boolean isWindows()
{
String sOSName = System.getProperty("os.name");
if (sOSName.toLowerCase().startsWith("windows"))
{
return true;
}
return false;
return System.getProperty("os.name").toLowerCase().startsWith("windows");
}
public static boolean isSolarisIntel()
{
if ( ( System.getProperty("os.name").toLowerCase().startsWith("solaris") ||
System.getProperty("os.name").toLowerCase().startsWith("sunos") ) &&
System.getProperty("os.arch").equals("x86"))
{
return true;
}
return false;
String sOSName = System.getProperty("os.name");
return ( sOSName.toLowerCase().startsWith("solaris") ||
sOSName.toLowerCase().startsWith("sunos") ) &&
System.getProperty("os.arch").equals("x86");
}
public static boolean isSolarisSparc()
{
if ( ( System.getProperty("os.name").toLowerCase().startsWith("solaris") ||
System.getProperty("os.name").toLowerCase().startsWith("sunos") ) &&
System.getProperty("os.arch").equals("sparc"))
{
return true;
}
return false;
String sOSName = System.getProperty("os.name");
return ( sOSName.toLowerCase().startsWith("solaris") ||
sOSName.toLowerCase().startsWith("sunos") ) &&
System.getProperty("os.arch").equals("sparc");
}
public static boolean isLinuxIntel()
{
if (System.getProperty("os.name").toLowerCase().startsWith("linux") &&
System.getProperty("os.arch").equals("i386"))
{
return true;
}
return false;
return System.getProperty("os.name").toLowerCase().startsWith("linux") &&
System.getProperty("os.arch").equals("i386");
}
public static boolean isUnix()
{
if (isLinuxIntel() ||
isSolarisIntel() ||
isSolarisSparc())
{
return true;
}
return false;
return isLinuxIntel() || isSolarisIntel() || isSolarisSparc();
}
}
......@@ -60,11 +60,7 @@ public class Runner
{
return false;
}
if (_sVariable.startsWith("/cygdrive"))
{
return true;
}
return false;
return _sVariable.startsWith("/cygdrive");
}
private static boolean checkPathVariable(String _sPath, String delim)
......
......@@ -173,9 +173,7 @@ public class RunnerService implements XJob, XServiceInfo,
* @see com.sun.star.lang.XServiceInfo
*/
public boolean supportsService(String serviceName) {
if(serviceName.equals(__serviceName))
return true;
return false;
return serviceName.equals(__serviceName);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment