james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Norman Maurer" <nor...@apache.org>
Subject Re: svn commit: r713928 - /james/server/trunk/jpa-store/src/main/java/org/apache/james/server/jpa/JPAUser.java
Date Fri, 14 Nov 2008 10:27:05 GMT
Perfect.. Thx :-)


2008/11/14 <rdonkin@apache.org>

> Author: rdonkin
> Date: Thu Nov 13 22:36:25 2008
> New Revision: 713928
>
> URL: http://svn.apache.org/viewvc?rev=713928&view=rev
> Log:
> Added missing equals and hash code. Thanks to Norman Maurer for the spot.
>
> Modified:
>
>  james/server/trunk/jpa-store/src/main/java/org/apache/james/server/jpa/JPAUser.java
>
> Modified:
> james/server/trunk/jpa-store/src/main/java/org/apache/james/server/jpa/JPAUser.java
> URL:
> http://svn.apache.org/viewvc/james/server/trunk/jpa-store/src/main/java/org/apache/james/server/jpa/JPAUser.java?rev=713928&r1=713927&r2=713928&view=diff
>
> ==============================================================================
> ---
> james/server/trunk/jpa-store/src/main/java/org/apache/james/server/jpa/JPAUser.java
> (original)
> +++
> james/server/trunk/jpa-store/src/main/java/org/apache/james/server/jpa/JPAUser.java
> Thu Nov 13 22:36:25 2008
> @@ -102,6 +102,35 @@
>         }
>         return result;
>     }
> +
> +    @Override
> +    public int hashCode() {
> +        final int PRIME = 31;
> +        int result = 1;
> +        result = PRIME * result + ((name == null) ? 0 : name.hashCode());
> +        return result;
> +    }
> +
> +    @Override
> +    public boolean equals(Object obj) {
> +        if (this == obj)
> +            return true;
> +        if (obj == null)
> +            return false;
> +        if (getClass() != obj.getClass())
> +            return false;
> +        final JPAUser other = (JPAUser) obj;
> +        if (name == null) {
> +            if (other.name != null)
> +                return false;
> +        } else if (!name.equals(other.name))
> +            return false;
> +        return true;
> +    }
>
> +    @Override
> +     public String toString() {
> +         return "[User " + name + "]";
> +     }
>
>  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message