coverity#1326293 Dereference after null check

Change-Id: I6ce295873eb2ed1231ad1d95babfcc2c8ff265e8
This commit is contained in:
Caolán McNamara 2015-10-15 14:33:00 +01:00
parent 293dd731e9
commit f40120dc6f

View file

@ -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"));
}
}
}
}