This issue has been extracted from #27. See #27 for the full details
Would it be possible also to add a fix so that we do not have a NPE in the case the object of the query is not in the tree ?
I..e:
Instead of doing:
TreeNode treeNode = ContextManager.nodeFor(contextObject);
if(treeNode == null) {
return;
}
Set<TreeNode> result = queryBuilder()
.descendants()
.filter(context(attributes(Matchers.<Map<String, Object>>allOf(
hasAttribute("type", descriptor.getType()),
hasAttribute("name", descriptor.getObserverName()),
hasTags(descriptor.getTags())))))
.filter(context(identifier(subclassOf(OperationStatistic.class))))
.build().execute(Collections.singleton(treeNode));
We should be able to just do something like:
Set<TreeNode> result = queryBuilder()
.descendants()
.filter(context(attributes(Matchers.<Map<String, Object>>allOf(
hasAttribute("type", descriptor.getType()),
hasAttribute("name", descriptor.getObserverName()),
hasTags(descriptor.getTags())))))
.filter(context(identifier(subclassOf(OperationStatistic.class))))
.build().execute(Collections.singleton(ContextManager.nodeFor(contextObject)));
or:
.build().execute(contextObject);
And the query system would just return an empty set of nodes because the queried objects are not there.
(related to Terracotta-OSS/terracotta-platform#263)
This issue has been extracted from #27. See #27 for the full details
Would it be possible also to add a fix so that we do not have a NPE in the case the object of the query is not in the tree ?
I..e:
Instead of doing:
We should be able to just do something like:
or:
And the query system would just return an empty set of nodes because the queried objects are not there.
(related to Terracotta-OSS/terracotta-platform#263)