diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-09 21:51:37 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-10 07:09:21 +0000 |
commit | 110ae4e498a55bd50ca0afe558126e9e029f68cd (patch) | |
tree | a7784faed1c2273fd80add17d12d68bc800dda46 /qadevOOo/runner/convwatch | |
parent | 999fb810673f7c1b490cdac1f29c2e931e8e7f2e (diff) |
runner: The if statement is redundant
Change-Id: Ida40034bdfe6a44a936db1243ad6c71616caada3
Reviewed-on: https://gerrit.libreoffice.org/11895
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'qadevOOo/runner/convwatch')
-rw-r--r-- | qadevOOo/runner/convwatch/EnhancedComplexTestCase.java | 8 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/FileHelper.java | 6 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/FilenameHelper.java | 6 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/GraphicalTestArguments.java | 46 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/IniFile.java | 10 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/MSOfficePrint.java | 16 |
6 files changed, 21 insertions, 71 deletions
diff --git a/qadevOOo/runner/convwatch/EnhancedComplexTestCase.java b/qadevOOo/runner/convwatch/EnhancedComplexTestCase.java index 47e23fcca052..52587c62bfe7 100644 --- a/qadevOOo/runner/convwatch/EnhancedComplexTestCase.java +++ b/qadevOOo/runner/convwatch/EnhancedComplexTestCase.java @@ -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"); } diff --git a/qadevOOo/runner/convwatch/FileHelper.java b/qadevOOo/runner/convwatch/FileHelper.java index e9f97effd9b9..ba4e4c3f46a1 100644 --- a/qadevOOo/runner/convwatch/FileHelper.java +++ b/qadevOOo/runner/convwatch/FileHelper.java @@ -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) diff --git a/qadevOOo/runner/convwatch/FilenameHelper.java b/qadevOOo/runner/convwatch/FilenameHelper.java index 19b9eea0bf7a..56a3b5dda65a 100644 --- a/qadevOOo/runner/convwatch/FilenameHelper.java +++ b/qadevOOo/runner/convwatch/FilenameHelper.java @@ -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); } } diff --git a/qadevOOo/runner/convwatch/GraphicalTestArguments.java b/qadevOOo/runner/convwatch/GraphicalTestArguments.java index 49fb1e07dc9b..5fc4bedbdfde 100644 --- a/qadevOOo/runner/convwatch/GraphicalTestArguments.java +++ b/qadevOOo/runner/convwatch/GraphicalTestArguments.java @@ -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 = ""; diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java index 29897272a2bc..8e1747bf1308 100644 --- a/qadevOOo/runner/convwatch/IniFile.java +++ b/qadevOOo/runner/convwatch/IniFile.java @@ -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) diff --git a/qadevOOo/runner/convwatch/MSOfficePrint.java b/qadevOOo/runner/convwatch/MSOfficePrint.java index 62d8c54e391f..4436d8397cbf 100644 --- a/qadevOOo/runner/convwatch/MSOfficePrint.java +++ b/qadevOOo/runner/convwatch/MSOfficePrint.java @@ -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"); } /** |