diff options
author | 2024-07-19 11:51:37 +0100 | |
---|---|---|
committer | 2024-07-19 11:55:19 +0100 | |
commit | b8c49fd30e2e660198d29e599a0ccecf184b2071 (patch) | |
tree | 3a45c42aabee26b5b4abcca5e5922896ce4bcf79 /context | |
parent | 9551484946f5c53f9a0ea37c3b0a7810b5d77fab (diff) |
Uplift of json schema validator library
Issue-ID: POLICY-5084
Change-Id: Ie24719570c43a9f7b0fdac28973cc50d8eb7ed2c
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'context')
-rw-r--r-- | context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java index 08289e642..3602ce12a 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2019-2020, 2024 Nordix Foundation. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -84,7 +84,7 @@ public class SchemaHelperFactory { } // Get the class for the schema helper using reflection - Object schemaHelperObject = null; + Object schemaHelperObject; final String pluginClass = schemaHelperParameters.getSchemaHelperPluginClass(); try { schemaHelperObject = Class.forName(pluginClass).getDeclaredConstructor().newInstance(); @@ -96,7 +96,7 @@ public class SchemaHelperFactory { } // Check the class is a schema helper - if (!(schemaHelperObject instanceof SchemaHelper)) { + if (!(schemaHelperObject instanceof SchemaHelper schemaHelper)) { final var resultString = "Specified Apex context schema helper plugin class \"" + pluginClass + "\" does not implement the SchemaHelper interface"; LOGGER.warn(resultString); @@ -104,7 +104,6 @@ public class SchemaHelperFactory { } // The context schema helper to return - final var schemaHelper = (SchemaHelper) schemaHelperObject; // Lock and load the schema helper schemaHelper.init(owningEntityKey.getKey(), schema); |