harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r451801 [1/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common: javax/security/auth/ javax/security/auth/callback/ javax/security/auth/kerberos/ javax/security/auth/login/ javax/security/auth/x500/ javax/sec...
Date Sun, 01 Oct 2006 20:16:10 GMT
Author: ndbeyer
Date: Sun Oct  1 13:16:07 2006
New Revision: 451801

URL: http://svn.apache.org/viewvc?view=rev&rev=451801
Log:
Clean up compiler warnings in auth tests.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/AuthPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PolicyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosKeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/AppConfigurationEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/ConfigurationTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigParserTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/ChoiceCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/ConfirmationCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/LanguageCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/NameCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/PasswordCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/TextInputCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/TextOutputCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/callback/serialization/UnsupportedCallbackExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/serialization/DelegationPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/serialization/KrbDelegationPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/serialization/KrbServicePermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/serialization/ServicePermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/LoginContextTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/AccountExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/AccountExpiredExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/AccountLockedExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/AccountNotFoundExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/CredentialExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/CredentialExpiredExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/CredentialNotFoundExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/FailedLoginExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/serialization/LoginExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/serialization/AuthPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/serialization/DestroyFailedExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/serialization/PrivateCredentialPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/serialization/RefreshFailedExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/serialization/SubjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/x500/serialization/X500PrincipalTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/serialization/AuthenticationExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/serialization/AuthorizeCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/serialization/RealmCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/serialization/RealmChoiceCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/serialization/SaslExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/Krb5LoginModuleTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/support/SecurityChecker.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSManagerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/AuthPermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/AuthPermissionTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/AuthPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/AuthPermissionTest.java Sun Oct  1 13:16:07 2006
@@ -37,6 +37,7 @@
     }
 
    
+    @Override
     protected void setUp() throws Exception {
         ap = new AuthPermission("name");
         ap1 = new AuthPermission("createLoginContext");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PolicyTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PolicyTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PolicyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PolicyTest.java Sun Oct  1 13:16:07 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Alexey V. Varlamov
-* @version $Revision$
-*/
-
 package javax.security.auth;
 
 import java.io.File;
@@ -43,12 +38,9 @@
 /**
  * Tests Policy class
  */
+@SuppressWarnings("deprecation")
 public class PolicyTest extends TestCase {
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(PolicyTest.class);
-    }
-
     /**
      * Tests that setPolicy() is properly secured via SecurityManager.
      */
@@ -110,11 +102,13 @@
 
     public static class TestProvider extends Policy {
 
+        @Override
         public PermissionCollection getPermissions(Subject subject,
                 CodeSource cs) {
             return null;
         }
 
+        @Override
         public void refresh() {
         }
     }
@@ -188,7 +182,7 @@
         PermissionCollection c;
         Permission per;
         Subject subject;
-        Enumeration e;
+        Enumeration<Permission> e;
         CodeSource source;
 
         String oldProp = System.getProperty(POLICY_PROP);
@@ -237,7 +231,7 @@
 
             e = p.getPermissions(subject, null).elements();
 
-            per = (Permission) e.nextElement();
+            per = e.nextElement();
             assertFalse("Elements: ", e.hasMoreElements());
             assertEquals("Permission: ", per, new FilePermission("/home/duke",
                     "read, write"));
@@ -265,7 +259,7 @@
             subject.getPrincipals().add(new MyPrincipal("dummy"));
 
             e = p.getPermissions(subject, source).elements();
-            per = (Permission) e.nextElement();
+            per = e.nextElement();
             assertFalse("Elements: ", e.hasMoreElements());
             assertEquals("Permission: ", per, new RuntimePermission(
                     "createClassLoader"));
@@ -296,7 +290,7 @@
 
             subject.getPrincipals().add(new OtherPrincipal("other"));
             e = p.getPermissions(subject, null).elements();
-            per = (Permission) e.nextElement();
+            per = e.nextElement();
             assertFalse("Elements: ", e.hasMoreElements());
             assertEquals("Permission: ", per, new AllPermission());
 
@@ -309,8 +303,8 @@
             e = p.getPermissions(subject, null).elements();
 
             Permission[] get = new Permission[2];
-            get[0] = (Permission) e.nextElement();
-            get[1] = (Permission) e.nextElement();
+            get[0] = e.nextElement();
+            get[1] = e.nextElement();
             assertFalse("Elements: ", e.hasMoreElements());
 
             Permission[] set = new Permission[2];
@@ -333,7 +327,7 @@
 
         Permission per;
         Subject subject;
-        Enumeration e;
+        Enumeration<Permission> e;
 
         String oldProp = System.getProperty(POLICY_PROP);
         try {
@@ -350,7 +344,7 @@
 
             e = p.getPermissions(subject, null).elements();
 
-            per = (Permission) e.nextElement();
+            per = e.nextElement();
             assertFalse("Elements: ", e.hasMoreElements());
             assertEquals("Permission: ", per, new FilePermission("/home/duke",
                     "read, write"));
@@ -364,7 +358,7 @@
 
             e = p.getPermissions(subject, null).elements();
 
-            per = (Permission) e.nextElement();
+            per = e.nextElement();
             assertFalse("Elements: ", e.hasMoreElements());
             assertEquals("Permission: ", per, new RuntimePermission(
                     "createClassLoader"));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java Sun Oct  1 13:16:07 2006
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
-* @author Maxim V. Makarov
-* @version $Revision$
-*/
 
 package javax.security.auth;
 
@@ -44,19 +40,6 @@
 
     String s_this;
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(PrivateCredentialPermissionTest.class);
-    }
-
-    /**
-     * Constructor for PrivateCredentialPermissionTest.
-     * 
-     * @param name
-     */
-    public PrivateCredentialPermissionTest(String name) {
-        super(name);
-    }
-
     /**
      * [C1 P1 "duke"] implies [C1 P1 "duke" P2 "nuke"]. 
      */
@@ -647,7 +630,7 @@
 
         MyPrincipal mp = new MyPrincipal("duke");
         MyPrincipal mp1 = new MyPrincipal("nuke");
-        HashSet hash = new HashSet();
+        HashSet<Principal> hash = new HashSet<Principal>();
         hash.add(mp);
         hash.add(mp1);
 
@@ -661,7 +644,7 @@
         assertTrue(p2.implies(p1));
 
         PrivateCredentialPermission p3 = new PrivateCredentialPermission(
-                "java.lang.Object", new HashSet());
+                "java.lang.Object", new HashSet<Principal>());
 
         PrivateCredentialPermission p4 = new PrivateCredentialPermission(
                 "java.lang.Object * \"*\"", "read");
@@ -697,9 +680,9 @@
                 "a b  \"c\"" // two spaces between principal class and name
         };
 
