summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/org/onap/so/openpojo/rules/EqualsAndHashCodeTester.java11
1 files changed, 6 insertions, 5 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 88a83db7e2..05f69caacd 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
@@ -122,13 +122,14 @@ public class EqualsAndHashCodeTester implements Tester {
private Set<PojoField> hasIdOrBusinessKey(PojoClass pojoClass) {
final Set<PojoField> fields = new HashSet<>();
-
+
fields.addAll(pojoClass.getPojoFieldsAnnotatedWith(BusinessKey.class));
- fields.addAll(pojoClass.getPojoFieldsAnnotatedWith(Id.class));
- fields.removeAll(pojoClass.getPojoFieldsAnnotatedWith(GeneratedValue.class));
-
+ final Set<PojoField> temp = new HashSet<>();
+ temp.addAll(pojoClass.getPojoFieldsAnnotatedWith(Id.class));
+ temp.removeAll(pojoClass.getPojoFieldsAnnotatedWith(GeneratedValue.class));
+ fields.addAll(temp);
return fields;
-
+
}
}