This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit ab0461e31f9c781e82898c19f44961df49209b50 Author: lburgazzoli <lburgazz...@gmail.com> AuthorDate: Tue Jun 25 13:38:38 2019 +0200 checkstyle: fix camel-k-runtime-yaml violations --- .../src/main/java/org/apache/camel/k/yaml/Yaml.java | 3 +++ .../src/main/java/org/apache/camel/k/yaml/model/Definitions.java | 6 +++--- .../main/java/org/apache/camel/k/yaml/parser/ChoiceStepParser.java | 2 +- .../src/main/java/org/apache/camel/k/yaml/parser/StepParser.java | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/Yaml.java b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/Yaml.java index 294002e..b4e1d8c 100644 --- a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/Yaml.java +++ b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/Yaml.java @@ -40,6 +40,9 @@ import org.apache.camel.model.ProcessorDefinition; public final class Yaml { public static final ObjectMapper MAPPER = mapper(); + private Yaml() { + } + public static ObjectMapper mapper() { YAMLFactory yamlFactory = new YAMLFactory() .configure(YAMLGenerator.Feature.MINIMIZE_QUOTES, true) diff --git a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/model/Definitions.java b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/model/Definitions.java index 2996adb..f1ffebf 100644 --- a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/model/Definitions.java +++ b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/model/Definitions.java @@ -31,8 +31,8 @@ import org.apache.camel.model.language.ExpressionDefinition; import org.apache.commons.io.IOUtils; public final class Definitions { - public static Map<String, Class<? extends DataFormatDefinition>> DATA_FORMATS_MAP = dataFormatDefinition(); - public static Map<String, Class<? extends ExpressionDefinition>> EXPRESSIONS_MAP = expressionDefinition(); + public static final Map<String, Class<? extends DataFormatDefinition>> DATA_FORMATS_MAP = dataFormatDefinition(); + public static final Map<String, Class<? extends ExpressionDefinition>> EXPRESSIONS_MAP = expressionDefinition(); private Definitions() { } @@ -74,7 +74,7 @@ public final class Definitions { } } } - } catch (IOException|NoClassDefFoundError|ClassNotFoundException e) { + } catch (IOException | NoClassDefFoundError | ClassNotFoundException e) { throw new IllegalArgumentException(e); } diff --git a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/ChoiceStepParser.java b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/ChoiceStepParser.java index 8fb7190..e5759bd 100644 --- a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/ChoiceStepParser.java +++ b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/ChoiceStepParser.java @@ -29,7 +29,7 @@ public class ChoiceStepParser implements ProcessorStepParser { final Definition definition = context.node(Definition.class); final ChoiceDefinition choice = new ChoiceDefinition(); - StepParserSupport.notNull(definition.when,"when"); + StepParserSupport.notNull(definition.when, "when"); for (Definition.When whenDefinition : definition.when) { StepParserSupport.notNull(whenDefinition.getExpression(), "when.expression"); diff --git a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/StepParser.java b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/StepParser.java index e454d49..f84fa58 100644 --- a/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/StepParser.java +++ b/camel-k-runtime-yaml/src/main/java/org/apache/camel/k/yaml/parser/StepParser.java @@ -28,6 +28,7 @@ import org.apache.camel.util.ObjectHelper; public interface StepParser { String RESOURCE_PATH = "META-INF/services/org/apache/camel/k/yaml/"; + @SuppressWarnings("unchecked") static <T extends StepParser> T lookup(CamelContext camelContext, Class<T> type, String stepId) throws NoFactoryAvailableException { T converter = camelContext.getRegistry().lookupByNameAndType(stepId, type); if (converter == null) {