make Predicate consistent with java 8

This commit is contained in:
Terence Parr 2015-06-19 11:06:06 -07:00
parent 55a33fb45d
commit 74fbf38ce7
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
package org.antlr.v4.runtime.misc;
public interface Predicate<T> {
boolean apply(T type);
boolean test(T t);
}

View File

@ -320,7 +320,7 @@ public class Trees {
* @since 4.5.1
*/
public static Tree findNodeSuchThat(Tree t, Predicate<Tree> pred) {
if ( pred.apply(t) ) return t;
if ( pred.test(t) ) return t;
int n = t.getChildCount();
for (int i = 0 ; i < n ; i++){