Skip to content
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

Merged
merged 6 commits into from
Oct 7, 2019

Conversation

jomarko
Copy link
Contributor

@jomarko jomarko commented Aug 19, 2019

@jomarko jomarko force-pushed the DROOLS-4425-Attribute branch from 4a5f124 to cfd6574 Compare August 22, 2019 13:45
@jomarko jomarko force-pushed the DROOLS-4425-Attribute branch 5 times, most recently from 309dac8 to 9dec438 Compare October 2, 2019 09:06
@jomarko jomarko marked this pull request as ready for review October 2, 2019 09:06
@jomarko jomarko requested review from Rikkola and dupliaka October 2, 2019 09:06
import java.util.stream.Stream;

import org.kie.soup.project.datamodel.oracle.DataType;

Copy link
Contributor

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?

Copy link
Contributor Author

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;

Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, done

Copy link
Contributor

@Rikkola Rikkola left a 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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be final

Copy link
Contributor Author

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( " " );
Copy link
Contributor

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 " "

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused import

Copy link
Contributor Author

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());
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@dupliaka dupliaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with suggestions

Copy link
Contributor

@dupliaka dupliaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with suggestions

Copy link
Contributor

@yesamer yesamer left a 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;
Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jomarko Another unused import.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thank you

@jomarko jomarko force-pushed the DROOLS-4425-Attribute branch from 308f931 to ac83d76 Compare October 4, 2019 08:39
@jomarko
Copy link
Contributor Author

jomarko commented Oct 7, 2019

@kiegroup/gatekeepers could we please merge?

@danielezonca danielezonca merged commit 0553145 into apache:master Oct 7, 2019
tarilabs pushed a commit to tarilabs/drools that referenced this pull request Jun 28, 2022
nprentza pushed a commit to nprentza/drools that referenced this pull request Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants