Skip to content

Commit

Permalink
Fixing squid: S2583 Conditions should not unconditionally evaluate to…
Browse files Browse the repository at this point in the history
… "TRUE" or to "FALSE"
  • Loading branch information
devFozgul committed Jun 30, 2016
1 parent 468d10e commit 1a10f90
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,14 @@ public boolean isEpsilonEquals(double[] v1, double[] v2) {
if (v1 == v2) {
return true;
}
if (v1 == null && v2 != null) {
if (v1 == null || v2 == null) {
return false;
}
if (v1 != null && v2 == null) {
return false;
}
assert v1 != null && v2 != null;

if (v1.length != v2.length) {
return false;
}
assert v1 != null && v2 != null;
for (int i = 0; i < v1.length; ++i) {
if (!isEpsilonEquals(v1[i], v2[i])) {
return false;
Expand Down Expand Up @@ -1192,16 +1190,12 @@ protected static void assertEpsilonEquals(Date expected, Date actual) {
if (expected == actual) {
return;
}
if (expected == null && actual != null) {
if (expected == null || actual == null) {
throw new ComparisonFailure(formatFailMessage("not same", expected, actual), //$NON-NLS-1$
null,
actual.toString());
}
if (expected != null && actual == null) {
throw new ComparisonFailure(formatFailMessage("not same", expected, actual), //$NON-NLS-1$
expected.toString(),
null);
}

assert expected != null && actual != null;
final DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$
final String expectedStr = fmt.format(expected);
Expand Down

0 comments on commit 1a10f90

Please sign in to comment.