-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DROOLS-4425: Refactor drools-workbench-models Attribute constants #2508
Conversation
130cd28
to
4a5f124
Compare
4a5f124
to
cfd6574
Compare
309dac8
to
9dec438
Compare
import java.util.stream.Stream; | ||
|
||
import org.kie.soup.project.datamodel.oracle.DataType; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Can we add some comment why do we need this attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dupliaka thank you, I added a javadoc in a new commit
@@ -17,6 +17,8 @@ | |||
|
|||
import java.util.List; | |||
|
|||
import org.drools.workbench.models.datamodel.rule.Attribute; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, done
@@ -17,6 +17,7 @@ | |||
|
|||
import java.util.Set; | |||
|
|||
import org.drools.workbench.models.datamodel.rule.Attribute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments. And they were fixed.
@@ -45,26 +45,26 @@ public RuleAttribute() { | |||
public String toString() { | |||
StringBuilder ret = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix in new commit, thank you
@@ -45,26 +45,26 @@ public RuleAttribute() { | |||
public String toString() { | |||
StringBuilder ret = new StringBuilder(); | |||
ret.append( this.attributeName ); | |||
if ( NOLOOP.equals( attributeName ) ) { | |||
if ( NO_LOOP.getAttributeName().equals( attributeName ) ) { | |||
ret.append( " " ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the regression, but I suggest to avoid concatenating characters as strings in StringBuffer/StringBuilder.append methods. Use ' ' instead of " "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do in new commit for all occurrences in this class, thank you
@@ -28,6 +28,7 @@ | |||
import org.drools.workbench.models.guided.dtable.shared.model.adaptors.FactPatternPattern52Adaptor; | |||
import org.kie.soup.project.datamodel.imports.HasImports; | |||
import org.kie.soup.project.datamodel.imports.Imports; | |||
import org.kie.soup.project.datamodel.oracle.DataType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will remove, thank you
GuidedDecisionTable52.RULEFLOW_GROUP_ATTR, | ||
GuidedDecisionTable52.DIALECT_ATTR, | ||
GuidedDecisionTable52.NEGATE_RULE_ATTR ); | ||
return Stream.of(Attribute.values()).map(a->a.getAttributeName()).collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lambda could be replaced by the method reference Attribute::getAttributeName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in new commit, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve with suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, just 2 unused imports to remove.
@@ -20,20 +20,24 @@ | |||
import java.util.HashSet; | |||
import java.util.Set; | |||
|
|||
import org.drools.workbench.models.datamodel.rule.Attribute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jomarko This is an unused import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thank you
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import org.drools.workbench.models.datamodel.rule.Attribute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jomarko Another unused import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thank you
308f931
to
ac83d76
Compare
@kiegroup/gatekeepers could we please merge? |
…n navigator view screenshot (apache#2508)
…n navigator view screenshot (apache#2508)
Ensemble together with:
@Rikkola may I ask you for a review?