classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [generics] Patch: FYI: more genericization


From: Tom Tromey
Subject: [cp-patches] [generics] Patch: FYI: more genericization
Date: 06 Dec 2005 18:08:27 -0700

I'm checking this in on the generics branch.

This adds generics in to javax.security.auth.Subject.
I think this covers everything in the japi report as of today (with a
minor exception java.util; and it is a bit hard to be 100% sure as
some of the things in the report have been fixed for a few days).

Tom

2005-12-06  Tom Tromey  <address@hidden>

        * javax/security/auth/Subject.java (Subject): Genericized.
        (getPrincipals): Likewise.
        (getPrivateCredentials): Likewise.
        (getPublicCredentials): Likewise.
        (getPublicCredentials): Likewise.

Index: javax/security/auth/Subject.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/security/auth/Subject.java,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 Subject.java
--- javax/security/auth/Subject.java    20 Sep 2005 18:46:30 -0000      1.2.2.5
+++ javax/security/auth/Subject.java    7 Dec 2005 01:08:36 -0000
@@ -91,8 +91,9 @@
     readOnly = false;
   }
 
-  public Subject (final boolean readOnly, final Set principals,
-                  final Set pubCred, final Set privCred)
+  public Subject (final boolean readOnly,
+                  final Set<? extends Principal> principals,
+                  final Set<?> pubCred, final Set<?> privCred)
   {
     if (principals == null || pubCred == null || privCred == null)
       {
@@ -265,12 +266,12 @@
       privCred.containsAll (that.getPrivateCredentials());
   }
 
-  public Set getPrincipals()
+  public Set<Principal> getPrincipals()
   {
     return principals;
   }
 
-  public Set getPrincipals(Class clazz)
+  public <T extends Principal> Set<T> getPrincipals(Class<T> clazz)
   {
     HashSet result = new HashSet (principals.size());
     for (Iterator it = principals.iterator(); it.hasNext(); )
@@ -284,12 +285,12 @@
     return Collections.unmodifiableSet (result);
   }
 
-  public Set getPrivateCredentials()
+  public Set<Object> getPrivateCredentials()
   {
     return privCred;
   }
 
-  public Set getPrivateCredentials (Class clazz)
+  public <T> Set<T> getPrivateCredentials (Class<T> clazz)
   {
     HashSet result = new HashSet (privCred.size());
     for (Iterator it = privCred.iterator(); it.hasNext(); )
@@ -303,12 +304,12 @@
     return Collections.unmodifiableSet (result);
   }
 
-  public Set getPublicCredentials()
+  public Set<Object> getPublicCredentials()
   {
     return pubCred;
   }
 
-  public Set getPublicCredentials (Class clazz)
+  public <T> Set<T> getPublicCredentials (Class<T> clazz)
   {
     HashSet result = new HashSet (pubCred.size());
     for (Iterator it = pubCred.iterator(); it.hasNext(); )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]