These annotations are wrong and should be removed. Thanks for noticing.
Eclipse had a tendency to automatically set these annotations. This bug is
fixed by now, but these classes were written when Eclipse still had the
bug. The Predicate interface states that it is allowed to throw a
NullPointerException when a predicate does not allow null. These
predicactes (like most) do not make sense when passed null, and should
therefore throw NPE and should not have the @Nullable annotation. Note that
this violates the Liskov substitution principal, but it's still according
to the documentation :). IMHO Guava should not have allowed null in
Predicate and have a subinterface that does allow null.

Best regards,
Emond


On Wed, Mar 5, 2014 at 4:59 PM, Martin Grigorov <[email protected]>wrote:

> Hi Emond,
>
> I see you have used javax.annotation.Nullable  at
>
> https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java?source=c#L44
>
> The tiny bit that bothers me is that the parameter is annotated to be able
> to be null but then you use it directly without check for null. Should we
> add the check or change the annotation with javax.annotation.Nonnull ?
>
> While here - what is the purpose of #equals() override at
>
> https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java?source=c#L52
> ?
> Same in org.apache.wicket.atmosphere.NoFilterPredicate
>
> Martin Grigorov
> Wicket Training and Consulting
>

Reply via email to