From 8a894e564dc7577d78273c890396ffb5dbe86bbb Mon Sep 17 00:00:00 2001 From: "michal.banka" Date: Tue, 16 Jul 2019 13:51:00 +0200 Subject: Fix checkstyle violations in sdc-main/common Change-Id: I3e132cf4bffd77f9910bf6eff2026c3267873b11 Issue-ID: SDC-2454 Signed-off-by: michal.banka --- .../src/main/java/org/onap/sdc/gab/GABServiceImpl.java | 7 ++++--- .../src/main/java/org/onap/sdc/gab/model/GABQuery.java | 2 +- .../src/main/java/org/onap/sdc/gab/model/GABResultEntry.java | 1 - .../src/main/java/org/onap/sdc/gab/yaml/YamlParser.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main') diff --git a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/GABServiceImpl.java b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/GABServiceImpl.java index 7f6c3539e2..0a8a206e0b 100644 --- a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/GABServiceImpl.java +++ b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/GABServiceImpl.java @@ -21,6 +21,7 @@ package org.onap.sdc.gab; import java.io.IOException; + import org.onap.sdc.gab.model.GABQuery; import org.onap.sdc.gab.model.GABQuery.GABQueryType; import org.onap.sdc.gab.model.GABResults; @@ -35,8 +36,8 @@ public class GABServiceImpl implements GABService { } } - private GABYamlParser parse(GABQuery gabQuery, GABYamlParser gabYamlParser){ - return gabQuery.getType() == GABQueryType.PATH ? - gabYamlParser.parseFile(gabQuery.getDocument()) : gabYamlParser.parseContent(gabQuery.getDocument()); + private GABYamlParser parse(GABQuery gabQuery, GABYamlParser gabYamlParser) { + return gabQuery.getType() == GABQueryType.PATH + ? gabYamlParser.parseFile(gabQuery.getDocument()) : gabYamlParser.parseContent(gabQuery.getDocument()); } } diff --git a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABQuery.java b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABQuery.java index f306e09665..cbe7ef31cf 100644 --- a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABQuery.java +++ b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABQuery.java @@ -35,7 +35,7 @@ public class GABQuery { * PATH - when provided path to the yaml file * CONTENT - when provided yaml file content */ - public enum GABQueryType{ + public enum GABQueryType { PATH, CONTENT } diff --git a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABResultEntry.java b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABResultEntry.java index 45b2412c1e..cc6abd5170 100644 --- a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABResultEntry.java +++ b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/model/GABResultEntry.java @@ -23,7 +23,6 @@ package org.onap.sdc.gab.model; import com.google.common.base.MoreObjects; import lombok.AllArgsConstructor; import lombok.Getter; -import org.onap.sdc.gab.GABService; /** * See GABResultEntry.{@link #path}, GABResultEntry.{@link #data} diff --git a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/yaml/YamlParser.java b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/yaml/YamlParser.java index 0d3575920c..ec4ff1319c 100644 --- a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/yaml/YamlParser.java +++ b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/src/main/java/org/onap/sdc/gab/yaml/YamlParser.java @@ -53,7 +53,7 @@ import org.yaml.snakeyaml.Yaml; */ public class YamlParser implements AutoCloseable { - private static Logger LOGGER = Logger.getLogger(YamlParser.class.getName()); + private static final Logger LOGGER = Logger.getLogger(YamlParser.class.getName()); private Stream parsedYamlContent; private InputStream inputStream; @@ -121,7 +121,7 @@ public class YamlParser implements AutoCloseable { List>>> collect() throws IOException { try { return parsedYamlContent.map(containsKeys).filter(notEmptyListPredicate()).collect(Collectors.toList()); - } catch(Exception e){ + } catch (Exception e) { LOGGER.log(Level.WARNING, "Unexpected document content. Please check body of the yaml file.", e); throw new IOException("Unexpected document content"); } -- cgit 1.2.3-korg