harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r429548 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src: main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java test/java/common/javax/security/auth/kerberos/KerberosPrincipalTest.java
Date Tue, 08 Aug 2006 03:03:31 GMT
Author: smishura
Date: Mon Aug  7 20:03:31 2006
New Revision: 429548

URL: http://svn.apache.org/viewvc?rev=429548&view=rev
Log:
Apply patches for HARMONY-774 ([classlib][auth] unexpected NPE and ClassCastException for
javax.security.auth.kerberos.KerberosPrincipal.equals(obj))

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosPrincipalTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java?rev=429548&r1=429547&r2=429548&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
Mon Aug  7 20:03:31 2006
@@ -163,7 +163,7 @@
         if (obj == this) {
             return true;
         }
-        if (obj instanceof KerberosPrincipal) {
+        if (!(obj instanceof KerberosPrincipal)) {
             return false;
         }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosPrincipalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosPrincipalTest.java?rev=429548&r1=429547&r2=429548&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosPrincipalTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosPrincipalTest.java
Mon Aug  7 20:03:31 2006
@@ -119,6 +119,15 @@
         // .toString());
     }
 
+    /**
+     * @tests javax.security.auth.kerberos.KerberosPrincipal#equals(Object)
+     */
+    public void test_equals() {
+        // Regression for HARMONY-744
+        assertFalse(new KerberosPrincipal("A@B").equals(null));
+        assertFalse(new KerberosPrincipal("A@B").equals(new Object()));
+    }
+
     public static void main(String[] args) {
         junit.textui.TestRunner.run(KerberosPrincipalTest.class);
     }



Mime
View raw message