make Predicate consistent with java 8
This commit is contained in:
parent
55a33fb45d
commit
74fbf38ce7
|
@ -1,5 +1,5 @@
|
|||
package org.antlr.v4.runtime.misc;
|
||||
|
||||
public interface Predicate<T> {
|
||||
boolean apply(T type);
|
||||
boolean test(T t);
|
||||
}
|
||||
|
|
|
@ -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++){
|
||||
|
|
Loading…
Reference in New Issue