qadevOOo/runner/convwatch/EnhancedComplexTestCase.java | 8 -- qadevOOo/runner/convwatch/FileHelper.java | 6 - qadevOOo/runner/convwatch/FilenameHelper.java | 6 - qadevOOo/runner/convwatch/GraphicalTestArguments.java | 46 +++------------ qadevOOo/runner/convwatch/IniFile.java | 10 --- qadevOOo/runner/convwatch/MSOfficePrint.java | 16 +---- qadevOOo/runner/graphical/IniFile.java | 31 +--------- qadevOOo/runner/graphical/MSOfficePostscriptCreator.java | 22 +------ qadevOOo/runner/graphical/ParameterHelper.java | 15 ---- qadevOOo/runner/helper/OSHelper.java | 45 +++----------- qadevOOo/runner/org/openoffice/Runner.java | 6 - qadevOOo/runner/org/openoffice/RunnerService.java | 4 - 12 files changed, 48 insertions(+), 167 deletions(-)
New commits: commit 110ae4e498a55bd50ca0afe558126e9e029f68cd Author: Robert Antoni Buj i Gelonch <robert....@gmail.com> Date: Thu Oct 9 21:51:37 2014 +0200 runner: The if statement is redundant Change-Id: Ida40034bdfe6a44a936db1243ad6c71616caada3 Reviewed-on: https://gerrit.libreoffice.org/11895 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/qadevOOo/runner/convwatch/EnhancedComplexTestCase.java b/qadevOOo/runner/convwatch/EnhancedComplexTestCase.java index 47e23fc..52587c6 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 e9f97ef..ba4e4c3 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 19b9eea..56a3b5dd 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 49fb1e0..5fc4bed 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 2989727..8e1747b 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 62d8c54..4436d83 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"); } /** diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java index 16bf0ad..f6b371f 100644 --- a/qadevOOo/runner/graphical/IniFile.java +++ b/qadevOOo/runner/graphical/IniFile.java @@ -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(); } /** diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index 19955a5..5a940ca 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -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"); } /** diff --git a/qadevOOo/runner/graphical/ParameterHelper.java b/qadevOOo/runner/graphical/ParameterHelper.java index 6658564..4e02858 100644 --- a/qadevOOo/runner/graphical/ParameterHelper.java +++ b/qadevOOo/runner/graphical/ParameterHelper.java @@ -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); } } diff --git a/qadevOOo/runner/helper/OSHelper.java b/qadevOOo/runner/helper/OSHelper.java index 41a1000..212a01b 100644 --- a/qadevOOo/runner/helper/OSHelper.java +++ b/qadevOOo/runner/helper/OSHelper.java @@ -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(); } } diff --git a/qadevOOo/runner/org/openoffice/Runner.java b/qadevOOo/runner/org/openoffice/Runner.java index 33071aa..d833a4f 100644 --- a/qadevOOo/runner/org/openoffice/Runner.java +++ b/qadevOOo/runner/org/openoffice/Runner.java @@ -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) diff --git a/qadevOOo/runner/org/openoffice/RunnerService.java b/qadevOOo/runner/org/openoffice/RunnerService.java index fcd4256..82f240c 100644 --- a/qadevOOo/runner/org/openoffice/RunnerService.java +++ b/qadevOOo/runner/org/openoffice/RunnerService.java @@ -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); } /** _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits