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