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
[master] WFCORE-692 read-children-names(include-aliases=true) can return phantom results #728
Conversation
Windows Build 1377 is now running using a merge of ef9666f |
Linux Build 1822 is now running using a merge of ef9666f |
Windows Build 1377 outcome was SUCCESS using a merge of ef9666f |
Linux Build 1822 outcome was SUCCESS using a merge of ef9666f |
Core - Full Integration Build 973 outcome was FAILURE using a merge of ef9666f Build problems:Failed tests detected Failed tests
|
@@ -687,7 +687,7 @@ public void execute(OperationContext context, ModelNode operation) throws Operat | |||
PathAddress target = aliasEntry.convertToTargetAddress(addr.append(element)); | |||
PathAddress targetParent = target.subAddress(0, target.size() - 1); | |||
Resource parentResource = context.readResourceFromRoot(targetParent, false); | |||
if (parentResource != null && parentResource.hasChildren(target.getLastElement().getKey())) { | |||
if (parentResource != null && parentResource.hasChild(target.getLastElement())) { |
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.
I believe this needs logic to deal with the possibility that target.getLastElement().isWildcard() is true. If so there won't be a child at that address and it will need to be handled more like the "if" block above this "else" block.
I assume it's because of that case that the code was written the way it is, but that left the WFCORE-692 problem.
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.
Good point - I'll adjust this.
Linux Build 1826 is now running using a merge of 64a7087 |
Windows Build 1380 is now running using a merge of 64a7087 |
Windows Build 1380 outcome was SUCCESS using a merge of 64a7087 |
Linux Build 1826 outcome was SUCCESS using a merge of 64a7087 |
if (parentResource != null) { | ||
PathElement targetElement = target.getLastElement(); | ||
if (targetElement.isWildcard() ? parentResource.hasChildren(targetElement.getKey()) : parentResource.hasChild(targetElement)) { | ||
set.add(element.getValue()); |
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.
If targetElement.isWildcard(), then the names of all children of that type need to be added. This will add "*'. (The old code did too.) The block starting here does this:
This code could do the same thing, but using 'parentResource' instead of 'resource' and 'targetElement.getKey()' instead of 'childType'.
…om results if another resource exists with the same key as tje target address of a resource alias.
Windows Build 1382 is now running using a merge of 6975ba2 |
Linux Build 1829 is now running using a merge of 6975ba2 |
Windows Build 1382 outcome was SUCCESS using a merge of 6975ba2 |
Linux Build 1829 outcome was SUCCESS using a merge of 6975ba2 |
Core - Full Integration Build 978 outcome was FAILURE using a merge of 6975ba2 Build problems:Failed tests detected Failed tests
|
[master] WFCORE-692 read-children-names(include-aliases=true) can return phantom results
[JBEAP-17686] Upgrade picketbox to 5.0.3.Final-redhat-00005
… if another resource exists with the same key as tje target address of a resource alias.
https://issues.jboss.org/browse/WFCORE-692