From e47f942c8087ae86c6d29793a973a54197f5d727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 29 Jan 2019 01:15:09 +0100 Subject: [PATCH] Checkstyle --- .../pmd/util/fxdesigner/app/EventLogger.java | 25 +++++++++++-------- .../fxdesigner/app/NodeSelectionSource.java | 4 +-- .../pmd/util/fxdesigner/app/package-info.java | 5 ++-- .../pmd/util/fxdesigner/model/ASTManager.java | 2 +- .../popups/EditPropertyDialogController.java | 2 +- .../fxdesigner/popups/EventLogController.java | 2 +- .../util/controls/PropertyTableView.java | 2 +- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/EventLogger.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/EventLogger.java index 4be2c5714c..5014c7c209 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/EventLogger.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/EventLogger.java @@ -51,14 +51,15 @@ public class EventLogger implements ApplicationComponent { public EventLogger(DesignerRoot designerRoot) { this.designerRoot = designerRoot; // we have to be careful with initialization order here - EventStream> eventTraces = - // none of this is done if developer mode isn't enabled because then those events aren't even pushed in the first place - reduceEntangledIfPossible(filterOnCategory(latestEvent, false, SELECTION_EVENT_TRACING).map(t -> (LogEntryWithData) t), - // the user data for those is the event - // if they're the same event we reduce them together - (lastEv, newEv) -> Objects.equals(lastEv.getUserData(), newEv.getUserData()), - LogEntryWithData::reduceEventTrace, - EVENT_TRACING_REDUCTION_DELAY); + // none of this is done if developer mode isn't enabled because then those events aren't even pushed in the first place + EventStream> eventTraces = reduceEntangledIfPossible( + filterOnCategory(latestEvent, false, SELECTION_EVENT_TRACING).map(t -> (LogEntryWithData) t), + // the user data for those is the event + // if they're the same event we reduce them together + (lastEv, newEv) -> Objects.equals(lastEv.getUserData(), newEv.getUserData()), + LogEntryWithData::reduceEventTrace, + EVENT_TRACING_REDUCTION_DELAY + ); EventStream onlyParseException = deleteOnSignal(latestEvent, PARSE_EXCEPTION, PARSE_OK); EventStream onlyXPathException = deleteOnSignal(latestEvent, XPATH_EVALUATION_EXCEPTION, XPATH_OK); @@ -86,9 +87,11 @@ public class EventLogger implements ApplicationComponent { private static EventStream deleteOnSignal(EventStream input, Category normal, Category deleteSignal) { - return DesignerUtil.deleteOnSignal(filterOnCategory(input, false, normal, deleteSignal), - x -> x.getCategory() == deleteSignal, - PARSE_EXCEPTION_REDUCTION_DELAY); + return DesignerUtil.deleteOnSignal( + filterOnCategory(input, false, normal, deleteSignal), + x -> x.getCategory() == deleteSignal, + PARSE_EXCEPTION_REDUCTION_DELAY + ); } diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/NodeSelectionSource.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/NodeSelectionSource.java index 9c8d406424..068dfc04fe 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/NodeSelectionSource.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/NodeSelectionSource.java @@ -111,8 +111,8 @@ public interface NodeSelectionSource extends ApplicationComponent { return false; } NodeSelectionEvent that = (NodeSelectionEvent) o; - return Objects.equals(selection, that.selection) && - Objects.equals(origin, that.origin); + return Objects.equals(selection, that.selection) + && Objects.equals(origin, that.origin); } diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/package-info.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/package-info.java index 1ad5fbe310..c2b39724c3 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/package-info.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/app/package-info.java @@ -3,6 +3,7 @@ */ /** - * Interfaces and base classes that structure an support the whole app. + * Interfaces and base classes that structure and support the whole app. + * See {@link net.sourceforge.pmd.util.fxdesigner.app.ApplicationComponent}. */ -package net.sourceforge.pmd.util.fxdesigner.app; \ No newline at end of file +package net.sourceforge.pmd.util.fxdesigner.app; diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/model/ASTManager.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/model/ASTManager.java index 9c20b74595..bf099e1600 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/model/ASTManager.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/model/ASTManager.java @@ -16,9 +16,9 @@ import net.sourceforge.pmd.lang.LanguageVersionHandler; import net.sourceforge.pmd.lang.Parser; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.util.fxdesigner.SourceEditorController; +import net.sourceforge.pmd.util.fxdesigner.app.ApplicationComponent; import net.sourceforge.pmd.util.fxdesigner.app.DesignerRoot; import net.sourceforge.pmd.util.fxdesigner.app.LogEntry.Category; -import net.sourceforge.pmd.util.fxdesigner.app.ApplicationComponent; /** diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EditPropertyDialogController.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EditPropertyDialogController.java index 8d1047bb2a..07b68c6a40 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EditPropertyDialogController.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EditPropertyDialogController.java @@ -21,8 +21,8 @@ import org.reactfx.value.Var; import net.sourceforge.pmd.properties.PropertyTypeId; import net.sourceforge.pmd.properties.ValueParser; import net.sourceforge.pmd.properties.ValueParserConstants; -import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil; import net.sourceforge.pmd.util.fxdesigner.model.PropertyDescriptorSpec; +import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil; import net.sourceforge.pmd.util.fxdesigner.util.controls.PropertyTableView; import javafx.application.Platform; diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EventLogController.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EventLogController.java index ed083b8483..3caea486a8 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EventLogController.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/popups/EventLogController.java @@ -20,10 +20,10 @@ import org.reactfx.value.Var; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.util.fxdesigner.MainDesignerController; +import net.sourceforge.pmd.util.fxdesigner.app.AbstractController; import net.sourceforge.pmd.util.fxdesigner.app.EventLogger; import net.sourceforge.pmd.util.fxdesigner.app.LogEntry; import net.sourceforge.pmd.util.fxdesigner.app.LogEntry.Category; -import net.sourceforge.pmd.util.fxdesigner.app.AbstractController; import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil; import javafx.beans.property.SimpleObjectProperty; diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/PropertyTableView.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/PropertyTableView.java index 81c6d36c08..e8af15a954 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/PropertyTableView.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/PropertyTableView.java @@ -11,9 +11,9 @@ import java.util.function.Consumer; import org.reactfx.value.Var; import net.sourceforge.pmd.properties.PropertyTypeId; +import net.sourceforge.pmd.util.fxdesigner.model.PropertyDescriptorSpec; import net.sourceforge.pmd.util.fxdesigner.popups.EditPropertyDialogController; import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil; -import net.sourceforge.pmd.util.fxdesigner.model.PropertyDescriptorSpec; import net.sourceforge.pmd.util.fxdesigner.util.SoftReferenceCache; import javafx.application.Platform;