-        for (int i = 0; i < illegalTargetNames.length; i++) {
+        for (String element : illegalTargetNames) {
             try {
-                new PrivateCredentialPermission(illegalTargetNames[i], "read");
+                new PrivateCredentialPermission(element, "read");
                 fail("No expected IllegalArgumentException");
             } catch (IllegalArgumentException e) {
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java Sun Oct  1 13:16:07 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Stepan M. Mishura
-* @version $Revision$
-*/
-
 package javax.security.auth;
 
 import java.io.ByteArrayInputStream;
@@ -59,47 +54,47 @@
         }
     };
 
-    PrivilegedAction emptyPAction = new PrivilegedAction() {
+    PrivilegedAction<?> emptyPAction = new PrivilegedAction<Object>() {
         public Object run() {
             return null;
         }
     };
 
-    PrivilegedExceptionAction emptyPEAction = new PrivilegedExceptionAction() {
+    PrivilegedExceptionAction<?> emptyPEAction = new PrivilegedExceptionAction<Object>() {
         public Object run() {
             return null;
         }
     };
 
-    PrivilegedAction contextPAction = new PrivilegedAction() {
-        public Object run() {
+    PrivilegedAction<AccessControlContext> contextPAction = new PrivilegedAction<AccessControlContext>() {
+        public AccessControlContext run() {
             return AccessController.getContext();
         }
     };
 
-    PrivilegedExceptionAction contextPEAction = new PrivilegedExceptionAction() {
-        public Object run() {
+    PrivilegedExceptionAction<AccessControlContext> contextPEAction = new PrivilegedExceptionAction<AccessControlContext>() {
+        public AccessControlContext run() {
             return AccessController.getContext();
         }
     };
 
-    PrivilegedAction subjectPAction = new PrivilegedAction() {
-        public Object run() {
+    PrivilegedAction<Subject> subjectPAction = new PrivilegedAction<Subject>() {
+        public Subject run() {
             return Subject.getSubject(AccessController.getContext());
         }
     };
 
-    PrivilegedExceptionAction subjectPEAction = new PrivilegedExceptionAction() {
-        public Object run() {
+    PrivilegedExceptionAction<Subject> subjectPEAction = new PrivilegedExceptionAction<Subject>() {
+        public Subject run() {
             return Subject.getSubject(AccessController.getContext());
         }
     };
 
-    private HashSet h1 = new HashSet(); // principals
+    private final HashSet<Principal> h1 = new HashSet<Principal>(); // principals
 
-    private HashSet h2 = new HashSet(); // public credentials
+    private final HashSet<Object> h2 = new HashSet<Object>(); // public credentials
 
-    private HashSet h3 = new HashSet(); // private credentials
+    private final HashSet<Object> h3 = new HashSet<Object>(); // private credentials
 
     public static void main(String[] args) throws Exception {
         junit.textui.TestRunner.run(javax.security.auth.SubjectTest.suite());
@@ -203,19 +198,19 @@
     public final void testSubject_3Set_NPE() {
 
         try {
-            new Subject(false, null, new HashSet(), new HashSet());
+            new Subject(false, null, new HashSet<Object>(), new HashSet<Object>());
             fail("No expected NullPointerException");
         } catch (NullPointerException e) {
         }
 
         try {
-            new Subject(false, new HashSet(), null, new HashSet());
+            new Subject(false, new HashSet<Principal>(), null, new HashSet<Object>());
             fail("No expected NullPointerException");
         } catch (NullPointerException e) {
         }
 
         try {
-            new Subject(false, new HashSet(), new HashSet(), null);
+            new Subject(false, new HashSet<Principal>(), new HashSet<Object>(), null);
             fail("No expected NullPointerException");
         } catch (NullPointerException e) {
         }
@@ -225,13 +220,14 @@
      * Testing Subject(boolean,Set,Set,Set) constructor.
      * Parameter set contains an invalid element.
      */
+    @SuppressWarnings("unchecked")
     public final void testSubject_3Set_InvalidSet() {
-        HashSet hash = new HashSet();
+        HashSet<Object> hash = new HashSet<Object>();
 
         hash.add(null);
 
         try {
-            new Subject(false, hash, new HashSet(), new HashSet());
+            new Subject(false, (Set<? extends Principal>)hash, new HashSet<Object>(), new HashSet<Object>());
 
             if (!testing) {
                 // possible to add 'null' principal via constructor
@@ -241,7 +237,7 @@
         }
 
         try {
-            new Subject(false, new HashSet(), hash, new HashSet());
+            new Subject(false, new HashSet<Principal>(), hash, new HashSet<Object>());
 
             if (!testing) {
                 fail("No expected NullPointerException");
@@ -250,7 +246,7 @@
         }
 
         try {
-            new Subject(false, new HashSet(), new HashSet(), hash);
+            new Subject(false, new HashSet<Principal>(), new HashSet<Object>(), hash);
 
             if (!testing) {
                 fail("No expected NullPointerException");
@@ -261,7 +257,7 @@
         hash.clear();
         hash.add(new Object());
         try {
-            new Subject(false, hash, new HashSet(), new HashSet());
+            new Subject(false, (Set<? extends Principal>)hash, new HashSet(), new HashSet());
 
             if (!testing) {
                 // possible to add 'null' principal via constructor
@@ -507,10 +503,10 @@
 
         // empty sets
         Subject s1 = new Subject();
-        Subject s2 = new Subject(false, new HashSet(), new HashSet(),
-                new HashSet());
-        Subject s3 = new Subject(true, new HashSet(), new HashSet(),
-                new HashSet());
+        Subject s2 = new Subject(false, new HashSet<Principal>(), new HashSet<Object>(),
+                new HashSet<Object>());
+        Subject s3 = new Subject(true, new HashSet<Principal>(), new HashSet<Object>(),
+                new HashSet<Object>());
 
         equalsTest(s1, s2, s3);
 
@@ -528,7 +524,7 @@
 
         // not equal subjects
         s1 = new Subject();
-        s2 = new Subject(true, h1, new HashSet(), h3);
+        s2 = new Subject(true, h1, new HashSet<Object>(), h3);
         s3 = new Subject(true, h1, h2, h3);
 
         assertFalse(s1.equals(s2));
@@ -576,30 +572,30 @@
 
         grantMode(); // no permissions
 
-        HashSet hash = new HashSet();
+        HashSet<Principal> hash = new HashSet<Principal>();
         hash.add(principal);
 
-        Subject subject1 = new Subject(false, new HashSet(), new HashSet(),
+        Subject subject1 = new Subject(false, new HashSet<Principal>(), new HashSet<Object>(),
                 hash);
 
         //doesn't verify private credential permissions on itself
         assertTrue(subject1.equals(subject1));
 
-        // principals comparision goes before
+        // principals comparison goes before
         // no SecurityException expected 
-        Subject subject2 = new Subject(false, hash, new HashSet(), hash);
+        Subject subject2 = new Subject(false, hash, new HashSet<Object>(), hash);
 
         assertFalse(subject1.equals(subject2));
 
-        // public credential comparision goes before
+        // public credential comparison goes before
         // no SecurityException expected 
-        subject2 = new Subject(false, new HashSet(), hash, hash);
+        subject2 = new Subject(false, new HashSet<Principal>(), hash, hash);
 
         assertFalse(subject1.equals(subject2));
 
-        // principal and public credentils sets are equal
+        // principal and public credentials sets are equal
         // Expected: SecurityException
-        subject2 = new Subject(false, new HashSet(), new HashSet(), hash);
+        subject2 = new Subject(false, new HashSet<Principal>(), new HashSet<Object>(), hash);
         try {
             subject1.equals(subject2);
             fail("No expected AccessControlException");
@@ -654,7 +650,7 @@
      * Tests Subject.get<set>(Class) methods
      */
     public final void testGetSetClass() {
-        HashSet hash = new HashSet();
+        HashSet<MyClass1> hash = new HashSet<MyClass1>();
 
         MyClass1 p1 = new MyClass1();
         MyClass1 p2 = new MyClass1();
@@ -662,7 +658,7 @@
         hash.add(p1);
         hash.add(p2);
 
-        HashSet h = new HashSet();
+        HashSet<Principal> h = new HashSet<Principal>();
 
         h.add(principal);
         h.addAll(hash);
@@ -746,10 +742,10 @@
      */
     public final void test_getSubject_NotSameSubject() {
 
-        final HashSet hash = new HashSet();
+        final HashSet<MyClass1> hash = new HashSet<MyClass1>();
         hash.add(new MyClass1());
 
-        PrivilegedAction action = new PrivilegedAction() {
+        PrivilegedAction<?> action = new PrivilegedAction<Object>() {
             public Object run() {
 
                 return Subject.doAs(new Subject(false, hash, hash, hash),
@@ -775,7 +771,7 @@
      */
     public final void test_getSubject_PrivilegedAction() {
 
-        PrivilegedAction action = new PrivilegedAction() {
+        PrivilegedAction<?> action = new PrivilegedAction<Object>() {
             public Object run() {
                 return AccessController.doPrivileged(subjectPAction);
             }
@@ -1429,7 +1425,7 @@
 
     public static class PermissionTest extends SecurityTest {
 
-        private Subject subject = new Subject();
+        private final Subject subject = new Subject();
 
         /*
          * FIXME??? presence of unaccessible element
@@ -1443,11 +1439,11 @@
             Principal privCr1 = new MyClass1();
             Object privCr2 = new Object();
 
-            HashSet hash = new HashSet();
+            HashSet<Object> hash = new HashSet<Object>();
             hash.add(privCr1);
             hash.add(new Object());
 
-            Set set = subject.getPrivateCredentials();
+            Set<Object> set = subject.getPrivateCredentials();
 
             // Adding is not prohibited
             set.add(privCr1);
@@ -1477,7 +1473,7 @@
             }
 
             assertTrue(set.equals(set));
-            assertFalse(set.equals(new HashSet()));
+            assertFalse(set.equals(new HashSet<Object>()));
             try {
                 // set with equal size initiates iteration
                 set.equals(hash);
@@ -1512,7 +1508,7 @@
             }
 
             try {
-                set.retainAll(new HashSet());
+                set.retainAll(new HashSet<Object>());
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
                 // PrivateCredentialPermission check goes first
@@ -1552,26 +1548,26 @@
 
             subject.getPrincipals().add(new MyClass1());
 
-            Set set = subject.getPrivateCredentials();
+            Set<Object> set = subject.getPrivateCredentials();
 
             Object obj1 = new Object();
             Object obj2 = new Object();
             Object obj3 = new Object();
 
             set.add(obj1);
-            set.add(new HashSet());
+            set.add(new HashSet<Object>());
             set.add(obj2);
-            set.add(new HashSet());
+            set.add(new HashSet<Object>());
             set.add(obj3);
 
             grantMode(); // no permissions
 
-            HashSet hash = new HashSet();
+            HashSet<Object> hash = new HashSet<Object>();
 
             grantPermission(new PrivateCredentialPermission(
                     "java.lang.Object * \"*\"", "read"));
 
-            Iterator it = set.iterator();
+            Iterator<Object> it = set.iterator();
             while (it.hasNext()) {
                 try {
                     hash.add(it.next());
@@ -1603,7 +1599,7 @@
                 }
 
                 P p = new P();
-                HashSet hash = new HashSet();
+                HashSet<Principal> hash = new HashSet<Principal>();
                 hash.add(p);
 
                 PrivateCredentialPermission p1 = new PrivateCredentialPermission(
@@ -1620,7 +1616,7 @@
             PrivateCredentialPermission p3 = new PrivateCredentialPermission(
                     "java.lang.Object * \"*\"", "read");
             PrivateCredentialPermission p4 = new PrivateCredentialPermission(
-                    "java.lang.Object", new HashSet());
+                    "java.lang.Object", new HashSet<Principal>());
 
             assertTrue(p3.implies(p4));
         }
@@ -1630,10 +1626,10 @@
             Principal p1 = new MyClass1();
             Principal p2 = new MyClass2();
 
-            HashSet hash = new HashSet();
+            HashSet<Principal> hash = new HashSet<Principal>();
             hash.add(p2);
 
-            Set set = subject.getPrivateCredentials();
+            Set<Object> set = subject.getPrivateCredentials();
 
             set.add(new Object());
 
@@ -1642,7 +1638,7 @@
             grantPermission(new AuthPermission("modifyPrincipals"));
             grantPermission(getPermission("java.lang.Object", hash));
 
-            Iterator it = set.iterator();
+            Iterator<Object> it = set.iterator();
             it.next();
 
             subject.getPrincipals().add(p1);
@@ -1681,7 +1677,7 @@
 
         public void testGetClass() {
 
-            HashSet hash = new HashSet();
+            HashSet<Principal> hash = new HashSet<Principal>();
             hash.add(new MyClass1());
 
             subject.getPrincipals().add(new MyClass1());
@@ -1731,10 +1727,10 @@
             subject.getPrivateCredentials(MyClass2.class);
         }
 
-        public PrivateCredentialPermission getPermission(String c, Set p) {
+        public PrivateCredentialPermission getPermission(String c, Set<Principal> p) {
             StringBuffer buf = new StringBuffer(c);
 
-            for (Iterator it = p.iterator(); it.hasNext();) {
+            for (Iterator<Principal> it = p.iterator(); it.hasNext();) {
                 Object o = it.next();
                 buf.append(" ");
                 buf.append(o.getClass().getName());
@@ -1855,16 +1851,9 @@
         }
     }
 
-    /*
-     * 
-     *
-     * 
-     * 
-     * 
-     *  
-     */
-
+    @SuppressWarnings("serial")
     public static class MyClass1 implements Principal, Serializable {
+
         public String getName() {
             return "MyClass1";
         }
@@ -1876,6 +1865,7 @@
         }
     }
 
+    @SuppressWarnings("serial")
     public static class MyObject implements Serializable {
     }
 
@@ -1919,13 +1909,14 @@
         public static class IteratorReadOnly extends
                 SecurityTest.ReadOnlyIteratorTest {
 
-            private Subject subject = new Subject();
+            private final Subject subject = new Subject();
 
             public IteratorReadOnly() {
                 set = subject.getPrincipals();
                 element = principal;
             }
 
+            @Override
             public void setReadOnly() {
                 subject.setReadOnly();
             }
@@ -1939,6 +1930,7 @@
                 element = principal;
             }
 
+            @Override
             public void setSecure() {
                 denyPermission(new AuthPermission("modifyPrincipals"));
             }
@@ -1971,13 +1963,14 @@
         }
 
         public static class ReadOnlySet extends SecurityTest.ReadOnlySetTest {
-            private Subject subject = new Subject();
+            private final Subject subject = new Subject();
 
             public ReadOnlySet() {
                 set = subject.getPrincipals();
                 element = principal;
             }
 
+            @Override
             public void setReadOnly() {
                 subject.setReadOnly();
             }
@@ -1990,6 +1983,7 @@
                 element = principal;
             }
 
+            @Override
             public void setSecure() {
                 denyPermission(new AuthPermission("modifyPrincipals"));
             }
@@ -2041,6 +2035,7 @@
                 element = principal;
             }
 
+            @Override
             public void testNext_EmptySet_NoSuchElementException() {
 
                 if (testing) {
@@ -2054,6 +2049,7 @@
                 }
             }
 
+            @Override
             public void testNext_NoSuchElementException() {
                 if (testing) {
                     //Unexpected: IndexOutOfBoundsException
@@ -2070,17 +2066,19 @@
         public static class IteratorReadOnly extends
                 SecurityTest.ReadOnlyIteratorTest {
 
-            private Subject subject = new Subject();
+            private final Subject subject = new Subject();
 
             public IteratorReadOnly() {
                 set = subject.getPrivateCredentials();
                 element = principal;
             }
 
+            @Override
             public void setReadOnly() {
                 subject.setReadOnly();
             }
 
+            @Override
             public void testNext_EmptySet_NoSuchElementException() {
 
                 if (testing) {
@@ -2094,6 +2092,7 @@
                 }
             }
 
+            @Override
             public void testNext_NoSuchElementException() {
                 if (testing) {
                     //Unexpected: IndexOutOfBoundsException
@@ -2115,10 +2114,12 @@
                 element = principal;
             }
 
+            @Override
             public void setSecure() {
                 denyPermission(new AuthPermission("modifyPrivateCredentials"));
             }
 
+            @Override
             public void testNext_EmptySet_NoSuchElementException() {
 
                 if (testing) {
@@ -2132,6 +2133,7 @@
                 }
             }
 
+            @Override
             public void testNext_NoSuchElementException() {
                 if (testing) {
                     //Unexpected: IndexOutOfBoundsException
@@ -2162,13 +2164,14 @@
         }
 
         public static class ReadOnlySet extends SecurityTest.ReadOnlySetTest {
-            private Subject subject = new Subject();
+            private final Subject subject = new Subject();
 
             public ReadOnlySet() {
                 set = subject.getPrivateCredentials();
                 element = principal;
             }
 
+            @Override
             public void setReadOnly() {
                 subject.setReadOnly();
             }
@@ -2181,6 +2184,7 @@
                 element = principal;
             }
 
+            @Override
             public void setSecure() {
                 denyPermission(new AuthPermission("modifyPrivateCredentials"));
             }
@@ -2235,13 +2239,14 @@
         public static class IteratorReadOnly extends
                 SecurityTest.ReadOnlyIteratorTest {
 
-            private Subject subject = new Subject();
+            private final Subject subject = new Subject();
 
             public IteratorReadOnly() {
                 set = subject.getPublicCredentials();
                 element = principal;
             }
 
+            @Override
             public void setReadOnly() {
                 subject.setReadOnly();
             }
@@ -2255,6 +2260,7 @@
                 element = principal;
             }
 
+            @Override
             public void setSecure() {
                 denyPermission(new AuthPermission("modifyPublicCredentials"));
             }
@@ -2277,13 +2283,14 @@
         }
 
         public static class ReadOnlySet extends SecurityTest.ReadOnlySetTest {
-            private Subject subject = new Subject();
+            private final Subject subject = new Subject();
 
             public ReadOnlySet() {
                 set = subject.getPublicCredentials();
                 element = principal;
             }
 
+            @Override
             public void setReadOnly() {
                 subject.setReadOnly();
             }
@@ -2296,6 +2303,7 @@
                 element = principal;
             }
 
+            @Override
             public void setSecure() {
                 denyPermission(new AuthPermission("modifyPublicCredentials"));
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java Sun Oct  1 13:16:07 2006
@@ -55,8 +55,8 @@
      */
     public final void testConfirmationCallback_01() throws IllegalArgumentException {
         try {
-            for (int i = 0; i < mt.length; i++) {
-                cc = new ConfirmationCallback(mt[i], ot[1], dopt[1]);
+            for (int element : mt) {
+                cc = new ConfirmationCallback(element, ot[1], dopt[1]);
             }
         } catch (IllegalArgumentException e){}
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java Sun Oct  1 13:16:07 2006
@@ -51,8 +51,8 @@
     public final void testTextOutputCallback_02() {
         int[] m = { TextOutputCallback.INFORMATION, TextOutputCallback.WARNING,
                 TextOutputCallback.ERROR };
-        for (int i = 0; i < m.length; i++) {
-            text = new TextOutputCallback(m[i], "message");
+        for (int element : m) {
+            text = new TextOutputCallback(element, "message");
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java Sun Oct  1 13:16:07 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Maxim V. Makarov
-* @version $Revision$
-*/
-
 package javax.security.auth.kerberos;
 
 import java.security.AllPermission;
@@ -40,10 +35,6 @@
  */
 public class DelegationPermissionTest extends TestCase {
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(DelegationPermissionTest.class);
-    }
-
     /**
      * testing of a correct ctor
      */
@@ -120,6 +111,7 @@
     } 
     
     // testing of the equals method
+    @SuppressWarnings("serial")
     public void testEquals() {
         DelegationPermission dp1 = new DelegationPermission("\"AAA\" \"BBB\"");
         DelegationPermission dp2 = new DelegationPermission("\"AAA\" \"BBB\"");
@@ -199,7 +191,7 @@
 		} catch (NoSuchElementException e) {
 		}
 
-        Enumeration en = pc.elements();
+        Enumeration<?> en = pc.elements();
         assertNotNull(en);
         assertFalse(en.hasMoreElements());
         
@@ -214,7 +206,7 @@
         assertFalse(en.hasMoreElements());
         pc.add(sp2);
         en = pc.elements();
-        Collection c = new ArrayList();
+        Collection<Object> c = new ArrayList<Object>();
         while (en.hasMoreElements())
         {
             c.add(en.nextElement());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosKeyTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosKeyTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosKeyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/KerberosKeyTest.java Sun Oct  1 13:16:07 2006
@@ -143,15 +143,15 @@
         // TODO add "pianist@EXAMPLE.COM" and "Juri ... @ATHENA.MIT.EDU"
         };
 
-        for (int i = 0; i < testcases.length; i++) {
+        for (Object[] element : testcases) {
             KerberosPrincipal kp = new KerberosPrincipal(
-                    (String) testcases[i][0], 1);
+                    (String) element[0], 1);
 
-            key = new KerberosKey(kp, ((String) testcases[i][1]).toCharArray(),
+            key = new KerberosKey(kp, ((String) element[1]).toCharArray(),
                     "DES");
 
-            assertTrue("Testcase: " + (String) testcases[i][0], Arrays.equals(
-                    (byte[]) testcases[i][2], key.getEncoded()));
+            assertTrue("Testcase: " + (String) element[0], Arrays.equals(
+                    (byte[]) element[2], key.getEncoded()));
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java Sun Oct  1 13:16:07 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Maxim V. Makarov
-* @version $Revision$
-*/
-
 package javax.security.auth.kerberos;
 
 import java.security.AllPermission;
@@ -32,17 +27,11 @@
 
 import junit.framework.TestCase;
 
-
-
 /** 
  * Tests ServicePermission class implementation.
  */
 public class ServicePermissionTest extends TestCase {
-    
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(ServicePermissionTest.class);
-    }
-    
+
     /**
      * @tests javax.security.auth.kerberos.ServicePermission#ServicePermission(
      *        java.lang.String,java.lang.String)
@@ -235,7 +224,7 @@
 		} catch (NoSuchElementException e) {
 		}
 
-        Enumeration en = pc.elements();
+        Enumeration<?> en = pc.elements();
         assertNotNull(en);
         assertFalse(en.hasMoreElements());
         
@@ -251,7 +240,7 @@
         pc.add(sp2);
         pc.add(sp3);
         en = pc.elements();
-        Collection c = new ArrayList();
+        Collection<Object> c = new ArrayList<Object>();
         while (en.hasMoreElements())
         {
             c.add(en.nextElement());
@@ -283,8 +272,8 @@
                 "Accept, initiatE" //  first & last upper case
         };
 
-        for (int i = 0; i < validActions.length; i++) {
-            new ServicePermission("*", validActions[i]);
+        for (String element : validActions) {
+            new ServicePermission("*", element);
         }
 
         String[] invalidActions = new String[] { "accept initiate", // space
@@ -295,11 +284,11 @@
                 "accept,", // ','
                 " ,accept" // ','
         };
-        for (int i = 0; i < invalidActions.length; i++) {
+        for (String element : invalidActions) {
             try {
-                new ServicePermission("*", invalidActions[i]);
+                new ServicePermission("*", element);
                 fail("No expected IllegalArgumentException for action: "
-                        + invalidActions[i]);
+                        + element);
             } catch (IllegalArgumentException e) {
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/AppConfigurationEntryTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/AppConfigurationEntryTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/AppConfigurationEntryTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/AppConfigurationEntryTest.java Sun Oct  1 13:16:07 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Maxim V. Makarov
-* @version $Revision$
-*/
-
 package javax.security.auth.login;
 
 import java.util.HashMap;
@@ -30,21 +25,17 @@
 /**
  * Tests AppConfigurationEntry class
  */
-
 public class AppConfigurationEntryTest extends TestCase {
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(AppConfigurationEntryTest.class);
-    }
-
     String loginModule = "LoginModule";
 
     private static final String msg = "LoginModuleControlFlag: ";
 
     AppConfigurationEntry entry = null;
 
-    Map options = new HashMap();
+    Map<String, Object> options = new HashMap<String, Object>();
 
+    @Override
     public void setUp() {
         options.put("debug", "true");
         options.put("testing", "false");
@@ -106,12 +97,12 @@
      * test for array of the AppConfigurationEntry and for the method getOptions 
      */
     public void testArrayCtor() {
-        Map options1 = new HashMap();
+        Map<String, Object> options1 = new HashMap<String, Object>();
         options1.put("debug", "false");
         AppConfigurationEntry[] entries = {
                 new AppConfigurationEntry("LoginModule1",AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,options),
                 new AppConfigurationEntry("LoginModule2", AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,options1),
-                new AppConfigurationEntry("LoginModule3",AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL,new HashMap()) };
+                new AppConfigurationEntry("LoginModule3",AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL,new HashMap<String, Object>()) };
 
         assertEquals("LoginModule1", entries[0].getLoginModuleName());
         assertEquals(options, entries[0].getOptions());
@@ -146,11 +137,12 @@
                 AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT.toString());
     }
     
+    @SuppressWarnings("unchecked")
     public void testImmutability(){
         AppConfigurationEntry entry = new AppConfigurationEntry("LoginModule",
                 AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options);
 
-        Map eOptions = entry.getOptions();
+        Map<String, Object> eOptions = (Map<String, Object>)entry.getOptions();
 
         try {
             eOptions.put("a", "b");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/ConfigurationTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/ConfigurationTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/ConfigurationTest.java Sun Oct  1 13:16:07 2006
@@ -54,7 +54,8 @@
 			enableAccess = enable;
 		}
 
-		public void checkPermission(Permission p) {
+		@Override
+        public void checkPermission(Permission p) {
 			if (p instanceof AuthPermission && checkTarget.equals(p)) {
 				checkAsserted = true;
 				if (!enableAccess) {
@@ -75,12 +76,14 @@
 	 */
 	public static class ConfTestProvider extends Configuration {
 
-		public AppConfigurationEntry[] getAppConfigurationEntry(
+		@Override
+        public AppConfigurationEntry[] getAppConfigurationEntry(
 				String applicationName) {
 			return null;
 		}
 
-		public void refresh() {
+		@Override
+        public void refresh() {
 		}
 	}
 
@@ -92,7 +95,8 @@
 
 	Configuration oldConfiguration = Configuration.getConfiguration();
 
-	public void tearDown() {
+	@Override
+    public void tearDown() {
 		System.setSecurityManager(old);
 		Configuration.setConfiguration(oldConfiguration);
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest.java Sun Oct  1 13:16:07 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Stepan M. Mishura
-* @version $Revision$
-*/
-
 package javax.security.auth.login;
 
 import java.security.Security;
@@ -47,10 +42,11 @@
 
     private static final String moduleName = "moduleName";
 
-    private Subject subject = new Subject();
+    private final Subject subject = new Subject();
 
-    private MyCallbackHandler handler = new MyCallbackHandler();
+    private final MyCallbackHandler handler = new MyCallbackHandler();
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
 
@@ -197,7 +193,7 @@
      */
     public final void testLC_String_LoginModuleInitialize() throws Exception {
 
-        Hashtable options = new Hashtable();
+        Hashtable<String, ?> options = new Hashtable<String, Object>();
 
         // add required module to the current configuration
         MyConfig.addRequired("MyLoginModule", options);
@@ -212,7 +208,7 @@
         // only one module must be created
         assertEquals("Number of modules", 1, MyLoginModule.list.size());
 
-        MyLoginModule module = (MyLoginModule) MyLoginModule.list.get(0);
+        MyLoginModule module = MyLoginModule.list.get(0);
 
         // login context instantiates subject object itself. 
         assertNotNull("Subject", module.subject);
@@ -357,7 +353,7 @@
     public final void testLC_StringCallbackHandler_LoginModuleInitialize()
             throws Exception {
 
-        Hashtable options = new Hashtable();
+        Hashtable<String, ?> options = new Hashtable<String, Object>();
 
         // add required module to the current configuration
         MyConfig.addRequired("MyLoginModule", options);
@@ -372,7 +368,7 @@
         // only one module must be created
         assertEquals("Number of modules", 1, MyLoginModule.list.size());
 
-        MyLoginModule module = (MyLoginModule) MyLoginModule.list.get(0);
+        MyLoginModule module = MyLoginModule.list.get(0);
 
         // login context instantiates subject object itself. 
         assertNotNull("Subject", module.subject);
@@ -520,7 +516,7 @@
     public final void testLC_StringSubject_LoginModuleInitialize()
             throws Exception {
 
-        Hashtable options = new Hashtable();
+        Hashtable<String, ?> options = new Hashtable<String, Object>();
 
         // add required module to the current configuration
         MyConfig.addRequired("MyLoginModule", options);
@@ -535,7 +531,7 @@
         // only one module must be created
         assertEquals("Number of modules", 1, MyLoginModule.list.size());
 
-        MyLoginModule module = (MyLoginModule) MyLoginModule.list.get(0);
+        MyLoginModule module = MyLoginModule.list.get(0);
 
         // login context has provided subject 
         assertTrue("Subject", module.subject == subject);
@@ -666,7 +662,7 @@
     public final void testLC_StringSubjectCallbackHandler_LoginModuleInitialize()
             throws Exception {
 
-        Hashtable options = new Hashtable();
+        Hashtable<String, ?> options = new Hashtable<String, Object>();
 
         // add required module to the current configuration
         MyConfig.addRequired("MyLoginModule", options);
@@ -681,7 +677,7 @@
         // only one module must be created
         assertEquals("Number of modules", 1, MyLoginModule.list.size());
 
-        MyLoginModule module = (MyLoginModule) MyLoginModule.list.get(0);
+        MyLoginModule module = MyLoginModule.list.get(0);
 
         // login context has provided subject 
         assertTrue("Subject", module.subject == subject);
@@ -749,12 +745,13 @@
 
         private String appName;
 
-        private ArrayList entries;
+        private ArrayList<AppConfigurationEntry> entries;
 
         public MyConfig() {
-            entries = new ArrayList();
+            entries = new ArrayList<AppConfigurationEntry>();
         }
 
+        @Override
         public AppConfigurationEntry[] getAppConfigurationEntry(
                 String applicationName) {
 
@@ -763,18 +760,18 @@
             if (entries != null) {
                 if (entries.size() == 0) {
                     return new AppConfigurationEntry[0];
-                } else {
-                    AppConfigurationEntry[] appEntries = new AppConfigurationEntry[entries
-                            .size()];
+                }
+                AppConfigurationEntry[] appEntries = new AppConfigurationEntry[entries
+                        .size()];
 
-                    entries.toArray(appEntries);
+                entries.toArray(appEntries);
 
-                    return appEntries;
-                }
+                return appEntries;
             }
             return null;
         }
 
+        @Override
         public void refresh() {
         }
 
@@ -801,8 +798,8 @@
         /**
          * Appends required login module to the current configuration
          */
-        public static void addRequired(String name, Map options) {
-            ArrayList list = ((MyConfig) Configuration.getConfiguration()).entries;
+        public static void addRequired(String name, Map<String, ?> options) {
+            ArrayList<AppConfigurationEntry> list = ((MyConfig) Configuration.getConfiguration()).entries;
 
             AppConfigurationEntry entry = new AppConfigurationEntry(
                     "javax.security.auth.login.LoginContextTest$" + name,
@@ -827,10 +824,10 @@
 
     public static class MyLoginModule implements LoginModule {
 
-        public static ArrayList list = new ArrayList();
+        public static ArrayList<MyLoginModule> list = new ArrayList<MyLoginModule>();
 
         public static void reset() {
-            list = new ArrayList();
+            list = new ArrayList<MyLoginModule>();
         }
 
         public boolean aborted;
@@ -847,9 +844,9 @@
 
         public CallbackHandler handler;
 
-        public Map sharedState;
+        public Map<?, ?> sharedState;
 
-        public Map options;
+        public Map<?, ?> options;
 
         public MyLoginModule() {
             list.add(this);
@@ -876,7 +873,7 @@
         }
 
         public void initialize(Subject subject, CallbackHandler handler,
-                Map sharedState, Map options) {
+                Map<String, ?> sharedState, Map<String, ?> options) {
 
             if (logined || commited || aborted) {
                 throw new AssertionError("MUST be initialized first");
@@ -919,8 +916,8 @@
             return false;
         }
 
-        public void initialize(Subject arg0, CallbackHandler arg1, Map arg2,
-                Map arg3) {
+        public void initialize(Subject arg0, CallbackHandler arg1, Map<String, ?> arg2,
+                Map<String, ?> arg3) {
         }
 
         public boolean login() throws LoginException {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java Sun Oct  1 13:16:07 2006
@@ -15,17 +15,13 @@
  *  limitations under the License.
  */
 
-/**
-* @author Alexander V. Astapchuk
-* @version $Revision$
-*/
-
 package javax.security.auth.login;
 
 import java.io.IOException;
 import java.net.URL;
 import java.security.AccessControlContext;
 import java.security.AccessController;
+import java.security.BasicPermission;
 import java.security.CodeSource;
 import java.security.DomainCombiner;
 import java.security.Permission;
@@ -67,10 +63,6 @@
 
     private static final int SUFFICIENT = 3;
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(LoginContextTest_1.class);
-    }
-
     /**
      * Converts short (local) class names (like TestLoginModule) into the 
      * global (fully qualified) ones.<br>
@@ -122,13 +114,13 @@
     private static final class TestConfig extends Configuration {
         private String name;
 
-        private ArrayList entries = new ArrayList();
+        private final ArrayList<AppConfigurationEntry> entries = new ArrayList<AppConfigurationEntry>();
 
         // A map 'name'=>'some specific configuration'
-        private HashMap configs = new HashMap();
+        private final HashMap<String, Configuration> configs = new HashMap<String, Configuration>();
 
         // An array which keeps track of the configuration names requested.
-        private ArrayList requests = new ArrayList();
+        private final ArrayList<String> requests = new ArrayList<String>();
 
         public TestConfig() {
         }
@@ -137,6 +129,7 @@
             this.name = name;
         }
 
+        @Override
         public AppConfigurationEntry[] getAppConfigurationEntry(String appName) {
 
             if (!requests.contains(appName)) {
@@ -145,7 +138,7 @@
 
             if (name == null || !name.equals(appName)) {
 
-                Configuration conf = (Configuration) configs.get(appName);
+                Configuration conf = configs.get(appName);
                 if (conf != null) {
                     return conf.getAppConfigurationEntry(appName);
                 }
@@ -161,6 +154,7 @@
             return ret;
         }
 
+        @Override
         public void refresh() {
             // do nothing
         }
@@ -172,31 +166,31 @@
         String addRequired(String name) {
             return add(name,
                     AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
-                    new HashMap());
+                    new HashMap<String, Object>());
         }
 
         String addOptional(String name) {
             return add(name,
                     AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL,
-                    new HashMap());
+                    new HashMap<String, Object>());
         }
 
         String addSufficient(String name) {
             return add(name,
                     AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT,
-                    new HashMap());
+                    new HashMap<String, Object>());
         }
 
         String addRequisite(String name) {
-            return add(name, LoginModuleControlFlag.REQUISITE, new HashMap());
+            return add(name, LoginModuleControlFlag.REQUISITE, new HashMap<String, Object>());
         }
 
-        String add(int type, String name, Map options) {
+        String add(int type, String name, Map<String, ?> options) {
             return add(name, mapControlFlag(type), options);
         }
 
         String add(String name,
-                AppConfigurationEntry.LoginModuleControlFlag flag, Map options) {
+                AppConfigurationEntry.LoginModuleControlFlag flag, Map<String, ?> options) {
             String fullName = getGlobalClassName(name);
             AppConfigurationEntry entry = new AppConfigurationEntry(fullName,
                     flag, options);
@@ -226,7 +220,7 @@
 
         public static String addInstalled(int type, String name) {
             return ((TestConfig) Configuration.getConfiguration()).add(type,
-                    name, new HashMap());
+                    name, new HashMap<String, Object>());
         }
 
         public static void clear() {
@@ -314,7 +308,7 @@
         public static LoginException staticLE;
 
         //
-        protected static ArrayList instances = new ArrayList();
+        protected static ArrayList<TestLoginModule> instances = new ArrayList<TestLoginModule>();
 
         private boolean initCalled;
 
@@ -341,7 +335,7 @@
          * returns <code>i</code> item from the list of tracked items.
          */
         static TestLoginModule get(int i) {
-            return (TestLoginModule) instances.get(i);
+            return instances.get(i);
         }
 
         /**
@@ -464,7 +458,7 @@
          * See javax.security.auth.spi.LoginModule.initialize()
          */
         public void initialize(Subject subject,
-                CallbackHandler callbackHandler, Map sharedState, Map options) {
+                CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) {
 
             this.cbHandler = callbackHandler;
             initCalled = true;
@@ -603,7 +597,7 @@
      * created.<br>
      */
     public static class TestCallbackHandler implements CallbackHandler {
-        protected static ArrayList instances = new ArrayList();
+        protected static ArrayList<TestCallbackHandler> instances = new ArrayList<TestCallbackHandler>();
 
         /**
          * Returns number of the instances tracked.
@@ -635,6 +629,7 @@
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         Configuration.setConfiguration(new TestConfig());
@@ -813,11 +808,12 @@
      * Make sure that the proper (context) class loader is used.
      */
     public void testLogin_minus1() throws Exception {
-        final ArrayList requests = new ArrayList();
+        final ArrayList<String> requests = new ArrayList<String>();
         ClassLoader saveCCL = Thread.currentThread().getContextClassLoader();
 
         ClassLoader testClassLoader = new ClassLoader() {
-            protected synchronized Class loadClass(String klassName,
+            @Override
+            protected synchronized Class<?> loadClass(String klassName,
                     boolean resolve) throws ClassNotFoundException {
                 requests.add(klassName);
                 return super.loadClass(klassName, resolve);
@@ -1827,7 +1823,7 @@
         final DomainCombiner dc = new SubjectDomainCombiner(dummySubj);
         AccessControlContext acc = new AccessControlContext(AccessController
                 .getContext(), dc);
-        PrivilegedExceptionAction action = new PrivilegedExceptionAction() {
+        PrivilegedExceptionAction<?> action = new PrivilegedExceptionAction<Object>() {
             public Object run() throws Exception {
                 implTestContextUsage(true, dc);
                 return null;
@@ -1849,7 +1845,7 @@
         final DomainCombiner dc = new SubjectDomainCombiner(dummySubj);
         AccessControlContext acc = new AccessControlContext(AccessController
                 .getContext(), dc);
-        PrivilegedExceptionAction action = new PrivilegedExceptionAction() {
+        PrivilegedExceptionAction<?> action = new PrivilegedExceptionAction<Object>() {
             public Object run() throws Exception {
                 implTestContextUsage(false, dc);
                 return null;
@@ -1900,6 +1896,7 @@
             accCtor = AccessController.getContext();
         }
 
+        @Override
         public void handle(Callback[] cbs) {
             accHandle = AccessController.getContext();
         }
@@ -1958,12 +1955,14 @@
             accCtor = AccessController.getContext();
         }
 
+        @Override
         public void initialize(Subject subject,
-                CallbackHandler callbackHandler, Map sharedState, Map options) {
+                CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) {
             accInit = AccessController.getContext();
             super.initialize(subject, callbackHandler, sharedState, options);
         }
 
+        @Override
         public boolean login() throws LoginException {
             accLogin = AccessController.getContext();
             if (cbHandler != null) {
@@ -1978,16 +1977,19 @@
             return super.login();
         }
 
+        @Override
         public boolean commit() throws LoginException {
             accCommit = AccessController.getContext();
             return super.commit();
         }
 
+        @Override
         public boolean logout() throws LoginException {
             accLogout = AccessController.getContext();
             return super.logout();
         }
 
+        @Override
         public boolean abort() throws LoginException {
             accAbort = AccessController.getContext();
             return super.abort();
@@ -2099,9 +2101,9 @@
      * @return <code>true</code> is the name is in the list, 
      * <code>false</code> otherwise. 
      */
-    private static boolean lookupAuthPermission(ArrayList al, String name) {
+    private static boolean lookupAuthPermission(ArrayList<Permission> al, String name) {
         for (int i = 0; i < al.size(); i++) {
-            Permission p = (Permission) al.get(i);
+            Permission p = al.get(i);
             if (p instanceof AuthPermission && name.equals(p.getName())) {
                 return true;
             }
@@ -2115,19 +2117,20 @@
     public void testSecurityManagerUsage() throws Exception {
         // 1. create a special-purpose SecurityManager which keeps track 
         // of Permissions checked
-        final ArrayList requests = new ArrayList();
+        final ArrayList<Permission> requests = new ArrayList<Permission>();
         // a list of permissions allowed - just to make sure I'll be able to 
         // set security manager back.
-        final ArrayList allowedPerms = new ArrayList();
+        final ArrayList<BasicPermission> allowedPerms = new ArrayList<BasicPermission>();
         //
         allowedPerms.add(new RuntimePermission("setIO"));
         allowedPerms.add(new RuntimePermission("setSecurityManager"));
         //
         SecurityManager sm = new SecurityManager() {
+            @Override
             public void checkPermission(Permission p) {
                 requests.add(p);
                 for (int i = 0; i < allowedPerms.size(); i++) {
-                    Permission good = (Permission) allowedPerms.get(i);
+                    Permission good = allowedPerms.get(i);
                     if (good.equals(p)) {
                         return;
                     }
@@ -2150,7 +2153,7 @@
         try {
             System.setSecurityManager(sm);
 
-            AccessController.doPrivileged(new PrivilegedAction() {
+            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                 public Object run() {
                     implTestSecurityManagerUsage(requests, allowedPerms);
                     return null;
@@ -2171,8 +2174,8 @@
      * @param requests
      * @param allowedPerms
      */
-    private void implTestSecurityManagerUsage(ArrayList requests,
-            ArrayList allowedPerms) {
+    private void implTestSecurityManagerUsage(ArrayList<Permission> requests,
+            ArrayList<BasicPermission> allowedPerms) {
         String configPermName = "createLoginContext." + CONFIG_NAME;
         String otherPermName = "createLoginContext.other";
         String dummyName = "no such name";

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java Sun Oct  1 13:16:07 2006
@@ -2063,15 +2063,15 @@
         list.add("CN=,ST=", "CN=,ST=", "CN=, ST="); // empty value for both RDNs
         list.add("CN=;ST=B", "CN=,ST=B", "CN=, ST=B"); // empty value for 1 RDN
         list.add("CN=;ST=", "CN=,ST=", "CN=, ST="); // empty value for both RDNs
-        for (int i = 0; i < RFC2253_SPECIAL.length; i++) {
+        for (String element : RFC2253_SPECIAL) {
             // \special
-            list.add("CN=\\" + RFC2253_SPECIAL[i],
-                    "CN=\\" + RFC2253_SPECIAL[i], "CN=\"" + RFC2253_SPECIAL[i]
+            list.add("CN=\\" + element,
+                    "CN=\\" + element, "CN=\"" + element
                             + "\"");
 
             // A + \special + B
-            list.add("CN=A\\" + RFC2253_SPECIAL[i] + "B", "CN=A\\"
-                    + RFC2253_SPECIAL[i] + "B", "CN=\"A" + RFC2253_SPECIAL[i]
+            list.add("CN=A\\" + element + "B", "CN=A\\"
+                    + element + "B", "CN=\"A" + element
                     + "B\"");
         }
 
@@ -2181,24 +2181,24 @@
         //
         list.add("CN=\"\"", "CN=", "CN="); // empty quoted string
         list.add("CN=\"A\"", "CN=A", "CN=A"); // "A"
-        for (int i = 0; i < RFC2253_SPECIAL.length; i++) {
+        for (String element : RFC2253_SPECIAL) {
             // "special" => \special
-            list.add("CN=\"" + RFC2253_SPECIAL[i] + "\"", "CN=\\"
-                    + RFC2253_SPECIAL[i], "CN=\"" + RFC2253_SPECIAL[i] + "\"");
+            list.add("CN=\"" + element + "\"", "CN=\\"
+                    + element, "CN=\"" + element + "\"");
 
             // "A + special + B" => A + \special + B
-            list.add("CN=\"A" + RFC2253_SPECIAL[i] + "B\"", "CN=A\\"
-                    + RFC2253_SPECIAL[i] + "B", "CN=\"A" + RFC2253_SPECIAL[i]
+            list.add("CN=\"A" + element + "B\"", "CN=A\\"
+                    + element + "B", "CN=\"A" + element
                     + "B\"");
         }
-        for (int i = 0; i < RFC2253_SPECIAL.length; i++) {
+        for (String element : RFC2253_SPECIAL) {
             // "\special" => \special
-            list.add("CN=\"\\" + RFC2253_SPECIAL[i] + "\"", "CN=\\"
-                    + RFC2253_SPECIAL[i], "CN=\"" + RFC2253_SPECIAL[i] + "\"");
+            list.add("CN=\"\\" + element + "\"", "CN=\\"
+                    + element, "CN=\"" + element + "\"");
 
             // "A + \special + B" => A + \special + B
-            list.add("CN=\"A\\" + RFC2253_SPECIAL[i] + "B\"", "CN=A\\"
-                    + RFC2253_SPECIAL[i] + "B", "CN=\"A" + RFC2253_SPECIAL[i]
+            list.add("CN=\"A\\" + element + "B\"", "CN=A\\"
+                    + element + "B", "CN=\"A" + element
                     + "B\"");
         }
         list.add("CN=\"\\\"\"", "CN=\\\"", "CN=\"\\\"\"", null, (byte) 0x02); // "\""
@@ -2306,9 +2306,9 @@
 
                             System.out.println("\nI " + i);
                             byte[] enc = p.getEncoded();
-                            for (int j = 0; j < enc.length; j++) {
+                            for (byte element : enc) {
                                 System.out.print(", 0x"
-                                        + Integer.toHexString(enc[j]));
+                                        + Integer.toHexString(element));
                             }
                         }
                     }
@@ -2396,11 +2396,11 @@
         };
 
         StringBuffer errorMsg = new StringBuffer();
-        for (int i = 0; i < illegalDN.length; i++) {
+        for (String element : illegalDN) {
 
             try {
-                new X500Principal(illegalDN[i]);
-                errorMsg.append("No IllegalArgumentException: '" + illegalDN[i]
+                new X500Principal(element);
+                errorMsg.append("No IllegalArgumentException: '" + element
                         + "'\n");
             } catch (IllegalArgumentException e) {
             }
@@ -2776,7 +2776,7 @@
         // TODO comment me
         //
 
-        private static byte[] emptyMask = new byte[] { 0x00 };
+        private static final byte[] emptyMask = new byte[] { 0x00 };
 
         public void add(byte[] encoding, String rfc2253, String rfc1779,
                 String canonical) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java Sun Oct  1 13:16:07 2006
@@ -43,64 +43,86 @@
 public class X500PrivateCredentialTest extends TestCase {
 
 	X509Certificate cert= new X509Certificate() {
-		public void checkValidity(){}
-		public void checkValidity(Date date){}
-		public int getVersion() {
+		@Override
+        public void checkValidity(){}
+		@Override
+        public void checkValidity(Date date){}
+		@Override
+        public int getVersion() {
 			return 0;
 		}
-		public BigInteger getSerialNumber() {
+		@Override
+        public BigInteger getSerialNumber() {
 			return null;
 		}
-		public Principal getIssuerDN() {
+		@Override
+        public Principal getIssuerDN() {
 			return null;
 		}
-		public Principal getSubjectDN() {
+		@Override
+        public Principal getSubjectDN() {
 			return null;
 		}
-		public Date getNotBefore() {
+		@Override
+        public Date getNotBefore() {
 			return null;
 		}
-		public Date getNotAfter() {
+		@Override
+        public Date getNotAfter() {
 			return null;
 		}
-		public byte[] getTBSCertificate() throws CertificateEncodingException {
+		@Override
+        public byte[] getTBSCertificate() throws CertificateEncodingException {
 			return null;
 		}
-		public byte[] getSignature() {
+		@Override
+        public byte[] getSignature() {
 			return null;
 		}
-		public String getSigAlgName() {
+		@Override
+        public String getSigAlgName() {
 			return null;
 		}
-		public String getSigAlgOID() {
+		@Override
+        public String getSigAlgOID() {
 			return null;
 		}
-		public byte[] getSigAlgParams() {
+		@Override
+        public byte[] getSigAlgParams() {
 			return null;
 		}
-		public boolean[] getIssuerUniqueID() {
+		@Override
+        public boolean[] getIssuerUniqueID() {
 			return null;
 		}
-		public boolean[] getSubjectUniqueID() {
+		@Override
+        public boolean[] getSubjectUniqueID() {
 			return null;
 		}
-		public boolean[] getKeyUsage() {
+		@Override
+        public boolean[] getKeyUsage() {
 			return null;
 		}
-		public int getBasicConstraints() {
+		@Override
+        public int getBasicConstraints() {
 			return 0;
 		}
-		public byte[] getEncoded() throws CertificateEncodingException {
+		@Override
+        public byte[] getEncoded() throws CertificateEncodingException {
 			return null;
 		}
-		public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
+		@Override
+        public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
 		}
-		public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
+		@Override
+        public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
 		}
-		public String toString() {
+		@Override
+        public String toString() {
 			return null;
 		}
-		public PublicKey getPublicKey() {
+		@Override
+        public PublicKey getPublicKey() {
 			return null;
 		}
 		public Set getCriticalExtensionOIDs() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java Sun Oct  1 13:16:07 2006
@@ -75,10 +75,10 @@
      */
     public void testAuthenticationException02() {
         AuthenticationException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new AuthenticationException(msgs[i]);
-            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
-                    .getMessage(), msgs[i]);
+        for (String element : msgs) {
+            tE = new AuthenticationException(element);
+            assertEquals("getMessage() must return: ".concat(element), tE
+                    .getMessage(), element);
             assertNull("getCause() must return null", tE.getCause());
             try {
                 throw tE;
@@ -127,10 +127,10 @@
      */
     public void testAuthenticationException05() {
         AuthenticationException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new AuthenticationException(msgs[i], null);
-            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
-                    .getMessage(), msgs[i]);
+        for (String element : msgs) {
+            tE = new AuthenticationException(element, null);
+            assertEquals("getMessage() must return: ".concat(element), tE
+                    .getMessage(), element);
             assertNull("getCause() must return null", tE.getCause());
             try {
                 throw tE;
@@ -169,14 +169,14 @@
      */
     public void testAuthenticationException07() {
         AuthenticationException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new AuthenticationException(msgs[i], tCause);
+        for (String element : msgs) {
+            tE = new AuthenticationException(element, tCause);
             String getM = tE.getMessage();
             String toS = tCause.toString();
-            if (msgs[i].length() > 0) {
-                assertTrue("getMessage() must contain ".concat(msgs[i]), getM
-                        .indexOf(msgs[i]) != -1);
-                if (!getM.equals(msgs[i])) {
+            if (element.length() > 0) {
+                assertTrue("getMessage() must contain ".concat(element), getM
+                        .indexOf(element) != -1);
+                if (!getM.equals(element)) {
                     assertTrue("getMessage() should contain ".concat(toS), getM
                             .indexOf(toS) != -1);
                 }
@@ -205,18 +205,18 @@
         AuthenticationException eT;
         eT = new AuthenticationException();
         assertNotNull("Incorrect null string", eT.toString());
-        for (int i = 0; i < msgs.length; i++) {
-            eT = new AuthenticationException(msgs[i]);
+        for (String element : msgs) {
+            eT = new AuthenticationException(element);
             assertTrue("Incorrect result string", eT.toString()
-                    .indexOf(msgs[i]) >= 0);
+                    .indexOf(element) >= 0);
 
-            for (int j = 0; j < th.length; j++) {
-                eT = new AuthenticationException(msgs[i], th[j]);
+            for (Throwable element0 : th) {
+                eT = new AuthenticationException(element, element0);
                 assertTrue("Incorrect result string", eT.toString().indexOf(
-                        msgs[i]) >= 0);
-                if (th[j] != null) {
+                        element) >= 0);
+                if (element0 != null) {
                     assertTrue("Incorrect result string", eT.toString()
-                            .indexOf(th[j].toString()) >= 0);
+                            .indexOf(element0.toString()) >= 0);
                 }
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java?view=diff&rev=451801&r1=451800&r2=451801
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java Sun Oct  1 13:16:07 2006
@@ -79,12 +79,12 @@
                 "another authorizedIDs",
                 "some long string for authorized IDs some long string for authorized IDs some long string for authorized IDs" };
         AuthorizeCallback auth;
-        for (int i = 0; i < authenticationIDs.length; i++) {
-            for (int j = 0; j < authorizedIDs.length; j++) {
-                auth = new AuthorizeCallback(authenticationIDs[i],
-                        authorizedIDs[j]);
-                assertEquals(auth.getAuthenticationID(), authenticationIDs[i]);
-                assertEquals(auth.getAuthorizationID(), authorizedIDs[j]);
+        for (String element : authenticationIDs) {
+            for (String element0 : authorizedIDs) {
+                auth = new AuthorizeCallback(element,
+                        element0);
+                assertEquals(auth.getAuthenticationID(), element);
+                assertEquals(auth.getAuthorizationID(), element0);
                 assertNull(auth.getAuthorizedID());
                 assertFalse(auth.isAuthorized());
 
@@ -96,19 +96,19 @@
                 assertNull(auth.getAuthorizedID());
                 assertFalse(auth.isAuthorized());
 
-                for (int l = 0; l < newAuthorizedIDs.length; l++) {
-                    auth.setAuthorizedID(newAuthorizedIDs[l]);
+                for (String element1 : newAuthorizedIDs) {
+                    auth.setAuthorizedID(element1);
                     assertNull(auth.getAuthorizedID());
                     auth.setAuthorized(true);
                     assertFalse(auth.getAuthorizedID().equals(
                             auth.getAuthorizationID()));
-                    assertEquals(auth.getAuthorizedID(), newAuthorizedIDs[l]);
-                    auth.setAuthorizedID(newAuthorizedIDs[l] + " ZZZ");
+                    assertEquals(auth.getAuthorizedID(), element1);
+                    auth.setAuthorizedID(element1 + " ZZZ");
                     assertFalse(auth.getAuthorizedID().equals(
                             auth.getAuthorizationID()));
                     assertFalse(auth.getAuthorizedID().equals(
-                            newAuthorizedIDs[l]));
-                    assertEquals(auth.getAuthorizedID(), newAuthorizedIDs[l]
+                            element1));
+                    assertEquals(auth.getAuthorizedID(), element1
                             + " ZZZ");
 
                     auth.setAuthorized(false);



Mime
View raw message