summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/sdc
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-04-07 13:58:09 -0400
committerJim Hahn <jrh3@att.com>2020-04-07 17:15:07 -0400
commit9b3ff5f270572a6760ff07dda9577cdadb53b088 (patch)
treeeacd325199fbb72fddaba94a057178a19e9c3360 /models-interactions/model-impl/sdc
parent3000fdca611c32b7001c553621660b8ea0d2eb49 (diff)
Address sonar issues in models
Addressed the following sonar issues: - use RE2 instead of java.util Pattern for "+" and "*" - don't use deprecated methods - for Date(long), sonar appeared not to parse the argument's type correctly. Modified the code slightly to make sonar happy - duplicate blocks of code - either log or throw - missing assert in junit - for SDNR & VFC, eliminated threads, as they are unnecessary - duplicate code block in different branches - useless assignments - redeclaring abstract methods - cyclomatic complexity - used lombok in some cases (e.g., EqualsAndHashCode) - assert argument order - actually deleted ControlLoopTargetType, because it is not needed and sonar complains regardless of which order is used - add private constructor to utility classes - use StandardCharsets instead of literals Also: - added logback-test.xml to SO to eliminate the voluminous output from the junit test Issue-ID: POLICY-2305 Change-Id: I586c331781bedbd54a115a71847d04d293689445 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/sdc')
-rw-r--r--models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java6
-rw-r--r--models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java6
2 files changed, 10 insertions, 2 deletions
diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java
index d372f1221..3327b78b0 100644
--- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java
+++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* sdc
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,6 +30,10 @@ public class Service implements Serializable {
private static final long serialVersionUID = -1249276698549996806L;
+ /*
+ * Note the field names ending in "UUID" may not be changed without breaking the
+ * interface, due to limitations in the YAML encoder/decoder.
+ */
private UUID serviceUUID;
private UUID serviceInvariantUUID;
private String serviceName;
diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java
index b476de20f..6eac319fd 100644
--- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java
+++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* sdc
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,6 +30,10 @@ public class ServiceInstance implements Serializable {
private static final long serialVersionUID = 6285260780966679625L;
+ /*
+ * Note the field names ending in "UUID" may not be changed without breaking the
+ * interface, due to limitations in the YAML encoder/decoder.
+ */
private UUID personaModelUUID;
private UUID serviceUUID;
private UUID serviceInstanceUUID;