From f4580fa8a931c84b36d59e2ef853d1fba3d5917e Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 27 Aug 2021 15:24:06 -0400 Subject: Fix sonars in apex-pdp #2 plugins-events thru plugins-persistence-jpa-eclipselink Fixed: - use "var" - disambiguate method parameter types - rename parameter Issue-ID: POLICY-3093 Change-Id: Ife5897015be495403e731754d5862b803a217c87 Signed-off-by: Jim Hahn --- .../policy/apex/plugins/executor/javascript/JavascriptExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/plugins-executor/plugins-executor-javascript/src/main/java') diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptExecutor.java index 344f8c5ae..18aac64cf 100644 --- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptExecutor.java +++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptExecutor.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +68,7 @@ public class JavascriptExecutor { public boolean execute(final Object executionContext) throws StateMachineException { Object returnObject = null; - Context context = Context.enter(); + var context = Context.enter(); try { // Pass the subject context to the Javascript engine Scriptable javascriptScope = context.initStandardObjects(); @@ -91,7 +92,7 @@ public class JavascriptExecutor { } private Script compile(String id, String javascriptCode) throws StateMachineException { - Context context = Context.enter(); + var context = Context.enter(); try { // Set up the default values of the context context.setOptimizationLevel(DEFAULT_OPTIMIZATION_LEVEL); -- cgit