diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-05 13:19:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-08 09:48:19 +0200 |
commit | b6a83e99c8f4442c3c96198ac816dcb99419a67e (patch) | |
tree | 680dc3e55306b355983aa8c810f610015a95bf5d /qadevOOo | |
parent | 8f020a45fa69c9458844b8b621df2e0b15ec3d16 (diff) |
java: remove redundant null checks
Change-Id: Ia42e5ed715fbd3f5b84029a9844da55f307c6260
Diffstat (limited to 'qadevOOo')
7 files changed, 4 insertions, 15 deletions
diff --git a/qadevOOo/runner/helper/ComplexDescGetter.java b/qadevOOo/runner/helper/ComplexDescGetter.java index e269e1816d1c..6e517d712d36 100644 --- a/qadevOOo/runner/helper/ComplexDescGetter.java +++ b/qadevOOo/runner/helper/ComplexDescGetter.java @@ -128,12 +128,7 @@ public class ComplexDescGetter extends DescGetter } String testObjectName = className; - String[] testMethodNames = null; - - if (testMethodNames == null) - { - testMethodNames = testClass.getTestMethodNames(); - } + String[] testMethodNames = testClass.getTestMethodNames(); if (methodNames != null) { testMethodNames = methodNames; diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index 7b63dab6c161..7f01f8a21a57 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -748,7 +748,7 @@ public class ValueChanger { if (Enum.class.equals(flds[i].getType().getSuperclass())) { Enum value = (Enum) flds[i].get(null) ; - if (newValue == null && !value.equals(oldValue)) { + if (!value.equals(oldValue)) { newValue = value ; break ; } diff --git a/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java b/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java index fddad954c4d3..a300454cca81 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java +++ b/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java @@ -212,8 +212,7 @@ public class _XTransliteration extends MultiMethodTest { log.println(out[i]); } - boolean bOK = out != null && - out.length == 4 && + boolean bOK = out.length == 4 && ("A".equals(out[0]) && "I".equals(out[1]) && "a".equals(out[2]) && "i".equals(out[3])) || ("a".equals(out[0]) && "i".equals(out[1]) && diff --git a/qadevOOo/tests/java/ifc/io/_XInputStream.java b/qadevOOo/tests/java/ifc/io/_XInputStream.java index 738b252b96d1..f60a3c5f43a1 100644 --- a/qadevOOo/tests/java/ifc/io/_XInputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XInputStream.java @@ -126,7 +126,6 @@ public class _XInputStream extends MultiMethodTest { int read = oObj.readBytes(data, 1) ; result = read == 1 && - data != null && data.length == 1 ; } catch (com.sun.star.io.IOException e){ e.printStackTrace(log) ; @@ -161,7 +160,6 @@ public class _XInputStream extends MultiMethodTest { int read = oObj.readSomeBytes(data, 1) ; result = read == 1 && - data != null && data.length == 1 ; } catch (com.sun.star.io.IOException e){ e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java b/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java index d9dbf71323d0..3ca88e281f68 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java +++ b/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java @@ -82,7 +82,6 @@ public class _XRecentFunctions extends MultiMethodTest { iNumber = IDs.length; bResult &= (iNumber <= iMaxNumber); log.println("Now there are " + iNumber + " recent functions"); - bResult &= (IDs != null); if (bResult) { for (int i = 0; i < iNumber - 1; i++) for (int j = i + 1; j < iNumber; j++) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java index 5e72121ea47c..232b5bd84560 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java @@ -96,7 +96,7 @@ public class _XSheetAnnotation extends MultiMethodTest { CellAddress oCAddr = oObj.getPosition(); - bResult = (oCAddr != null) && (sCAddr != null) && + bResult = (oCAddr != null) && ValueComparer.equalValue(oCAddr, sCAddr) ; tRes.tested("getPosition()", bResult); diff --git a/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java b/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java index f6cf0145615b..0ec515d1b8d2 100644 --- a/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java +++ b/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java @@ -60,8 +60,6 @@ public class _XStatusIndicatorFactory extends MultiMethodTest { //Now SI1 is active SI1.end(); - bResult &= SI1 != null; - tRes.tested("createStatusIndicator()", bResult); } } |