Skip to content

Commit

Permalink
Fix QuickfixModel - missing @TypeValue (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraZizka authored and jsight committed Sep 20, 2016
1 parent 5d0b208 commit 20689da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
@@ -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 <a href="mailto:hotmana76@gmail.com">Marek Novotny</a>
*/
@TypeValue(TYPE_VALUE)

This comment has been minimized.

Copy link
@mareknovotny

mareknovotny Sep 21, 2016

Contributor

@OndraZizka good catch!

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)

This comment has been minimized.

Copy link
@mareknovotny

mareknovotny Sep 21, 2016

Contributor

@OndraZizka not sure why you changed from name to description as now it doesn't respect the property name, just curious, I know that it is just constant name, but it could confuse a reader.

void setName(String name);

/**
* Contains a human readable description of the quick fix.
*/
@Property(PROPERTY_NAME)
@Property(PROPERTY_DESCRIPTION)
String getName();

/**
Expand Down Expand Up @@ -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)

This comment has been minimized.

Copy link
@mareknovotny

mareknovotny Sep 21, 2016

Contributor

@OndraZizka not sure why you changed from newline to inserted_line as now it doesn't respect the property name, just curious, I know that it is just constant name, but it could confuse a reader.

String getNewline();
}
Expand Up @@ -26,7 +26,7 @@ public QuickfixService(GraphContext context)
*/
public QuickfixModel getOrCreate(String name, QuickfixType type)
{
Iterable<Vertex> results = getTypedQuery().has(QuickfixModel.PROPERTY_TYPE, type).has(QuickfixModel.PROPERTY_NAME, name).vertices();
Iterable<Vertex> results = getTypedQuery().has(QuickfixModel.PROPERTY_TYPE, type).has(QuickfixModel.PROPERTY_DESCRIPTION, name).vertices();
if (!results.iterator().hasNext())
{
QuickfixModel model = create();
Expand Down

0 comments on commit 20689da

Please sign in to comment.