You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2005/08/22 12:16:58 UTC

svn commit: r234463 - /directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/crypto/encryption/EncryptionType.java

Author: erodriguez
Date: Mon Aug 22 03:16:52 2005
New Revision: 234463

URL: http://svn.apache.org/viewcvs?rev=234463&view=rev
Log:
Reformatting:  imports, whitespace, line breaks, or code convention.

Modified:
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/crypto/encryption/EncryptionType.java

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/crypto/encryption/EncryptionType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/crypto/encryption/EncryptionType.java?rev=234463&r1=234462&r2=234463&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/crypto/encryption/EncryptionType.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/crypto/encryption/EncryptionType.java Mon Aug 22 03:16:52 2005
@@ -45,23 +45,39 @@
     public static final EncryptionType RC4_HMAC             = new EncryptionType(16, "RC4-HMAC");
     public static final EncryptionType PK_CROSS             = new EncryptionType(17, "PK-cross");
 
-    public String toString()
-    {
-        return name + " (" + ordinal + ")";
-    }
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final EncryptionType[] values = { NULL, DES_CBC_CRC, DES_CBC_MD4, DES_CBC_MD5,
+            RESERVED4, DES3_CBC_MD5, RESERVED6, DES3_CBC_SHA1, DES3_CBC_SHA1_KD,
+            DSAWITHSHA1_CMSOID, MD5WITHRSAENCRYPTION_CMSOID, SHA1WITHRSAENCRYPTION_CMSOID,
+            RC2CBC_ENVOID, RSAENCRYPTION_ENVOID, RSAES_OAEP_ENV_OID, DES_EDE3_CBC_ENV_OID,
+            RC4_HMAC, PK_CROSS };
 
-    public int compareTo( Object that )
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private EncryptionType( int ordinal, String name )
     {
-        return ordinal - ( (EncryptionType) that ).ordinal;
+        this.ordinal = ordinal;
+        this.name = name;
     }
 
     public static EncryptionType getTypeByOrdinal( int type )
     {
-        for ( int i = 0; i < values.length; i++ )
+        for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ i ].ordinal == type ) return values[ i ];
+            if ( values[ ii ].ordinal == type )
+            {
+                return values[ ii ];
+            }
         }
-        
+
         return NULL;
     }
 
@@ -70,27 +86,13 @@
         return ordinal;
     }
 
-    /// PRIVATE /////
-    private final String name;
-    private final int ordinal;
-
-    /**
-     * Private constructor prevents construction outside of this class.
-     */
-    private EncryptionType( int ordinal, String name )
+    public String toString()
     {
-        this.ordinal = ordinal;
-        this.name = name;
+        return name + " (" + ordinal + ")";
     }
 
-    /**
-     * These two lines are all that's necessary to export a List of VALUES.
-     */
-    private static final EncryptionType[] values = { NULL, DES_CBC_CRC, DES_CBC_MD4, DES_CBC_MD5,
-            RESERVED4, DES3_CBC_MD5, RESERVED6, DES3_CBC_SHA1, DES3_CBC_SHA1_KD,
-            DSAWITHSHA1_CMSOID, MD5WITHRSAENCRYPTION_CMSOID, SHA1WITHRSAENCRYPTION_CMSOID,
-            RC2CBC_ENVOID, RSAENCRYPTION_ENVOID, RSAES_OAEP_ENV_OID, DES_EDE3_CBC_ENV_OID,
-            RC4_HMAC, PK_CROSS };
-    // VALUES needs to be located here, otherwise illegal forward reference
-    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (EncryptionType) that ).ordinal;
+    }
 }