directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r234464 - /directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java
Date Mon, 22 Aug 2005 10:19:30 GMT
Author: erodriguez
Date: Mon Aug 22 03:19:23 2005
New Revision: 234464

URL: http://svn.apache.org/viewcvs?rev=234464&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/messages/components/MessageComponentType.java

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java?rev=234464&r1=234463&r2=234464&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java
Mon Aug 22 03:19:23 2005
@@ -39,23 +39,37 @@
 	public static final MessageComponentType KRB_ENC_KRB_PRIV_PART = new MessageComponentType(28,
"encrypted application message part");
 	public static final MessageComponentType KRB_ENC_KRB_CRED_PART = new MessageComponentType(29,
"encrypted credentials forward part");
 
-	public String toString()
-    {
-        return name + " (" + ordinal + ")";
-    }
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final MessageComponentType[] values = { NULL, KRB_TKT, KRB_AUTHENTICATOR,
+            KRB_ENC_TKT_PART, KRB_ENC_AS_REP_PART, KRB_ENC_TGS_REP_PART, KRB_ENC_AP_REP_PART,
+            KRB_ENC_KRB_PRIV_PART, KRB_ENC_KRB_CRED_PART };
 
-    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 MessageComponentType( int ordinal, String name )
     {
-        return ordinal - ( (MessageComponentType) that ).ordinal;
+        this.ordinal = ordinal;
+        this.name  = name;
     }
 
     public static MessageComponentType 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;
     }
 
@@ -64,25 +78,13 @@
         return ordinal;
     }
 
-    /// PRIVATE /////
-    private final String name;
-    private final int ordinal;
-
-    /**
-     * Private constructor prevents construction outside of this class.
-     */
-    private MessageComponentType( 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 MessageComponentType[] values = { NULL, KRB_TKT, KRB_AUTHENTICATOR,
-            KRB_ENC_TKT_PART, KRB_ENC_AS_REP_PART, KRB_ENC_TGS_REP_PART, KRB_ENC_AP_REP_PART,
-            KRB_ENC_KRB_PRIV_PART, KRB_ENC_KRB_CRED_PART };
-    // 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 - ( (MessageComponentType) that ).ordinal;
+    }
 }



Mime
View raw message