harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r451613 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security: auth/x500/ sasl/
Date Sat, 30 Sep 2006 17:04:34 GMT
Author: ndbeyer
Date: Sat Sep 30 10:04:34 2006
New Revision: 451613

URL: http://svn.apache.org/viewvc?view=rev&rev=451613
Log:
Code cleanup -
* Add missing annotations
* Generification
* Add if/else braces
* Format comments
* Remove unnecessary comments

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthenticationException.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthorizeCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmChoiceCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClient.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServer.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java
Sat Sep 30 10:04:34 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Alexander V. Esin
-* @version $Revision$
-*/
-
 package javax.security.auth.x500;
 
 import java.io.IOException;
@@ -32,41 +27,21 @@
 import org.apache.harmony.auth.internal.nls.Messages;
 import org.apache.harmony.security.x501.Name;
 
-
-/**
- * @com.intel.drl.spec_ref
- * 
- */
 public final class X500Principal implements Serializable, Principal {
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     private static final long serialVersionUID = -500463348111345721L;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public static final String CANONICAL = "CANONICAL"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public static final String RFC1779 = "RFC1779"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
-
     public static final String RFC2253 = "RFC2253"; //$NON-NLS-1$
 
     //Distinguished Name
     private transient Name dn;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public X500Principal(byte[] name) {
+        super();
         if (name == null) {
             throw new IllegalArgumentException(Messages.getString("auth.00")); //$NON-NLS-1$
         }
@@ -74,17 +49,15 @@
             // FIXME dn = new Name(name);
             dn = (Name) Name.ASN1.decode(name);
         } catch (IOException e) {
-            IllegalArgumentException iae = new IllegalArgumentException(
-                    Messages.getString("auth.2B")); //$NON-NLS-1$
+            IllegalArgumentException iae = new IllegalArgumentException(Messages
+                    .getString("auth.2B")); //$NON-NLS-1$
             iae.initCause(e);
             throw iae;
         }
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public X500Principal(InputStream in) {
+        super();
         if (in == null) {
             throw new NullPointerException(Messages.getString("auth.2C")); //$NON-NLS-1$
         }
@@ -92,33 +65,29 @@
             // FIXME dn = new Name(is);
             dn = (Name) Name.ASN1.decode(in);
         } catch (IOException e) {
-            IllegalArgumentException iae = new IllegalArgumentException(
-                    Messages.getString("auth.2B")); //$NON-NLS-1$
+            IllegalArgumentException iae = new IllegalArgumentException(Messages
+                    .getString("auth.2B")); //$NON-NLS-1$
             iae.initCause(e);
             throw iae;
         }
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public X500Principal(String name) {
+        super();
         if (name == null) {
             throw new NullPointerException(Messages.getString("auth.00")); //$NON-NLS-1$
         }
         try {
             dn = new Name(name);
         } catch (IOException e) {
-            IllegalArgumentException iae = new IllegalArgumentException(
-                    Messages.getString("auth.2D")); //$NON-NLS-1$
+            IllegalArgumentException iae = new IllegalArgumentException(Messages
+                    .getString("auth.2D")); //$NON-NLS-1$
             iae.initCause(e);
             throw iae;
         }
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public boolean equals(Object o) {
         if (this == o) {
             return true;
@@ -127,13 +96,9 @@
             return false;
         }
         X500Principal principal = (X500Principal) o;
-        return dn.getName(CANONICAL).equals(
-                principal.dn.getName(CANONICAL));
+        return dn.getName(CANONICAL).equals(principal.dn.getName(CANONICAL));
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public byte[] getEncoded() {
         byte[] src = dn.getEncoded();
         byte[] dst = new byte[src.length];
@@ -141,47 +106,30 @@
         return dst;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public String getName() {
         return dn.getName(RFC2253);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public String getName(String format) {
         return dn.getName(format);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public int hashCode() {
         return dn.getName(CANONICAL).hashCode();
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public String toString() {
         return dn.getName(RFC1779);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     private void writeObject(ObjectOutputStream out) throws IOException {
         out.writeObject(dn.getEncoded());
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    private void readObject(ObjectInputStream in) throws IOException,
-            ClassNotFoundException {
+    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
 
         dn = (Name) Name.ASN1.decode((byte[]) in.readObject());
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java
Sat Sep 30 10:04:34 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Alexander V. Esin
-* @version $Revision$
-*/
-
 package javax.security.auth.x500;
 
 import java.security.cert.X509Certificate;
@@ -28,9 +23,6 @@
 
 import org.apache.harmony.auth.internal.nls.Messages;
 
-/**
- * @com.intel.drl.spec_ref
- */
 public final class X500PrivateCredential implements Destroyable {
 
     //X509 certificate
@@ -42,10 +34,8 @@
     //Alias
     private String alias;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public X500PrivateCredential(X509Certificate cert, PrivateKey key) {
+        super();
         if (cert == null) {
             throw new IllegalArgumentException(Messages.getString("auth.28")); //$NON-NLS-1$
         }
@@ -56,11 +46,7 @@
         this.key = key;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public X500PrivateCredential(X509Certificate cert, PrivateKey key,
-            String alias) {
+    public X500PrivateCredential(X509Certificate cert, PrivateKey key, String alias) {
         this(cert, key);
         if (alias == null) {
             throw new IllegalArgumentException(Messages.getString("auth.2A")); //$NON-NLS-1$
@@ -68,40 +54,25 @@
         this.alias = alias;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public X509Certificate getCertificate() {
         return cert;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public PrivateKey getPrivateKey() {
         return key;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public String getAlias() {
         return alias;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public void destroy() {
         cert = null;
         key = null;
         alias = null;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public boolean isDestroyed() {
         return (cert == null && key == null && alias == null);
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthenticationException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthenticationException.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthenticationException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthenticationException.java
Sat Sep 30 10:04:34 2006
@@ -15,42 +15,21 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-/**
- * @com.intel.drl.spec_ref
- * 
- */
 public class AuthenticationException extends SaslException {
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     private static final long serialVersionUID = -3579708765071815007L;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public AuthenticationException() {
         super();
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public AuthenticationException(String detail) {
         super(detail);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public AuthenticationException(String detail, Throwable ex) {
         super(detail, ex);
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthorizeCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthorizeCallback.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthorizeCallback.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/AuthorizeCallback.java
Sat Sep 30 10:04:34 2006
@@ -15,112 +15,65 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import java.io.Serializable;
 import javax.security.auth.callback.Callback;
 
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
 public class AuthorizeCallback implements Callback, Serializable {
-    /**
-     * @com.intel.drl.spec_ref
-     */
+
     private static final long serialVersionUID = -2353344186490470805L;
 
     /**
-     * @com.intel.drl.spec_ref
-     * 
      * Serialized field for storing authenticationID.
      */
     private final String authenticationID;
 
     /**
-     * @com.intel.drl.spec_ref
-     * 
      * Serialized field for storing authorizationID.
      */
     private final String authorizationID;
 
     /**
-     * @com.intel.drl.spec_ref
-     * 
      * Serialized field for storing authorizedID.
      */
     private String authorizedID;
 
     /**
-     * @com.intel.drl.spec_ref
-     * 
      * Store authorized Serialized field.
      */
     private boolean authorized;
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public AuthorizeCallback(String authnID, String authzID) {
+        super();
         authenticationID = authnID;
         authorizationID = authzID;
         authorizedID = authzID;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public String getAuthenticationID() {
         return authenticationID;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public String getAuthorizationID() {
         return authorizationID;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public String getAuthorizedID() {
         return (authorized ? authorizedID : null);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public boolean isAuthorized() {
         return authorized;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public void setAuthorized(boolean ok) {
         authorized = ok;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public void setAuthorizedID(String id) {
         if (id != null) {
             authorizedID = id;
         }
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmCallback.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmCallback.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmCallback.java
Sat Sep 30 10:04:34 2006
@@ -15,37 +15,19 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import javax.security.auth.callback.TextInputCallback;
 
-/**
- * @com.intel.drl.spec_ref
- * 
- */
 public class RealmCallback extends TextInputCallback {
-    /**
-     * @com.intel.drl.spec_ref
-     */
+
     private static final long serialVersionUID = -4342673378785456908L;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public RealmCallback(String prompt) {
         super(prompt);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public RealmCallback(String prompt, String defaultRealmInfo) {
         super(prompt, defaultRealmInfo);
     }
-
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmChoiceCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmChoiceCallback.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmChoiceCallback.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/RealmChoiceCallback.java
Sat Sep 30 10:04:34 2006
@@ -15,31 +15,16 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import javax.security.auth.callback.ChoiceCallback;
 
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
 public class RealmChoiceCallback extends ChoiceCallback {
-    /**
-     * @com.intel.drl.spec_ref
-     */
+
     private static final long serialVersionUID = -8588141348846281332L;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public RealmChoiceCallback(String prompt, String[] choices,
-            int defaultChoice, boolean multiple) {
+    public RealmChoiceCallback(String prompt, String[] choices, int defaultChoice,
+            boolean multiple) {
         super(prompt, choices, defaultChoice, multiple);
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
Sat Sep 30 10:04:34 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import java.security.Provider;
@@ -35,12 +30,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 
-/**
- * 
- * @com.intel.drl.spec_ref
- * 
- *  
- */
 public class Sasl {
     // SaslClientFactory service name
     private static final String CLIENTFACTORYSRV = "SaslClientFactory"; //$NON-NLS-1$
@@ -48,85 +37,37 @@
     // SaslServerFactory service name
     private static final String SERVERFACTORYSRV = "SaslServerFactory"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String POLICY_NOPLAINTEXT = "javax.security.sasl.policy.noplaintext";
//$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String POLICY_NOACTIVE = "javax.security.sasl.policy.noactive"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String POLICY_NODICTIONARY = "javax.security.sasl.policy.nodictionary";
//$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String POLICY_NOANONYMOUS = "javax.security.sasl.policy.noanonymous";
//$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String POLICY_FORWARD_SECRECY = "javax.security.sasl.policy.forward";
//$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String POLICY_PASS_CREDENTIALS = "javax.security.sasl.policy.credentials";
//$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String MAX_BUFFER = "javax.security.sasl.maxbuffer"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String RAW_SEND_SIZE = "javax.security.sasl.rawsendsize"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String REUSE = "javax.security.sasl.reuse"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String QOP = "javax.security.sasl.qop"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String STRENGTH = "javax.security.sasl.strength"; //$NON-NLS-1$
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
     public static final String SERVER_AUTH = "javax.security.sasl.server.authentication";
//$NON-NLS-1$
 
     // Default public constructor is overridden
     private Sasl() {
+        super();
     }
 
     // Forms new instance of factory
-    private static Object newInstance(String factoryName, Provider prv)
-            throws SaslException {
+    private static Object newInstance(String factoryName, Provider prv) throws SaslException
{
         String msg = Messages.getString("auth.31"); //$NON-NLS-1$
         Object factory;
         ClassLoader cl = prv.getClass().getClassLoader();
@@ -145,25 +86,24 @@
         }
     }
 
-    // This method forms the list of SaslClient/SaslServer factories
-    // which are implemented in used providers
-    private static Collection findFactories(String service) {
-        HashSet fact = new HashSet();
+    /**
+     * This method forms the list of SaslClient/SaslServer factories which are
+     * implemented in used providers
+     */
+    private static Collection<?> findFactories(String service) {
+        HashSet<Object> fact = new HashSet<Object>();
         Provider[] pp = Security.getProviders();
         if ((pp == null) || (pp.length == 0)) {
             return fact;
         }
-        HashSet props = new HashSet();
-        Enumeration keys;
-        String prName;
-        String prop;
+        HashSet<String> props = new HashSet<String>();
         for (int i = 0; i < pp.length; i++) {
-            prName = pp[i].getName();
-            keys = pp[i].keys();
+            String prName = pp[i].getName();
+            Enumeration<Object> keys = pp[i].keys();
             while (keys.hasMoreElements()) {
                 String s = (String) keys.nextElement();
                 if (s.startsWith(service)) {
-                    prop = pp[i].getProperty(s);
+                    String prop = pp[i].getProperty(s);
                     try {
                         if (props.add(prName.concat(prop))) {
                             fact.add(newInstance(prop, pp[i]));
@@ -178,50 +118,34 @@
         return fact;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
+    @SuppressWarnings("unchecked")
     public static Enumeration<SaslClientFactory> getSaslClientFactories() {
-        //        Vector res = findFactories(CLIENTFACTORYSRV);
-        Collection res = findFactories(CLIENTFACTORYSRV);
+        Collection<SaslClientFactory> res = (Collection<SaslClientFactory>) findFactories(CLIENTFACTORYSRV);
         return Collections.enumeration(res);
 
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
+    @SuppressWarnings("unchecked")
     public static Enumeration<SaslServerFactory> getSaslServerFactories() {
-        //        Vector res = findFactories(SERVERFACTORYSRV);
-        Collection res = findFactories(SERVERFACTORYSRV);
+        Collection<SaslServerFactory> res = (Collection<SaslServerFactory>) findFactories(SERVERFACTORYSRV);
         return Collections.enumeration(res);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public static SaslServer createSaslServer(String mechanism,
-            String protocol, String serverName, Map<String,?> prop, CallbackHandler
cbh)
-            throws SaslException {
+    public static SaslServer createSaslServer(String mechanism, String protocol,
+            String serverName, Map<String, ?> prop, CallbackHandler cbh) throws SaslException
{
         if (mechanism == null) {
             throw new NullPointerException(Messages.getString("auth.32")); //$NON-NLS-1$
         }
-        HashSet res = (HashSet) findFactories(SERVERFACTORYSRV);
-        if (res.size() == 0) {
+        Collection<?> res = findFactories(SERVERFACTORYSRV);
+        if (res.isEmpty()) {
             return null;
         }
-        SaslServer saslS = null;
-        SaslServerFactory fact = null;
-        boolean is = false;
-        String[] mech;
-        Iterator iter = res.iterator();
+
+        Iterator<?> iter = res.iterator();
         while (iter.hasNext()) {
-            fact = (SaslServerFactory) iter.next();
-            mech = fact.getMechanismNames(null);
-            is = false;
+            SaslServerFactory fact = (SaslServerFactory) iter.next();
+            String[] mech = fact.getMechanismNames(null);
+            boolean is = false;
             if (mech != null) {
                 for (int j = 0; j < mech.length; j++) {
                     if (mech[j].equals(mechanism)) {
@@ -231,8 +155,8 @@
                 }
             }
             if (is) {
-                saslS = fact.createSaslServer(mechanism, protocol, serverName,
-                        prop, cbh);
+                SaslServer saslS = fact.createSaslServer(mechanism, protocol, serverName,
prop,
+                        cbh);
                 if (saslS != null) {
                     return saslS;
                 }
@@ -241,29 +165,22 @@
         return null;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public static SaslClient createSaslClient(String[] mechanisms,
-            String authanticationID, String protocol, String serverName,
-            Map<String,?> prop, CallbackHandler cbh) throws SaslException {
+    public static SaslClient createSaslClient(String[] mechanisms, String authanticationID,
+            String protocol, String serverName, Map<String, ?> prop, CallbackHandler
cbh)
+            throws SaslException {
         if (mechanisms == null) {
             throw new NullPointerException(Messages.getString("auth.33")); //$NON-NLS-1$
         }
-        HashSet res = (HashSet) findFactories(CLIENTFACTORYSRV);
-        if (res.size() == 0) {
+        Collection<?> res = findFactories(CLIENTFACTORYSRV);
+        if (res.isEmpty()) {
             return null;
         }
-        SaslClientFactory fact;
-        SaslClient saslC = null;
-        String[] mech;
-        boolean is = false;
-        Iterator iter = res.iterator();
+
+        Iterator<?> iter = res.iterator();
         while (iter.hasNext()) {
-            fact = (SaslClientFactory) iter.next();
-            mech = fact.getMechanismNames(null);
-            is = false;
+            SaslClientFactory fact = (SaslClientFactory) iter.next();
+            String[] mech = fact.getMechanismNames(null);
+            boolean is = false;
             if (mech != null) {
                 for (int j = 0; j < mech.length; j++) {
                     for (int n = 0; n < mechanisms.length; n++) {
@@ -275,7 +192,7 @@
                 }
             }
             if (is) {
-                saslC = fact.createSaslClient(mechanisms, authanticationID,
+                SaslClient saslC = fact.createSaslClient(mechanisms, authanticationID,
                         protocol, serverName, prop, cbh);
                 if (saslC != null) {
                     return saslC;
@@ -284,4 +201,4 @@
         }
         return null;
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClient.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClient.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClient.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClient.java
Sat Sep 30 10:04:34 2006
@@ -15,65 +15,23 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-/**
- * @com.intel.drl.spec_ref
- *  
- */
 public interface SaslClient {
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public void dispose() throws SaslException;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public byte[] evaluateChallenge(byte[] challenge) throws SaslException;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public String getMechanismName();
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public Object getNegotiatedProperty(String propName);
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public boolean hasInitialResponse();
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public boolean isComplete();
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public byte[] unwrap(byte[] incoming, int offset, int len)
-            throws SaslException;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public byte[] wrap(byte[] outgoing, int offset, int len)
-            throws SaslException;
-}
\ No newline at end of file
+
+    void dispose() throws SaslException;
+
+    byte[] evaluateChallenge(byte[] challenge) throws SaslException;
+
+    String getMechanismName();
+
+    Object getNegotiatedProperty(String propName);
+
+    boolean hasInitialResponse();
+
+    boolean isComplete();
+
+    byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException;
+
+    byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java
Sat Sep 30 10:04:34 2006
@@ -15,31 +15,16 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import java.util.Map;
 import javax.security.auth.callback.CallbackHandler;
 
-/**
- * @com.intel.drl.spec_ref
- *  
- */
 public interface SaslClientFactory {
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public SaslClient createSaslClient(String[] mechanisms,
-            String authorizationId, String protocol, String serverName,
-            Map<String,?> props, CallbackHandler cbh) throws SaslException;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public String[] getMechanismNames(Map<String,?> props);
+    SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol,
+            String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException;
+
+    String[] getMechanismNames(Map<String, ?> props);
 
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java
Sat Sep 30 10:04:34 2006
@@ -15,49 +15,27 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import java.io.IOException;
 
-/**
- * @com.intel.drl.spec_ref
- * 
- */
 public class SaslException extends IOException {
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     private static final long serialVersionUID = 4579784287983423626L;
 
     /**
-     * @com.intel.drl.spec_ref
-     * 
      * Serialized field for storing initial cause
      */
     private Throwable _exception;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public SaslException() {
+        super();
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public SaslException(String detail) {
         super(detail);
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public SaslException(String detail, Throwable ex) {
         super(detail);
         if (ex != null) {
@@ -65,34 +43,26 @@
             _exception = ex;
         }
     }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public Throwable getCause() {
         return _exception;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public Throwable initCause(Throwable cause) {
         super.initCause(cause);
         _exception = cause;
         return this;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public String toString() {
         if (_exception == null) {
             return super.toString();
-        } else {
-            StringBuffer sb = new StringBuffer(super.toString());
-            sb.append(", caused by: "); //$NON-NLS-1$
-            sb.append(_exception.toString());
-            return sb.toString();
         }
+        StringBuilder sb = new StringBuilder(super.toString());
+        sb.append(", caused by: "); //$NON-NLS-1$
+        sb.append(_exception.toString());
+        return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServer.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServer.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServer.java
Sat Sep 30 10:04:34 2006
@@ -15,65 +15,23 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-/**
- * @com.intel.drl.spec_ref
- *  
- */
 public interface SaslServer {
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public void dispose() throws SaslException;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public byte[] evaluateResponse(byte[] response) throws SaslException;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public String getAuthorizationID();
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public String getMechanismName();
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public Object getNegotiatedProperty(String propName);
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public boolean isComplete();
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public byte[] unwrap(byte[] incoming, int offset, int len)
-            throws SaslException;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public byte[] wrap(byte[] outgoing, int offset, int len)
-            throws SaslException;
-}
\ No newline at end of file
+
+    void dispose() throws SaslException;
+
+    byte[] evaluateResponse(byte[] response) throws SaslException;
+
+    String getAuthorizationID();
+
+    String getMechanismName();
+
+    Object getNegotiatedProperty(String propName);
+
+    boolean isComplete();
+
+    byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException;
+
+    byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java?view=diff&rev=451613&r1=451612&r2=451613
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java
Sat Sep 30 10:04:34 2006
@@ -15,31 +15,16 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import java.util.Map;
 import javax.security.auth.callback.CallbackHandler;
 
-/**
- * @com.intel.drl.spec_ref
- *  
- */
 public interface SaslServerFactory {
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public SaslServer createSaslServer(String mechanisms, String protocol,
-            String serverName, Map<String,?> props, CallbackHandler cbh)
-            throws SaslException;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public String[] getMechanismNames(Map<String,?> props);
+    SaslServer createSaslServer(String mechanisms, String protocol, String serverName,
+            Map<String, ?> props, CallbackHandler cbh) throws SaslException;
+
+    String[] getMechanismNames(Map<String, ?> props);
 
-}
\ No newline at end of file
+}



Mime
View raw message