I've found that java.security.Security will return or remove a
security provider by name only if the argument is a string constant or
an interned string. This makes interacting with providers
programmatically inconvenient.

Patch is to use `equals()' and not `=='.

-- 
Casey Marshall || [EMAIL PROTECTED]
Index: java/security/Security.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/security/Security.java,v
retrieving revision 1.28
diff -u -w -r1.28 Security.java
--- java/security/Security.java	29 Apr 2004 23:41:34 -0000	1.28
+++ java/security/Security.java	5 May 2004 05:35:05 -0000
@@ -312,7 +312,7 @@
     int max = providers.size ();
     for (int i = 0; i < max; i++)
       {
-	if (((Provider) providers.elementAt(i)).getName() == name)
+        if (((Provider) providers.elementAt(i)).getName().equals (name))
 	  {
 	    providers.remove(i);
 	    break;
@@ -349,7 +349,7 @@
     for (int i = 0; i < max; i++)
       {
 	p = (Provider) providers.elementAt(i);
-	if (p.getName() == name)
+        if (p.getName().equals (name))
 	  return p;
       }
     return null;
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to