aboutsummaryrefslogtreecommitdiffstats
path: root/common/src
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2019-04-20 06:32:26 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-20 06:32:26 +0000
commitb72390681e48bcec222b789d9b19c18cf5295178 (patch)
tree27be704d92ae5bfe19af1a9a16d33c049c44535a /common/src
parent89fe06caf3148393fb7f1e2f78e786c7074f7c7a (diff)
parentd6e5031ba8640591df6f473eb22331fe120a5b80 (diff)
Merge "Shift String literal to left-hand side of equals"
Diffstat (limited to 'common/src')
-rw-r--r--common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java b/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java
index e63e226457..6e2bc97ee9 100644
--- a/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java
+++ b/common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java
@@ -73,9 +73,9 @@ public class EqualsAndHashCodeTester implements Tester {
boolean hasEquals = false;
boolean hasHashcode = false;
for (Method method : methods) {
- if (method.getName().equals("equals")) {
+ if ("equals".equals(method.getName())) {
hasEquals = true;
- } else if (method.getName().equals("hashCode")) {
+ } else if ("hashCode".equals(method.getName())) {
hasHashcode = true;
}
}
@@ -114,7 +114,7 @@ public class EqualsAndHashCodeTester implements Tester {
Affirm.affirmTrue("HashCode test failed for [" + classInstanceOne.getClass().getName() + "]",
classInstanceOne.hashCode() == classInstanceTwo.hashCode());
- Affirm.affirmFalse("Expected false for comparison of two unlike objects", classInstanceOne.equals("test"));
+ Affirm.affirmFalse("Expected false for comparison of two unlike objects", "test".equals(classInstanceOne));
}
}