summaryrefslogtreecommitdiffstats
path: root/aai-core/src/main
diff options
context:
space:
mode:
authorDavid Brilla <david.brilla@tieto.com>2020-02-11 18:36:50 +0100
committerDavid Brilla <david.brilla@tieto.com>2020-02-11 18:38:43 +0100
commit20ef2a2bc8c0bff6fa363f3112c6e0e53037858e (patch)
tree5fadf9114c6cc48ee483ce006c4888489ff1b581 /aai-core/src/main
parent2fc06a2adc033666785d4889576584d6b6c7d934 (diff)
Use "instanceof" insted
Bug correction, from class.toString comparing to instanceof Issue-ID: AAI-2786 Change-Id: Idbbdaaa37208b8c40556a42255aa43175c14b1c7 Signed-off-by: David Brilla <david.brilla@tieto.com>
Diffstat (limited to 'aai-core/src/main')
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
index 55580dc3..e628d5a4 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
@@ -26,6 +26,7 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
+import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.onap.aai.schema.enums.ObjectMetadata;
import org.onap.aai.schema.enums.PropertyMetadata;
@@ -149,7 +150,7 @@ public class JSONStrategy extends Introspector {
Object resultObject = null;
Class<?> resultClass = null;
resultObject = this.getValue(name);
- if (resultObject.getClass().getName().equals("org.json.simple.JSONArray")) {
+ if (resultObject instanceof JSONArray) {
resultClass = ((List) resultObject).get(0).getClass();
}
@@ -273,10 +274,10 @@ public class JSONStrategy extends Introspector {
/*
* @Override
* public String findEdgeName(String parent, String child) {
- *
+ *
* // Always has for now
* return "has";
- *
+ *
* }
*/