Skip to content

Commit

Permalink
Pull #5321: fixed bug on matching xpath when no xpath given
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach committed Dec 5, 2017
1 parent 7a30bb9 commit 799b25c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -121,8 +121,12 @@ private boolean isFileNameAndModuleAndCheckNameMatching(TreeWalkerAuditEvent eve
* @return true is matching
*/
private boolean isXpathQueryMatching(TreeWalkerAuditEvent event) {
boolean isMatching = false;
if (xpathExpression != null) {
boolean isMatching;
if (xpathExpression == null) {
isMatching = true;
}
else {
isMatching = false;
final List<Item> items = getItems(event);
for (Item item : items) {
final AbstractNode abstractNode = (AbstractNode) item;
Expand Down
Expand Up @@ -135,7 +135,7 @@ public void testNoQuery() throws Exception {
TokenTypes.VARIABLE_DEF);
final XpathFilter filter =
new XpathFilter("InputXpathFilterSuppressByXpath", "Test", null, null);
assertTrue("Event should be accepted", filter.accept(event));
assertFalse("Event should be rejected", filter.accept(event));
}

@Test
Expand Down

0 comments on commit 799b25c

Please sign in to comment.