From 6a9b54b275feff5369419a86997e94d0a95fc48e Mon Sep 17 00:00:00 2001
From: "waqas.ikram" <waqas.ikram@ericsson.com>
Date: Thu, 7 Jun 2018 16:01:35 +0100
Subject: Fixing Sonar bugs and Vulnerabilities

Change-Id: Id5a95f23f1308dbb9f7f0c0f5567e238ecf830af
Issue-ID: POLICY-859
Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
---
 .../apex/plugins/context/schema/avro/AvroObjectMapperFactory.java       | 2 +-
 .../onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'plugins/plugins-context/context-schema/context-schema-avro')

diff --git a/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java b/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java
index dd55f447d..22152a8da 100644
--- a/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java
+++ b/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java
@@ -90,7 +90,7 @@ public class AvroObjectMapperFactory {
             if (Schema.Type.NULL.equals(schema.getType())) {
                 schema = types.get(1);
             }
-            if (Schema.Type.NULL.equals(schema.getType()) || Schema.Type.NULL.equals(schema.getType())) {
+            if (Schema.Type.NULL.equals(schema.getType())) {
                 final String resultSting = userKey.getID()
                         + ": Apex currently only supports UNION schema2 with 2 options, only one can be NULL, and the other cannot be another UNION";
                 LOGGER.warn(resultSting);
diff --git a/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java b/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
index 2543dd154..831962042 100644
--- a/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
+++ b/plugins/plugins-context/context-schema/context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
@@ -153,7 +153,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper {
                 objectString = (String) object;
             }
         } catch (final ClassCastException e) {
-            final String returnString = getUserKey().getID() + ": object \"" + object.toString() + "\" of type \""
+            final String returnString = getUserKey().getID() + ": object \"" + object + "\" of type \""
                     + object.getClass().getCanonicalName() + "\" must be assignable to \""
                     + getSchemaClass().getCanonicalName()
                     + "\" or be a Json string representation of it for Avro unmarshalling";
-- 
cgit 1.2.3-korg