From c2cbd89fea87897b6868b036d87d97916e89734e Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 7 May 2021 15:50:22 -0400 Subject: Fix sonars in drools-apps Fixed: - use "var" - add @Override annotation - change constructor to "protected" - use Xxx.class::isIstance Issue-ID: POLICY-3290 Change-Id: I7f0795af306ea5afb46d12a4fe0b22adcbce683a Signed-off-by: Jim Hahn --- .../controlloop/feature/management/ControlLoopManagementFeature.java | 2 +- .../onap/policy/drools/server/restful/RestControlLoopManager.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'controlloop/common/feature-controlloop-management') diff --git a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java index 3c7afb7fd..db078b20c 100644 --- a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java +++ b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java @@ -60,7 +60,7 @@ public class ControlLoopManagementFeature implements PolicyEngineFeatureApi { return controller.getDrools() .facts(sessionName, ControlLoopParams.class.getName(), false) .stream() - .filter(c -> c instanceof ControlLoopParams) + .filter(ControlLoopParams.class::isInstance) .map(ControlLoopParams.class::cast); } diff --git a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java index ba7885678..0a721e8f5 100644 --- a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java +++ b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-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. @@ -39,7 +39,6 @@ import javax.ws.rs.core.Response.Status; import org.onap.policy.aai.AaiManager; import org.onap.policy.controlloop.drl.legacy.ControlLoopParams; import org.onap.policy.drools.apps.controlloop.feature.management.ControlLoopManagementFeature; -import org.onap.policy.drools.system.PolicyEngine; import org.onap.policy.drools.system.PolicyEngineConstants; import org.onap.policy.rest.RestManager; import org.slf4j.Logger; @@ -124,7 +123,7 @@ public class RestControlLoopManager { @Path("engine/tools/controlloops/aai/customQuery/{vserverId}") @ApiOperation(value = "AAI Custom Query") public Response aaiCustomQuery(@ApiParam(value = "vserver Identifier") String vserverId) { - PolicyEngine mgr = PolicyEngineConstants.getManager(); + var mgr = PolicyEngineConstants.getManager(); return Response .status(Status.OK) -- cgit 1.2.3-korg