Skip to content

Commit

Permalink
Query#getElements(rootElement, Filter) is backward compatible now
Browse files Browse the repository at this point in the history
  • Loading branch information
pvojtechovsky committed Dec 1, 2016
1 parent a71e8a0 commit a6fb067
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/spoon/reflect/visitor/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public static <E extends CtElement> List<E> getElements(Factory factory,
*/
public static <E extends CtElement> List<E> getElements(
CtElement rootElement, Filter<E> filter) {
return new QueryBuilder<>().onInput(rootElement).then(filter).list();
QueryVisitor<E> visitor = new QueryVisitor<>(filter);
visitor.scan(rootElement);
return visitor.getResult();
}

/**
Expand Down

0 comments on commit a6fb067

Please sign in to comment.