commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: svn commit: r825151 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
Date Wed, 14 Oct 2009 18:07:09 GMT


--- On Wed, 10/14/09, sebb <sebbaz@gmail.com> wrote:

> From: sebb <sebbaz@gmail.com>
> Subject: Re: svn commit: r825151 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
> To: dev@commons.apache.org
> Date: Wednesday, October 14, 2009, 12:56 PM
> On 14/10/2009, mbenson@apache.org
> <mbenson@apache.org>
> wrote:
> > Author: mbenson
> >  Date: Wed Oct 14 14:23:13 2009
> >  New Revision: 825151
> >
> >  URL: http://svn.apache.org/viewvc?rev=825151&view=rev
> >  Log:
> >  [COLLECTIONS-341]
> >
> >  Modified:
> > 
>    commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
> >
> >  Modified:
> commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
> >  URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java?rev=825151&r1=825150&r2=825151&view=diff
> > 
> ==============================================================================
> >  ---
> commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
> (original)
> >  +++
> commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
> Wed Oct 14 14:23:13 2009
> >  @@ -28,7 +28,7 @@
> >   *
> >   * @author Stephen Colebourne
> >   */
> >  -public class NOPClosure<E> implements
> Closure<E>, Serializable {
> >  +public final class NOPClosure<E>
> implements Closure<E>, Serializable {
> >
> >      /** Serial version UID */
> >      private static final long
> serialVersionUID = 3518477308466486130L;
> >  @@ -68,13 +68,7 @@
> >       */
> >      @Override
> >      public boolean equals(Object arg0)
> {
> >  -        if (arg0 == this)
> {
> >  -           
> return true;
> >  -        }
> >  -        if (arg0 instanceof
> NOPClosure == false) {
> >  -           
> return false;
> >  -        }
> >  -        return
> arg0.hashCode() == this.hashCode();
> >  +        return arg0 == this
> || arg0 instanceof NOPClosure<?>;
> >      }
> 
> Why not just remove the equals() and hashCode() methods?
> The defaults are just as good.
> 

Yeah, I s'pose that'd be fine as well.  :)

-Matt

> >      /**
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message