diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2021-01-12 15:30:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-01-12 15:30:20 +0000 |
commit | 0e337e84e2edafc0b7cefd86ca596da1fd8e054a (patch) | |
tree | 3395207bb2e1cd0bded180d3f3376372b7530cc4 /cps-service | |
parent | 6ec5273ae659a46dff05bb7993b77202786c92db (diff) | |
parent | 9afc8d1448a6a913db56304d3bc80cd92c141d0f (diff) |
Merge "Enable spotbugs and fix spotbugs warns"
Diffstat (limited to 'cps-service')
3 files changed, 12 insertions, 5 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java b/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java index aa198a9c71..8989e6c328 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java +++ b/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java @@ -20,6 +20,7 @@ package org.onap.cps.spi.model; +import java.io.Serializable; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -29,7 +30,9 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -public class ModuleReference { +public class ModuleReference implements Serializable { + + private static final long serialVersionUID = 1L; private String name; private String namespace; diff --git a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java index 8743b7df1b..8077ed7d88 100644 --- a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java +++ b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java @@ -103,7 +103,7 @@ public class YangUtils { } else if (normalizedNode instanceof LeafSetNode) { inspectLeafList(currentFragment, (LeafSetNode) normalizedNode); } else { - log.warn("Cannot normalize " + normalizedNode.getClass()); + log.warn("Cannot normalize {}", normalizedNode.getClass()); } } diff --git a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java index ae0f2cd3e8..b1462cdc21 100644 --- a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java +++ b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java @@ -19,11 +19,14 @@ package org.onap.cps.yang; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableMap; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; import java.util.Map; @@ -140,8 +143,9 @@ public final class YangTextSchemaSourceSetBuilder { .collect(Collectors.toList()); } - private static YangTextSchemaSource toYangTextSchemaSource(final String sourceName, final String source) { - final Map.Entry<String, String> sourceNameParsed = YangNames.parseFilename(sourceName); + private static YangTextSchemaSource toYangTextSchemaSource(final String sourceName, + final String source) { + final Map.Entry<String, String> sourceNameParsed = checkNotNull(YangNames.parseFilename(sourceName)); final RevisionSourceIdentifier revisionSourceIdentifier = RevisionSourceIdentifier .create(sourceNameParsed.getKey(), Revision.ofNullable(sourceNameParsed.getValue())); @@ -154,7 +158,7 @@ public final class YangTextSchemaSourceSetBuilder { @Override public InputStream openStream() { - return new ByteArrayInputStream(source.getBytes()); + return new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8)); } }; } |