aboutsummaryrefslogtreecommitdiffstats
path: root/common/src
diff options
context:
space:
mode:
authorSindhuri.A <arcot.sindhuri@huawei.com>2019-04-19 23:54:57 +0530
committerSindhuri.A <arcot.sindhuri@huawei.com>2019-04-19 23:54:57 +0530
commitd6e5031ba8640591df6f473eb22331fe120a5b80 (patch)
treecc44f4fb4c46022ca56d3e3f7304c1e03520ba11 /common/src
parentba5d6d7ebb12f21011611d081868e41157b583d0 (diff)
Shift String literal to left-hand side of equals
Shift String literal to left-hand side of equals DSLNodeKey class Issue-ID: SO-1490 Change-Id: If9c15394876e8e662fc10501c90382861dfbced9 Signed-off-by: Sindhuri.A <arcot.sindhuri@huawei.com>
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));
}
}