From 8519da3664d7d28536cff505b37b248e06afdc30 Mon Sep 17 00:00:00 2001 From: Tomasz Michalak Date: Tue, 26 Nov 2019 13:41:23 +0100 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Maciej Laskowski --- .../java/io/knotx/fragments/handler/FragmentsHandler.java | 6 +++--- .../task/exception/NodeFactoryNotFoundException.java | 2 +- .../io/knotx/fragments/task/factory/DefaultTaskFactory.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/handler/core/src/main/java/io/knotx/fragments/handler/FragmentsHandler.java b/handler/core/src/main/java/io/knotx/fragments/handler/FragmentsHandler.java index 95b45150..23630f60 100644 --- a/handler/core/src/main/java/io/knotx/fragments/handler/FragmentsHandler.java +++ b/handler/core/src/main/java/io/knotx/fragments/handler/FragmentsHandler.java @@ -43,7 +43,7 @@ public class FragmentsHandler implements Handler { - private static final Logger LOGGER = LoggerFactory.getLogger(TaskProvider.class); + private static final Logger LOGGER = LoggerFactory.getLogger(FragmentsHandler.class); private final RequestContextEngine requestContextEngine; @@ -120,7 +120,7 @@ private List retrieveFragments(List events, private List toEvents(List fragments, ClientRequest clientRequest) { - LOGGER.debug("Processing fragments [{}]", fragments); + LOGGER.trace("Processing fragments [{}]", fragments); return fragments.stream() .map( fragment -> { @@ -129,7 +129,7 @@ private List toEvents(List fragments, return taskProvider.newInstance(fragmentEventContext) .map(task -> { - LOGGER.info("Created task [{}] for fragment [{}]", task, + LOGGER.trace("Created task [{}] for fragment [{}]", task, fragmentEventContext.getFragmentEvent().getFragment().getId()); return task; }) diff --git a/handler/core/src/main/java/io/knotx/fragments/task/exception/NodeFactoryNotFoundException.java b/handler/core/src/main/java/io/knotx/fragments/task/exception/NodeFactoryNotFoundException.java index 0da79872..81529fd0 100644 --- a/handler/core/src/main/java/io/knotx/fragments/task/exception/NodeFactoryNotFoundException.java +++ b/handler/core/src/main/java/io/knotx/fragments/task/exception/NodeFactoryNotFoundException.java @@ -22,7 +22,7 @@ public class NodeFactoryNotFoundException extends ConfigurationException { private String factory; public NodeFactoryNotFoundException(String factory) { - super("Factory not registered for [" + factory + "]"); + super("Node factory not registered for [" + factory + "]"); this.factory = factory; } diff --git a/handler/core/src/main/java/io/knotx/fragments/task/factory/DefaultTaskFactory.java b/handler/core/src/main/java/io/knotx/fragments/task/factory/DefaultTaskFactory.java index e791481d..e385a909 100644 --- a/handler/core/src/main/java/io/knotx/fragments/task/factory/DefaultTaskFactory.java +++ b/handler/core/src/main/java/io/knotx/fragments/task/factory/DefaultTaskFactory.java @@ -116,6 +116,6 @@ private NodeFactory findNodeFactory(ServiceLoader factories, String false); return factoryStream.filter(f -> f.getName().equals(factory)).findFirst() - .orElseThrow(() -> new IllegalStateException("Node not decfined")); + .orElseThrow(() -> new IllegalStateException("Node not defined")); } -} \ No newline at end of file +}