Skip to content

Commit

Permalink
Change our IntPredicate, LongPredicate, and DoublePredicate to extend…
Browse files Browse the repository at this point in the history
… the JDK types with the same names.
  • Loading branch information
motlin committed May 30, 2016
1 parent de2f51c commit 383c989
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Goldman Sachs.
* Copyright (c) 2016 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
Expand Down Expand Up @@ -80,4 +80,9 @@ public boolean isDoublePrimitive()
{
return this == DOUBLE;
}

public boolean hasSpecializedStream()
{
return this == INT || this == LONG || this == DOUBLE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@ import java.io.Serializable;
*
* @since 3.0.
*/
<if(primitive.specializedStream)>@FunctionalInterface<endif>
public interface <name>Predicate
extends Serializable
extends <if(primitive.specializedStream)>java.util.function.<name>Predicate, <endif>Serializable
{
boolean accept(<type> value);
<if(primitive.specializedStream)>

@Override
default boolean test(<type> value)
{
return this.accept(value);
}
<endif>
}

>>
3 changes: 3 additions & 0 deletions findbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@
<Class name="org.eclipse.collections.api.block.procedure.ObjectIntProcedure" />
<Class name="org.eclipse.collections.api.block.function.Function" />
<Class name="org.eclipse.collections.api.block.predicate.Predicate" />
<Class name="org.eclipse.collections.api.block.predicate.primitive.IntPredicate" />
<Class name="org.eclipse.collections.api.block.predicate.primitive.LongPredicate" />
<Class name="org.eclipse.collections.api.block.predicate.primitive.DoublePredicate" />
</Or>
</Match>
</FindBugsFilter>

0 comments on commit 383c989

Please sign in to comment.