diff options
author | waqas.ikram <waqas.ikram@ericsson.com> | 2018-06-07 16:01:35 +0100 |
---|---|---|
committer | waqas.ikram <waqas.ikram@ericsson.com> | 2018-06-08 11:48:06 +0100 |
commit | 6a9b54b275feff5369419a86997e94d0a95fc48e (patch) | |
tree | 8366bfb005057388b99c5639ed17496c881667f1 /plugins/plugins-context/context-schema | |
parent | 9289ac0afefe62f6c8e9cebddb611a8571bf5642 (diff) |
Fixing Sonar bugs and Vulnerabilities
Change-Id: Id5a95f23f1308dbb9f7f0c0f5567e238ecf830af
Issue-ID: POLICY-859
Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
Diffstat (limited to 'plugins/plugins-context/context-schema')
2 files changed, 2 insertions, 2 deletions
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"; |