From 59f4f54cdf4c1a5c155360239272da690e8c4a72 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 25 Aug 2020 12:30:29 -0400 Subject: Address more sonar issues in policy-models Addressed sonar issues: - diamond operator Also removed a number of the "NOSONAR" comments now that we know how to address them without disabling sonar. Issue-ID: POLICY-2714 Change-Id: I440f4fa955968fd911616c2b6ee61b4b4d013821 Signed-off-by: Jim Hahn --- .../java/org/onap/policy/models/base/PfConceptContainer.java | 2 +- .../src/main/java/org/onap/policy/models/base/Validated.java | 7 +++---- .../test/java/org/onap/policy/models/base/PfKeyImplTest.java | 4 ++-- .../test/java/org/onap/policy/models/base/PfKeyUseTest.java | 2 +- .../java/org/onap/policy/models/base/PfReferenceKeyTest.java | 2 +- .../src/test/java/org/onap/policy/models/base/PfUtilsTest.java | 1 - .../java/org/onap/policy/models/dao/impl/DefaultPfDao.java | 6 +----- .../src/test/java/org/onap/policy/appc/CommonHeaderTest.java | 7 ++----- .../appc/src/test/java/org/onap/policy/appc/RequestTest.java | 7 ++----- .../src/test/java/org/onap/policy/appc/ResponseStatusTest.java | 7 ++----- .../appc/src/test/java/org/onap/policy/appc/ResponseTest.java | 7 ++----- .../org/onap/policy/controlloop/ControlLoopOperationTest.java | 7 ++----- .../test/java/org/onap/policy/guard/OperationsHistoryTest.java | 5 +---- .../test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java | 7 ++----- .../src/test/java/org/onap/policy/sdnr/PciRequestTest.java | 7 ++----- .../test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java | 7 ++----- .../test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java | 7 ++----- .../sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java | 7 ++----- .../src/test/java/org/onap/policy/sdnr/PciWrapperTest.java | 4 ++-- .../src/test/java/org/onap/policy/so/SoRequestDetailsTest.java | 2 +- .../test/java/org/onap/policy/so/SoResponseWrapperTest.java | 10 ++-------- .../tosca/simple/concepts/JpaToscaConstraintLogical.java | 6 +++--- .../tosca/simple/concepts/JpaToscaConstraintValidValues.java | 5 +++-- .../policy/models/tosca/simple/concepts/JpaToscaDataTypes.java | 4 ++-- .../policy/models/tosca/simple/concepts/JpaToscaPolicies.java | 4 ++-- .../models/tosca/simple/concepts/JpaToscaPolicyTypes.java | 4 ++-- .../models/tosca/simple/concepts/JpaToscaServiceTemplates.java | 3 ++- 27 files changed, 49 insertions(+), 92 deletions(-) diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java index 144d6e61d..b8f2ed6cb 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java @@ -106,7 +106,7 @@ public class PfConceptContainer ex * @param key the concept key */ public PfConceptContainer(@NonNull final PfConceptKey key) { - this(key, new TreeMap()); + this(key, new TreeMap<>()); } /** diff --git a/models-base/src/main/java/org/onap/policy/models/base/Validated.java b/models-base/src/main/java/org/onap/policy/models/base/Validated.java index 26a8a5260..d79d58f13 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/Validated.java +++ b/models-base/src/main/java/org/onap/policy/models/base/Validated.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 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. @@ -70,14 +70,13 @@ public class Validated { * @param result where to place the result * @return the result */ - @SuppressWarnings("java:S3252") // squelch sonar warning for using PkConceptKey instead of PfKeyImpl public PfValidationResult validateNotNull(@NonNull PfConceptKey value, @NonNull PfValidationResult result) { - if (PfConceptKey.NULL_KEY_NAME.equals(value.getName())) { + if (PfKey.NULL_KEY_NAME.equals(value.getName())) { addError(value, "name", result, "null"); } - if (PfConceptKey.NULL_KEY_VERSION.equals(value.getVersion())) { + if (PfKey.NULL_KEY_VERSION.equals(value.getVersion())) { addError(value, "version", result, "null"); } diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java index 8ff5e509c..7bf270b5f 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java @@ -139,8 +139,8 @@ public class PfKeyImplTest { assertEquals(-36, someKey0.compareTo(new DummyPfKey())); assertNotEquals(someKey0, null); - assertEquals(someKey0, someKey0); - assertNotEquals(someKey0, new DummyPfKey()); + assertEquals(someKey0, (Object) someKey0); + assertNotEquals(someKey0, (Object) new DummyPfKey()); MyKey someKey8 = new MyKey(); someKey8.setVersion(VERSION001); diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java index e4933b2b9..f9ad889c7 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java @@ -73,7 +73,7 @@ public class PfKeyUseTest { assertNotEquals(0, keyUse.hashCode()); - assertEquals(keyUse, keyUse); + assertEquals(keyUse, (Object) keyUse); assertEquals(keyUse, clonedKeyUse); assertNotEquals(keyUse, (Object) "Hello"); assertEquals(keyUse, new PfKeyUse(key)); diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java index c1c13c8b3..a27a5ddea 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java @@ -105,7 +105,7 @@ public class PfReferenceKeyTest { assertNotEquals(0, testReferenceKey.hashCode()); - assertEquals(testReferenceKey, testReferenceKey); + assertEquals(testReferenceKey, (Object) testReferenceKey); assertEquals(testReferenceKey, clonedReferenceKey); assertNotEquals(testReferenceKey, (Object) "Hello"); assertNotEquals(testReferenceKey, new PfReferenceKey("PKN", VERSION002, "PLN", "LN")); diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java index f5f5ad002..19f8ee988 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java @@ -23,7 +23,6 @@ package org.onap.policy.models.base; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNull; diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java index 092b14ad8..ad9ef1215 100644 --- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java +++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java @@ -552,11 +552,7 @@ public class DefaultPfDao implements PfDao { final EntityManager mg = getEntityManager(); long size = 0; try { - /* - * Concatenation should be safe because the class name should be safe, thus - * disabling sonar. - */ - size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class) // NOSONAR + size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class) .getSingleResult(); } finally { mg.close(); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java index 3e84a3df2..30d4ed910 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java @@ -83,13 +83,10 @@ public class CommonHeaderTest { copiedCommonHeader.setSubRequestId(commonHeader.getSubRequestId()); copiedCommonHeader.setTimeStamp(commonHeader.getTimeStamp()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(commonHeader, commonHeader); // NOSONAR + assertEquals(commonHeader, (Object) commonHeader); assertEquals(commonHeader, copiedCommonHeader); assertNotEquals(commonHeader, null); - assertNotEquals(commonHeader, "Hello"); // NOSONAR + assertNotEquals(commonHeader, (Object) "Hello"); CommonHeader clonedCommonHeader = new CommonHeader(commonHeader); clonedCommonHeader.setApiVer(commonHeader.getApiVer()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java index 7d804c869..43686a747 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java @@ -72,13 +72,10 @@ public class RequestTest { copiedRequest.setPayload(request.getPayload()); copiedRequest.setTargetId(request.getTargetId()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(request, request); // NOSONAR + assertEquals(request, (Object) request); assertEquals(request, copiedRequest); assertNotEquals(request, null); - assertNotEquals(request, "Hello"); // NOSONAR + assertNotEquals(request, (Object) "Hello"); request.setCommonHeader(null); assertNotEquals(request, copiedRequest); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java index ce8b2148d..c79062594 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java @@ -55,13 +55,10 @@ public class ResponseStatusTest { copiedStatus.setDescription(status.getDescription()); copiedStatus.setValue(status.getValue()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(status, status); // NOSONAR + assertEquals(status, (Object) status); assertEquals(status, copiedStatus); assertNotEquals(status, null); - assertNotEquals(status, "Hello"); // NOSONAR + assertNotEquals(status, (Object) "Hello"); status.setCode(-1); assertNotEquals(status, copiedStatus); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java index 14e14f0f9..9e20331f9 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java @@ -67,13 +67,10 @@ public class ResponseTest { copiedResponse.setStatus(response.getStatus()); copiedResponse.setPayload(response.getPayload()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(response, response); // NOSONAR + assertEquals(response, (Object) response); assertEquals(response, copiedResponse); assertNotEquals(response, null); - assertNotEquals(response, "Hello"); // NOSONAR + assertNotEquals(response, (Object) "Hello"); response.setCommonHeader(null); assertNotEquals(response, copiedResponse); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java index 54eec71b5..eaf4ea93a 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java @@ -35,11 +35,8 @@ public class ControlLoopOperationTest { public void test() { ControlLoopOperation operation = new ControlLoopOperation(); - /* - * Disabling sonar to test equals(). - */ - assertEquals(operation, operation); // NOSONAR - assertNotEquals(operation, ""); // NOSONAR + assertEquals(operation, (Object) operation); + assertNotEquals(operation, (Object) ""); assertNotEquals(operation, null); assertNotEquals(0, operation.hashCode()); diff --git a/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java b/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java index 32827b04b..47bdb4c36 100644 --- a/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java +++ b/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java @@ -63,10 +63,7 @@ public class OperationsHistoryTest { dao.setId(101L); assertNotEquals(hc, dao.hashCode()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(dao, dao); // NOSONAR + assertEquals(dao, (Object) dao); assertNotEquals(dao, new OperationsHistory()); } } diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java index 8c7ee6d53..f4c0bf32d 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java @@ -77,13 +77,10 @@ public class PciCommonHeaderTest { copiedPciCommonHeader.setSubRequestId(commonHeader.getSubRequestId()); copiedPciCommonHeader.setTimeStamp(commonHeader.getTimeStamp()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(commonHeader, commonHeader); // NOSONAR + assertEquals(commonHeader, (Object) commonHeader); assertEquals(commonHeader, copiedPciCommonHeader); assertNotEquals(commonHeader, null); - assertNotEquals(commonHeader, "Hello"); // NOSONAR + assertNotEquals(commonHeader, (Object) "Hello"); PciCommonHeader clonedPciCommonHeader = new PciCommonHeader(commonHeader); clonedPciCommonHeader.setApiVer(commonHeader.getApiVer()); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java index 7719d0966..0bff14de9 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java @@ -59,13 +59,10 @@ public class PciRequestTest { copiedPciRequest.setAction(request.getAction()); copiedPciRequest.setPayload(request.getPayload()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(request, request); // NOSONAR + assertEquals(request, (Object) request); assertEquals(request, copiedPciRequest); assertNotEquals(request, null); - assertNotEquals(request, "Hello"); // NOSONAR + assertNotEquals(request, (Object) "Hello"); request.setCommonHeader(null); assertNotEquals(request, copiedPciRequest); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java index 65f362378..a5c81bc1a 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java @@ -49,13 +49,10 @@ public class PciRequestWrapperTest { PciRequestWrapper copiedPciRequestWrapper = new PciRequestWrapper(); copiedPciRequestWrapper.setBody(requestWrapper.getBody()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(requestWrapper, requestWrapper); // NOSONAR + assertEquals(requestWrapper, (Object) requestWrapper); assertEquals(requestWrapper, copiedPciRequestWrapper); assertNotEquals(requestWrapper, null); - assertNotEquals(requestWrapper, "Hello"); // NOSONAR + assertNotEquals(requestWrapper, (Object) "Hello"); requestWrapper.setBody(null); assertNotEquals(requestWrapper, copiedPciRequestWrapper); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java index cb12083f3..eab065500 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java @@ -49,13 +49,10 @@ public class PciResponseWrapperTest { PciResponseWrapper copiedPciResponseWrapper = new PciResponseWrapper(); copiedPciResponseWrapper.setBody(responseWrapper.getBody()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(responseWrapper, responseWrapper); // NOSONAR + assertEquals(responseWrapper, (Object) responseWrapper); //assertEquals(responseWrapper, copiedPciResponseWrapper); assertNotEquals(responseWrapper, null); - assertNotEquals(responseWrapper, "Hello"); // NOSONAR + assertNotEquals(responseWrapper, (Object) "Hello"); responseWrapper.setBody(null); assertNotEquals(responseWrapper, copiedPciResponseWrapper); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java index 2f6c7f8ba..d496f86fe 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java @@ -50,13 +50,10 @@ public class PciStatusTest { copiedStatus.setCode(status.getCode()); copiedStatus.setValue(status.getValue()); - /* - * Disabling sonar to test equals(). - */ - assertEquals(status, status); // NOSONAR + assertEquals(status, (Object) status); assertEquals(status, copiedStatus); assertNotEquals(status, null); - assertNotEquals(status, "Hello"); // NOSONAR + assertNotEquals(status, (Object) "Hello"); status.setCode(-1); assertNotEquals(status, copiedStatus); diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java index d25be8340..914974691 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java @@ -68,10 +68,10 @@ public class PciWrapperTest { copiedPciWrapper.setCorrelationId(wrapper.getCorrelationId()); copiedPciWrapper.setType(wrapper.getType()); - assertEquals(wrapper, wrapper); + assertEquals(wrapper, (Object) wrapper); assertEquals(wrapper, copiedPciWrapper); assertNotEquals(wrapper, null); - assertNotEquals(wrapper, "Hello"); + assertNotEquals(wrapper, (Object) "Hello"); wrapper.setVersion(null); assertNotEquals(wrapper, copiedPciWrapper); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java index f7b663e4b..43d5cd38a 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java @@ -113,7 +113,7 @@ public class SoRequestDetailsTest { SoRequestDetails copiedDetails = new SoRequestDetails(details); - assertEquals(details, details); + assertEquals(details, (Object) details); assertEquals(details, copiedDetails); assertNotEquals(details, null); assertNotEquals(details, (Object) "Hello"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java index e508c44f8..42f57c7e4 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java @@ -72,16 +72,10 @@ public class SoResponseWrapperTest { SoResponseWrapper identicalResponseWrapper = new SoResponseWrapper(response, requestId); - /* - * Disabling sonar because we are purposely checking various branches of the - * equals() method. - */ - assertEquals(responseWrapper, responseWrapper); // NOSONAR + assertEquals(responseWrapper, (Object) responseWrapper); assertEquals(responseWrapper, identicalResponseWrapper); - assertNotEquals(null, responseWrapper); - assertNotEquals("Hello", responseWrapper); // NOSONAR assertNotEquals(responseWrapper, null); - assertNotEquals(responseWrapper, "AString"); // NOSONAR + assertNotEquals(responseWrapper, (Object) "AString"); assertEquals(new SoResponseWrapper(null, null), new SoResponseWrapper(null, null)); assertNotEquals(new SoResponseWrapper(null, null), identicalResponseWrapper); diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java index cd6216473..73546f681 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java @@ -37,12 +37,10 @@ public class JpaToscaConstraintLogical extends JpaToscaConstraint { private static final long serialVersionUID = -2730203215911880756L; @Column - @NonNull @Getter private JpaToscaConstraintOperation operation; @Column - @NonNull @Getter private String compareTo; @@ -63,8 +61,10 @@ public class JpaToscaConstraintLogical extends JpaToscaConstraint { * * @param authorativeConcept the authorative concept to copy from */ - @SuppressWarnings("java:S2637") public JpaToscaConstraintLogical(final ToscaConstraint authorativeConcept) { + /* + * The following will call invoke fromAuthorative() which will populate the class fields. + */ super(authorativeConcept); } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java index 8f10acad9..9941bc9fd 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java @@ -42,7 +42,6 @@ public class JpaToscaConstraintValidValues extends JpaToscaConstraint { private static final long serialVersionUID = -5060193250508635456L; @ElementCollection - @NonNull @Getter private List validValues; @@ -60,8 +59,10 @@ public class JpaToscaConstraintValidValues extends JpaToscaConstraint { * * @param authorativeConcept the authorative concept to copy from */ - @SuppressWarnings("java:S2637") public JpaToscaConstraintValidValues(final ToscaConstraint authorativeConcept) { + /* + * The following will call invoke fromAuthorative() which will populate the class fields. + */ super(authorativeConcept); } diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java index afcb87473..e570c05bb 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019-2020 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. @@ -70,7 +70,7 @@ public class JpaToscaDataTypes extends PfConceptContainer()); + super(key, new TreeMap<>()); } /** diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java index f1f8e5d09..ba32ac314 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019-2020 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. @@ -72,7 +72,7 @@ public class JpaToscaPolicies extends PfConceptContainer()); + super(key, new TreeMap<>()); } /** diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java index ee2c82ba5..0a3d070ca 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019-2020 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. @@ -70,7 +70,7 @@ public class JpaToscaPolicyTypes extends PfConceptContainer()); + super(key, new TreeMap<>()); } /** diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplates.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplates.java index 23c81b677..4f9fa43f8 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplates.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplates.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2020 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. @@ -61,7 +62,7 @@ public class JpaToscaServiceTemplates extends PfConceptContainer()); + super(key, new TreeMap<>()); } /** -- cgit 1.2.3-korg