From f40120dc6fca7170a416be2c75ff47b5946efc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 15 Oct 2015 14:33:00 +0100 Subject: [PATCH] coverity#1326293 Dereference after null check Change-Id: I6ce295873eb2ed1231ad1d95babfcc2c8ff265e8 --- .../tests/java/ifc/beans/_XExactName.java | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/qadevOOo/tests/java/ifc/beans/_XExactName.java b/qadevOOo/tests/java/ifc/beans/_XExactName.java index ab8f6f96572d..033426e22f17 100644 --- a/qadevOOo/tests/java/ifc/beans/_XExactName.java +++ b/qadevOOo/tests/java/ifc/beans/_XExactName.java @@ -41,13 +41,12 @@ public class _XExactName extends MultiMethodTest { if (getting == null) { res = false; } else { - res = getting.equals(expectedName); - } - - if (!res) { - log.println("didn't get the expected Name:"); - log.println("getting: " + getting); - log.println("Expected: " + expectedName); + if (!getting.equals(expectedName)) { + log.println("didn't get the expected Name:"); + log.println("getting: " + getting); + log.println("Expected: " + expectedName); + res = false; + } } nameFor = expectedName.toUpperCase(); @@ -58,13 +57,12 @@ public class _XExactName extends MultiMethodTest { if (getting == null) { res = false; } else { - res &= getting.equals(expectedName); - } - - if (!getting.equals(expectedName)) { - log.println("didn't get the expected Name:"); - log.println("getting: " + getting); - log.println("Expected: " + expectedName); + if (!getting.equals(expectedName)) { + log.println("didn't get the expected Name:"); + log.println("getting: " + getting); + log.println("Expected: " + expectedName); + res = false; + } } tRes.tested("getExactName()", res); @@ -83,4 +81,4 @@ public class _XExactName extends MultiMethodTest { "Object relation expectedName is missing")); } } -} \ No newline at end of file +}