From d6e5031ba8640591df6f473eb22331fe120a5b80 Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Fri, 19 Apr 2019 23:54:57 +0530 Subject: 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 --- .../java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/src/main/java/org/onap') 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)); } } -- cgit 1.2.3-korg