Commit 735e50ea authored by Jeff Burke's avatar Jeff Burke
Browse files

S1738: update User equal method

parent 0a1c9d2b
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ import java.util.Set;

import ca.nrc.cadc.auth.AuthenticationUtil;

import javax.security.auth.x500.X500Principal;


public class User<T extends Principal>
{
@@ -133,8 +135,19 @@ public class User<T extends Principal>
            return false;
        }
        User other = (User) obj;
        if (userID instanceof X500Principal)
        {
            return AuthenticationUtil.equals(userID, other.userID);
        }
        else
        {
            if (!userID.equals(other.userID))
            {
                return false;
            }
            return true;
        }
    }

    @Override
    public String toString()
+0 −2
Original line number Diff line number Diff line
@@ -175,8 +175,6 @@ public class GroupReaderWriterTest
        GroupWriter.write(expected, xml);
        assertFalse(xml.toString().isEmpty());
        
        System.out.println(xml.toString());
        
        Group actual = GroupReader.read(xml.toString());
        assertNotNull(actual);
        assertEquals(expected, actual);