From 20689da3df64d96c03e922bc57f9092156b57b1d Mon Sep 17 00:00:00 2001 From: Ondrej Zizka Date: Tue, 20 Sep 2016 18:54:45 +0200 Subject: [PATCH] Fix QuickfixModel - missing @TypeValue (#1015) --- .../windup/reporting/model/QuickfixModel.java | 27 ++++++++++--------- .../reporting/service/QuickfixService.java | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/reporting/api/src/main/java/org/jboss/windup/reporting/model/QuickfixModel.java b/reporting/api/src/main/java/org/jboss/windup/reporting/model/QuickfixModel.java index b4aa0facb1..18d56858ff 100644 --- a/reporting/api/src/main/java/org/jboss/windup/reporting/model/QuickfixModel.java +++ b/reporting/api/src/main/java/org/jboss/windup/reporting/model/QuickfixModel.java @@ -1,44 +1,47 @@ package org.jboss.windup.reporting.model; import com.tinkerpop.frames.Property; +import com.tinkerpop.frames.modules.typedgraph.TypeValue; import org.jboss.windup.graph.model.WindupVertexFrame; +import static org.jboss.windup.reporting.model.QuickfixModel.TYPE_VALUE; /** * Represents a {@link QuickfixModel} within the graph. * * @author Marek Novotny */ +@TypeValue(TYPE_VALUE) public interface QuickfixModel extends WindupVertexFrame { - String TYPE = "QuickfixModel"; - String PROPERTY_TYPE = "type"; - String PROPERTY_NAME = "name"; - String PROPERTY_SEARCH_STRING = "search"; - String PROPERTY_REPLACEMENT_STRING = "replacement"; - String PROPERTY_NEWLINE_STRING = "newline"; + String TYPE_VALUE = "Quickfix"; + String PROPERTY_TYPE = TYPE_VALUE + "-type"; + String PROPERTY_DESCRIPTION = TYPE_VALUE + "-description"; + String PROPERTY_SEARCH_STRING = TYPE_VALUE + "-search"; + String PROPERTY_REPLACEMENT_STRING = TYPE_VALUE + "-replacement"; + String PROPERTY_INSERTED_LINE = TYPE_VALUE + "-insertedLine"; /** * Contains the Quickfix type {@link QuickfixType} */ - @Property(TYPE) + @Property(PROPERTY_TYPE) void setQuickfixType(QuickfixType type); /** * Contains the Quickfix type {@link QuickfixType} */ - @Property(TYPE) + @Property(PROPERTY_TYPE) QuickfixType getQuickfixType(); /** * Contains a human readable description of the quick fix. */ - @Property(PROPERTY_NAME) + @Property(PROPERTY_DESCRIPTION) void setName(String name); /** * Contains a human readable description of the quick fix. */ - @Property(PROPERTY_NAME) + @Property(PROPERTY_DESCRIPTION) String getName(); /** @@ -68,12 +71,12 @@ public interface QuickfixModel extends WindupVertexFrame /** * Contains the new line to be inserted (if this is a line insertion). */ - @Property(PROPERTY_NEWLINE_STRING) + @Property(PROPERTY_INSERTED_LINE) void setNewline(String newlineStr); /** * Contains the new line to be inserted (if this is a line insertion). */ - @Property(PROPERTY_NEWLINE_STRING) + @Property(PROPERTY_INSERTED_LINE) String getNewline(); } diff --git a/reporting/api/src/main/java/org/jboss/windup/reporting/service/QuickfixService.java b/reporting/api/src/main/java/org/jboss/windup/reporting/service/QuickfixService.java index 3f154a1fa8..b4168ce2bc 100644 --- a/reporting/api/src/main/java/org/jboss/windup/reporting/service/QuickfixService.java +++ b/reporting/api/src/main/java/org/jboss/windup/reporting/service/QuickfixService.java @@ -26,7 +26,7 @@ public QuickfixService(GraphContext context) */ public QuickfixModel getOrCreate(String name, QuickfixType type) { - Iterable results = getTypedQuery().has(QuickfixModel.PROPERTY_TYPE, type).has(QuickfixModel.PROPERTY_NAME, name).vertices(); + Iterable results = getTypedQuery().has(QuickfixModel.PROPERTY_TYPE, type).has(QuickfixModel.PROPERTY_DESCRIPTION, name).vertices(); if (!results.iterator().hasNext()) { QuickfixModel model = create();