From dc2b85e4ae6db95a0c09494a928ee6fbdf95594e Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Thu, 6 Aug 2020 10:00:32 +0100 Subject: Sonar Fixes Replace the type specification in this constructor call with the diamond operator and other small fixes Signed-off-by: JvD_Ericsson Issue-ID: POLICY-2760 Change-Id: I83821859a4a1dbbffbaeae15281abac2de3b5712 --- .../apex/model/basicmodel/concepts/AxKeyInformation.java | 4 ++-- .../apex/model/contextmodel/concepts/AxContextAlbums.java | 4 ++-- .../model/contextmodel/concepts/AxContextSchemas.java | 4 ++-- .../policy/apex/model/eventmodel/concepts/AxEvent.java | 8 ++++---- .../policy/apex/model/eventmodel/concepts/AxEvents.java | 4 ++-- .../apex/model/policymodel/concepts/AxPolicies.java | 4 ++-- .../policy/apex/model/policymodel/concepts/AxPolicy.java | 4 ++-- .../policy/apex/model/policymodel/concepts/AxState.java | 10 +++++----- .../policy/apex/model/policymodel/concepts/AxTask.java | 10 +++++----- .../policy/apex/model/policymodel/concepts/AxTasks.java | 4 ++-- .../model/policymodel/handling/PolicyAnalysisResult.java | 15 ++++++++------- 11 files changed, 36 insertions(+), 35 deletions(-) (limited to 'model') diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java index fc876d8ea..446a00a68 100644 --- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java +++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +100,7 @@ public class AxKeyInformation extends AxConcept implements AxConceptGetter()); + this(key, new TreeMap<>()); } /** diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java index a28fbf663..99e5300dc 100644 --- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java +++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,7 +106,7 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter< * @param key the key of the context album container */ public AxContextAlbums(final AxArtifactKey key) { - this(key, new TreeMap()); + this(key, new TreeMap<>()); } /** diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java index a0f031450..8c4110b62 100644 --- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java +++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,7 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter()); + this(key, new TreeMap<>()); } /** diff --git a/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvent.java b/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvent.java index 26e21aed7..156b733ef 100644 --- a/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvent.java +++ b/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvent.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,7 +130,7 @@ public class AxEvent extends AxConcept { * @param key the key of the event */ public AxEvent(final AxArtifactKey key) { - this(key, "", "", "", new TreeMap()); + this(key, "", "", "", new TreeMap<>()); } /** @@ -141,7 +141,7 @@ public class AxEvent extends AxConcept { * @param nameSpace the name space of the event */ public AxEvent(final AxArtifactKey key, final String nameSpace) { - this(key, nameSpace, "", "", new TreeMap()); + this(key, nameSpace, "", "", new TreeMap<>()); } /** @@ -154,7 +154,7 @@ public class AxEvent extends AxConcept { * @param target the target of the event */ public AxEvent(final AxArtifactKey key, final String nameSpace, final String source, final String target) { - this(key, nameSpace, source, target, new TreeMap()); + this(key, nameSpace, source, target, new TreeMap<>()); } /** diff --git a/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvents.java b/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvents.java index 2df7dee07..8c3f294c6 100644 --- a/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvents.java +++ b/model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvents.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,7 @@ public class AxEvents extends AxConcept implements AxConceptGetter { * @param key the event container key */ public AxEvents(final AxArtifactKey key) { - this(key, new TreeMap()); + this(key, new TreeMap<>()); } /** diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java index f3e89a4e0..16e555be1 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +99,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { * @param key the key */ public AxPolicies(final AxArtifactKey key) { - this(key, new TreeMap()); + this(key, new TreeMap<>()); } /** diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java index 502ec3a60..939d094e6 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -134,7 +134,7 @@ public class AxPolicy extends AxConcept { * @param key the key of the policy */ public AxPolicy(final AxArtifactKey key) { - this(key, "", new TreeMap(), ""); + this(key, "", new TreeMap<>(), ""); } /** diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java index 713e4de79..44b71f84a 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -243,12 +243,12 @@ public class AxState extends AxConcept { this(new AxStateParamsBuilder() .key(key) // Key .trigger(AxArtifactKey.getNullKey()) // Trigger Reference - .stateOutputs(new TreeMap()) // State Outputs - .contextAlbumReferenceSet(new TreeSet()) // Context Album Refs + .stateOutputs(new TreeMap<>()) // State Outputs + .contextAlbumReferenceSet(new TreeSet<>()) // Context Album Refs .taskSelectionLogic(new AxTaskSelectionLogic()) // Task Selection Logic - .stateFinalizerLogicMap(new TreeMap()) // State Finalizer Logics + .stateFinalizerLogicMap(new TreeMap<>()) // State Finalizer Logics .defaultTask(AxArtifactKey.getNullKey()) // Default Task - .taskReferenceMap(new TreeMap()) // Task References + .taskReferenceMap(new TreeMap<>()) // Task References ); // @formatter:on } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java index a0aa705b5..20df8d872 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,10 +152,10 @@ public class AxTask extends AxConcept { */ public AxTask(final AxArtifactKey key) { this(key, // Task Key - new TreeMap(), // Input fields - new TreeMap(), // Output Fields - new TreeMap(), // Task Parameters - new TreeSet(), // Context Album References + new TreeMap<>(), // Input fields + new TreeMap<>(), // Output Fields + new TreeMap<>(), // Task Parameters + new TreeSet<>(), // Context Album References new AxTaskLogic(new AxReferenceKey(key)) // Task Logic ); } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java index 4d9dd2089..7986cb658 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,7 +106,7 @@ public class AxTasks extends AxConcept implements AxConceptGetter { * @param key the key */ public AxTasks(final AxArtifactKey key) { - this(key, new TreeMap()); + this(key, new TreeMap<>()); } /** diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java index 7da262c90..96bdc57d0 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -57,20 +58,20 @@ public class PolicyAnalysisResult { */ public PolicyAnalysisResult(final AxPolicyModel policyModel) { for (final AxArtifactKey contextSchemaKey : policyModel.getSchemas().getSchemasMap().keySet()) { - contextSchemaUsage.put(contextSchemaKey, new TreeSet()); + contextSchemaUsage.put(contextSchemaKey, new TreeSet<>()); } for (final Entry contextAlbumEntry : policyModel.getAlbums().getAlbumsMap() .entrySet()) { - contextAlbumUsage.put(contextAlbumEntry.getKey(), new TreeSet()); + contextAlbumUsage.put(contextAlbumEntry.getKey(), new TreeSet<>()); } for (final AxArtifactKey eventKey : policyModel.getEvents().getEventMap().keySet()) { - eventUsage.put(eventKey, new TreeSet()); + eventUsage.put(eventKey, new TreeSet<>()); } for (final AxArtifactKey taskKey : policyModel.getTasks().getTaskMap().keySet()) { - taskUsage.put(taskKey, new TreeSet()); + taskUsage.put(taskKey, new TreeSet<>()); } } -- cgit 1.2.3-korg