You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2012/09/11 09:16:31 UTC

Re: [4/7] git commit: fix compilation errors for environments with nullability annotation validation

On Tue, Sep 11, 2012 at 8:44 AM,  <iv...@apache.org> wrote:
> fix compilation errors for environments with nullability annotation validation
>
>
> Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
> Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/d86f5e78
> Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/d86f5e78
> Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/d86f5e78
>
> Branch: refs/heads/master
> Commit: d86f5e781bbd0fe14d0ced13b58fc5e9fff57e37
> Parents: aae3a99
> Author: Igor Vaynberg <ig...@gmail.com>
> Authored: Mon Sep 10 20:05:28 2012 -0700
> Committer: Igor Vaynberg <ig...@gmail.com>
> Committed: Mon Sep 10 20:05:28 2012 -0700
>
> ----------------------------------------------------------------------
>  wicket-experimental/wicket-atmosphere/pom.xml      |    6 ++++++
>  .../org/apache/wicket/atmosphere/EventFilter.java  |   10 +++++++++-
>  .../wicket/atmosphere/NoFilterPredicate.java       |   11 ++++++++++-
>  3 files changed, 25 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/d86f5e78/wicket-experimental/wicket-atmosphere/pom.xml
> ----------------------------------------------------------------------
> diff --git a/wicket-experimental/wicket-atmosphere/pom.xml b/wicket-experimental/wicket-atmosphere/pom.xml
> index 53d70df..f647090 100644
> --- a/wicket-experimental/wicket-atmosphere/pom.xml
> +++ b/wicket-experimental/wicket-atmosphere/pom.xml
> @@ -52,6 +52,12 @@
>                                 </exclusion>
>                         </exclusions>
>                 </dependency>
> +               <dependency>
> +                       <groupId>com.google.code.findbugs</groupId>
> +                       <artifactId>jsr305</artifactId>
> +                       <version>1.3.9</version>

Any reason why not to use latest version of this plugin - 2.0.1 ?

> +                       <scope>provided</scope>
> +               </dependency>
>         </dependencies>
>      <build>
>          <plugins>
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/d86f5e78/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java
> ----------------------------------------------------------------------
> diff --git a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java
> index f911a14..65e13bd 100644
> --- a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java
> +++ b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventFilter.java
> @@ -16,6 +16,8 @@
>   */
>  package org.apache.wicket.atmosphere;
>
> +import javax.annotation.Nullable;
> +
>  import com.google.common.base.Predicate;
>
>  /**
> @@ -39,8 +41,14 @@ public class EventFilter implements Predicate<EventSubscription>
>         }
>
>         @Override
> -       public boolean apply(EventSubscription input)
> +       public boolean apply(@Nullable EventSubscription input)
>         {
>                 return input.getFilter().apply(event);

Doesn't that mean that we need to check whether 'input' is null before
calling #getFilter() ?

>         }
> +
> +       @Override
> +       public boolean equals(@Nullable Object other)
> +       {
> +               return super.equals(other);
> +       }
>  }
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/d86f5e78/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/NoFilterPredicate.java
> ----------------------------------------------------------------------
> diff --git a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/NoFilterPredicate.java b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/NoFilterPredicate.java
> index 31f6ab5..d5a5cab 100644
> --- a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/NoFilterPredicate.java
> +++ b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/NoFilterPredicate.java
> @@ -16,6 +16,8 @@
>   */
>  package org.apache.wicket.atmosphere;
>
> +import javax.annotation.Nullable;
> +
>  import com.google.common.base.Predicate;
>
>  /**
> @@ -26,8 +28,15 @@ import com.google.common.base.Predicate;
>  public class NoFilterPredicate implements Predicate<Object>
>  {
>         @Override
> -       public boolean apply(Object input)
> +       public boolean apply(@Nullable Object input)
>         {
>                 return true;
>         }
> +
> +       @Override
> +       public boolean equals(@Nullable Object other)
> +       {
> +               return super.equals(other);
> +       }
> +
>  }
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: [4/7] git commit: fix compilation errors for environments with nullability annotation validation

Posted by Igor Vaynberg <iv...@apache.org>.
On Tue, Sep 11, 2012 at 12:16 AM, Martin Grigorov <mg...@apache.org> wrote:
> On Tue, Sep 11, 2012 at 8:44 AM,  <iv...@apache.org> wrote:
>> fix compilation errors for environments with nullability annotation validation
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/d86f5e78
>> Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/d86f5e78
>> Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/d86f5e78
>>
>> Branch: refs/heads/master
>> Commit: d86f5e781bbd0fe14d0ced13b58fc5e9fff57e37
>> Parents: aae3a99
>> Author: Igor Vaynberg <ig...@gmail.com>
>> Authored: Mon Sep 10 20:05:28 2012 -0700
>> Committer: Igor Vaynberg <ig...@gmail.com>
>> Committed: Mon Sep 10 20:05:28 2012 -0700
>>
>> ----------------------------------------------------------------------
>>  wicket-experimental/wicket-atmosphere/pom.xml      |    6 ++++++
>>  .../org/apache/wicket/atmosphere/EventFilter.java  |   10 +++++++++-
>>  .../wicket/atmosphere/NoFilterPredicate.java       |   11 ++++++++++-
>>  3 files changed, 25 insertions(+), 2 deletions(-)
>> ----------------------------------------------------------------------
>>
>> +               <dependency>
>> +                       <groupId>com.google.code.findbugs</groupId>
>> +                       <artifactId>jsr305</artifactId>
>> +                       <version>1.3.9</version>
>
> Any reason why not to use latest version of this plugin - 2.0.1 ?

i used the same version that guava depends on. in fact it shouldve
come through as transitive, but didnt for some reason. wasnt sure if
2.x is backwards compatible.

>>         @Override
>> -       public boolean apply(EventSubscription input)
>> +       public boolean apply(@Nullable EventSubscription input)
>>         {
>>                 return input.getFilter().apply(event);
>
> Doesn't that mean that we need to check whether 'input' is null before
> calling #getFilter() ?

this is stil on my todo list to look into to. the null processing
shouldve forced that check or errored out at compile time, thats the
point. something is funky.

-igor