geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/security/src/java/org/apache/geronimo/security PrimaryRealmPrincipal.java
Date Sun, 13 Jun 2004 16:52:53 GMT
adc         2004/06/13 09:52:53

  Modified:    modules/security/src/java/org/apache/geronimo/security
                        PrimaryRealmPrincipal.java
  Log:
  Should implement its own equals() method.
  
  Revision  Changes    Path
  1.5       +18 -1     incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/PrimaryRealmPrincipal.java
  
  Index: PrimaryRealmPrincipal.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/PrimaryRealmPrincipal.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PrimaryRealmPrincipal.java	10 Mar 2004 09:59:25 -0000	1.4
  +++ PrimaryRealmPrincipal.java	13 Jun 2004 16:52:53 -0000	1.5
  @@ -28,4 +28,21 @@
       public PrimaryRealmPrincipal(String realm, Principal principal) {
           super(realm, principal);
       }
  +
  +    /**
  +     * Compares this principal to the specified object.  Returns true
  +     * if the object passed in matches the principal represented by
  +     * the implementation of this interface.
  +     *
  +     * @param another principal to compare with.
  +     * @return true if the principal passed in is the same as that
  +     *         encapsulated by this principal, and false otherwise.
  +     */
  +    public boolean equals(Object another) {
  +        if (!(another instanceof PrimaryRealmPrincipal)) return false;
  +
  +        PrimaryRealmPrincipal realmPrincipal = (PrimaryRealmPrincipal) another;
  +
  +        return getRealm().equals(realmPrincipal.getRealm()) && getPrincipal().equals(realmPrincipal.getPrincipal());
  +    }
   }
  
  
  

Mime
View raw message