Skip to content

Commit

Permalink
Merge pull request #858 from kabir/WFCORE-795
Browse files Browse the repository at this point in the history
[WFCORE-795] Copy attribute group and allowed values in the copy attr…
  • Loading branch information
bstansberry committed Jul 3, 2015
2 parents 9febb0f + 2531451 commit 1b9cb97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public AbstractAttributeDefinitionBuilder(final String attributeName, final Attr
this.parser = basis.getParser();
Set<AttributeAccess.Flag> basisFlags = basis.getFlags();
this.flags = basisFlags.toArray(new AttributeAccess.Flag[basisFlags.size()]);
if (basis.getAllowedValues().size() > 0) {
List<ModelNode> basisAllowedValues = basis.getAllowedValues();
this.allowedValues = basisAllowedValues.toArray(new ModelNode[basisAllowedValues.size()]);
}
this.attributeGroup = basis.getAttributeGroup();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ public EnumSet<AttributeAccess.Flag> getFlags() {
* @return allowed values
*/
public List<ModelNode> getAllowedValues() {
if (allowedValues == null) {
return Collections.emptyList();
}
return Arrays.asList(this.allowedValues);
}

Expand Down

0 comments on commit 1b9cb97

Please sign in to comment.