directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r233372 - in /directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos: crypto/encryption/EncryptionType.java messages/value/HostAddressType.java messages/value/KerberosTime.java
Date Thu, 18 Aug 2005 20:22:54 GMT
Author: erodriguez
Date: Thu Aug 18 13:22:50 2005
New Revision: 233372

URL: http://svn.apache.org/viewcvs?rev=233372&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
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/KerberosTime.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=233372&r1=233371&r2=233372&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
Thu Aug 18 13:22:50 2005
@@ -16,72 +16,78 @@
  */
 package org.apache.kerberos.crypto.encryption;
 
-import java.util.*;
-
-public final class EncryptionType implements Comparable {
-
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final EncryptionType NULL                 = new EncryptionType(0, "null");
-	public static final EncryptionType DES_CBC_CRC          = new EncryptionType(1, "DES-CBC-CRC");
-	public static final EncryptionType DES_CBC_MD4          = new EncryptionType(2, "DES-CBC-MD4");
-	public static final EncryptionType DES_CBC_MD5          = new EncryptionType(3, "DES-CBC-MD5");
-	public static final EncryptionType RESERVED4            = new EncryptionType(4, "RESERVED-4");
-	public static final EncryptionType DES3_CBC_MD5         = new EncryptionType(5, "DES3-CBC-MD5");
-	public static final EncryptionType RESERVED6            = new EncryptionType(6, "RESERVED-6");
-	public static final EncryptionType DES3_CBC_SHA1        = new EncryptionType(7, "DES3-CBC-SHA1");
-	public static final EncryptionType DES3_CBC_SHA1_KD     = new EncryptionType(8, "DES3-CBC-SHA1-KD");
-	public static final EncryptionType DSAWITHSHA1_CMSOID   = new EncryptionType(9, "DSA-with-SHA1-CMS-oid");
-	public static final EncryptionType MD5WITHRSAENCRYPTION_CMSOID  = new EncryptionType(10,
"MD5-with-RSA-encryption-CMS-oid");
-	public static final EncryptionType SHA1WITHRSAENCRYPTION_CMSOID = new EncryptionType(11,
"SHA1-with-RSA-encryption-CMS-oid");
-	public static final EncryptionType RC2CBC_ENVOID        = new EncryptionType(12, "RC2-CBC-environment-oid");
-	public static final EncryptionType RSAENCRYPTION_ENVOID = new EncryptionType(13, "RSA-encryption-environment-oid");
-	public static final EncryptionType RSAES_OAEP_ENV_OID   = new EncryptionType(14, "RSA-ES-OAEP-environment-oid");
-	public static final EncryptionType DES_EDE3_CBC_ENV_OID = new EncryptionType(15, "DES-EDE3-CBC-environment-oid");
-	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 _fName;
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((EncryptionType) that)._fOrdinal;
-	}
-
-	public static EncryptionType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return NULL;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private EncryptionType(int ordinal, String name) {
-		_fOrdinal = ordinal;
-		_fName    = name;
-	}
-
-	/**
-	 * These two lines are all that's necessary to export a List of VALUES.
-	 */
-	private static final EncryptionType[] fValues = {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(fValues));
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public final class EncryptionType implements Comparable
+{
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final EncryptionType NULL                 = new EncryptionType(0, "null");
+    public static final EncryptionType DES_CBC_CRC          = new EncryptionType(1, "DES-CBC-CRC");
+    public static final EncryptionType DES_CBC_MD4          = new EncryptionType(2, "DES-CBC-MD4");
+    public static final EncryptionType DES_CBC_MD5          = new EncryptionType(3, "DES-CBC-MD5");
+    public static final EncryptionType RESERVED4            = new EncryptionType(4, "RESERVED-4");
+    public static final EncryptionType DES3_CBC_MD5         = new EncryptionType(5, "DES3-CBC-MD5");
+    public static final EncryptionType RESERVED6            = new EncryptionType(6, "RESERVED-6");
+    public static final EncryptionType DES3_CBC_SHA1        = new EncryptionType(7, "DES3-CBC-SHA1");
+    public static final EncryptionType DES3_CBC_SHA1_KD     = new EncryptionType(8, "DES3-CBC-SHA1-KD");
+    public static final EncryptionType DSAWITHSHA1_CMSOID   = new EncryptionType(9, "DSA-with-SHA1-CMS-oid");
+    public static final EncryptionType MD5WITHRSAENCRYPTION_CMSOID  = new EncryptionType(10,
"MD5-with-RSA-encryption-CMS-oid");
+    public static final EncryptionType SHA1WITHRSAENCRYPTION_CMSOID = new EncryptionType(11,
"SHA1-with-RSA-encryption-CMS-oid");
+    public static final EncryptionType RC2CBC_ENVOID        = new EncryptionType(12, "RC2-CBC-environment-oid");
+    public static final EncryptionType RSAENCRYPTION_ENVOID = new EncryptionType(13, "RSA-encryption-environment-oid");
+    public static final EncryptionType RSAES_OAEP_ENV_OID   = new EncryptionType(14, "RSA-ES-OAEP-environment-oid");
+    public static final EncryptionType DES_EDE3_CBC_ENV_OID = new EncryptionType(15, "DES-EDE3-CBC-environment-oid");
+    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 + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (EncryptionType) that ).ordinal;
+    }
+
+    public static EncryptionType getTypeByOrdinal( int type )
+    {
+        for ( int i = 0; i < values.length; i++ )
+            if ( values[ i ].ordinal == type ) return values[ i ];
+        return NULL;
+    }
+
+    public int getOrdinal()
+    {
+        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 )
+    {
+        this.ordinal = ordinal;
+        this.name = name;
+    }
+
+    /**
+     * 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
) );
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java?rev=233372&r1=233371&r2=233372&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java
Thu Aug 18 13:22:50 2005
@@ -16,80 +16,85 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class HostAddressType implements Comparable {
-
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final HostAddressType NULL               = new HostAddressType(0, "null");
-	public static final HostAddressType ADDRTYPE_UNIX      = new HostAddressType(1, "Unix");
-	public static final HostAddressType ADDRTYPE_INET      = new HostAddressType(2, "Internet");
-	public static final HostAddressType ADDRTYPE_IMPLINK   = new HostAddressType(3, "Arpanet");
-	public static final HostAddressType ADDRTYPE_PUP       = new HostAddressType(4, "PUP");
-	public static final HostAddressType ADDRTYPE_CHAOS     = new HostAddressType(5, "CHAOS");
-	public static final HostAddressType ADDRTYPE_XNS       = new HostAddressType(6, "XEROX Network
Services");
-	public static final HostAddressType ADDRTYPE_IPX       = new HostAddressType(6, "IPX");
-	public static final HostAddressType ADDRTYPE_OSI       = new HostAddressType(7, "OSI");
-	public static final HostAddressType ADDRTYPE_ECMA      = new HostAddressType(8, "European
Computer Manufacturers");
-	public static final HostAddressType ADDRTYPE_DATAKIT   = new HostAddressType(9, "Datakit");
-	public static final HostAddressType ADDRTYPE_CCITT     = new HostAddressType(10, "CCITT");
-	public static final HostAddressType ADDRTYPE_SNA       = new HostAddressType(11, "SNA");
-	public static final HostAddressType ADDRTYPE_DECNET    = new HostAddressType(12, "DECnet");
-	public static final HostAddressType ADDRTYPE_DLI       = new HostAddressType(13, "Direct
Data Link Interface");
-	public static final HostAddressType ADDRTYPE_LAT       = new HostAddressType(14, "LAT");
-	public static final HostAddressType ADDRTYPE_HYLINK    = new HostAddressType(15, "NSC Hyperchannel");
-	public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType(16, "AppleTalk");
-	public static final HostAddressType ADDRTYPE_NETBIOS   = new HostAddressType(17, "NetBios");
-	public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType(18, "VoiceView");
-	public static final HostAddressType ADDRTYPE_FIREFOX   = new HostAddressType(19, "Firefox");
-	public static final HostAddressType ADDRTYPE_BAN       = new HostAddressType(21, "Banyan");
-	public static final HostAddressType ADDRTYPE_ATM       = new HostAddressType(22, "ATM");
-	public static final HostAddressType ADDRTYPE_INET6     = new HostAddressType(23, "Internet
Protocol V6");
-	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((HostAddressType) that)._fOrdinal;
-	}
-
-	public static HostAddressType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return NULL;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private HostAddressType(int ordinal, String name) {
-		_fOrdinal = ordinal;
-		_fName    = name;
-	}
-
-	/**
-	 * These two lines are all that's necessary to export a List of VALUES.
-	 */
-	private static final HostAddressType[] fValues = {NULL, ADDRTYPE_UNIX, ADDRTYPE_INET,
-			ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS, ADDRTYPE_XNS, ADDRTYPE_IPX,
-			ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT, ADDRTYPE_SNA,
-			ADDRTYPE_DECNET, ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK,
-			ADDRTYPE_NETBIOS, ADDRTYPE_VOICEVIEW, ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM,
-			ADDRTYPE_INET6};
-	// VALUES needs to be located here, otherwise illegal forward reference
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(fValues));
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public final class HostAddressType implements Comparable
+{
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final HostAddressType NULL               = new HostAddressType(0, "null");
+    public static final HostAddressType ADDRTYPE_UNIX      = new HostAddressType(1, "Unix");
+    public static final HostAddressType ADDRTYPE_INET      = new HostAddressType(2, "Internet");
+    public static final HostAddressType ADDRTYPE_IMPLINK   = new HostAddressType(3, "Arpanet");
+    public static final HostAddressType ADDRTYPE_PUP       = new HostAddressType(4, "PUP");
+    public static final HostAddressType ADDRTYPE_CHAOS     = new HostAddressType(5, "CHAOS");
+    public static final HostAddressType ADDRTYPE_XNS       = new HostAddressType(6, "XEROX
Network Services");
+    public static final HostAddressType ADDRTYPE_IPX       = new HostAddressType(6, "IPX");
+    public static final HostAddressType ADDRTYPE_OSI       = new HostAddressType(7, "OSI");
+    public static final HostAddressType ADDRTYPE_ECMA      = new HostAddressType(8, "European
Computer Manufacturers");
+    public static final HostAddressType ADDRTYPE_DATAKIT   = new HostAddressType(9, "Datakit");
+    public static final HostAddressType ADDRTYPE_CCITT     = new HostAddressType(10, "CCITT");
+    public static final HostAddressType ADDRTYPE_SNA       = new HostAddressType(11, "SNA");
+    public static final HostAddressType ADDRTYPE_DECNET    = new HostAddressType(12, "DECnet");
+    public static final HostAddressType ADDRTYPE_DLI       = new HostAddressType(13, "Direct
Data Link Interface");
+    public static final HostAddressType ADDRTYPE_LAT       = new HostAddressType(14, "LAT");
+    public static final HostAddressType ADDRTYPE_HYLINK    = new HostAddressType(15, "NSC
Hyperchannel");
+    public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType(16, "AppleTalk");
+    public static final HostAddressType ADDRTYPE_NETBIOS   = new HostAddressType(17, "NetBios");
+    public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType(18, "VoiceView");
+    public static final HostAddressType ADDRTYPE_FIREFOX   = new HostAddressType(19, "Firefox");
+    public static final HostAddressType ADDRTYPE_BAN       = new HostAddressType(21, "Banyan");
+    public static final HostAddressType ADDRTYPE_ATM       = new HostAddressType(22, "ATM");
+    public static final HostAddressType ADDRTYPE_INET6     = new HostAddressType(23, "Internet
Protocol V6");
+
+    public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (HostAddressType) that ).ordinal;
+    }
+
+    public static HostAddressType getTypeByOrdinal( int type )
+    {
+        for ( int i = 0; i < values.length; i++ )
+            if ( values[ i ].ordinal == type ) return values[ i ];
+        return NULL;
+    }
+
+    public int getOrdinal()
+    {
+        return ordinal;
+    }
+
+    /// PRIVATE /////
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private HostAddressType( int ordinal, String name )
+    {
+        this.ordinal = ordinal;
+        this.name = name;
+    }
+
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final HostAddressType[] values = { NULL, ADDRTYPE_UNIX, ADDRTYPE_INET,
+            ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS, ADDRTYPE_XNS, ADDRTYPE_IPX,
+            ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT, ADDRTYPE_SNA,
+            ADDRTYPE_DECNET, ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK,
+            ADDRTYPE_NETBIOS, ADDRTYPE_VOICEVIEW, ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM,
+            ADDRTYPE_INET6 };
+    // VALUES needs to be located here, otherwise illegal forward reference
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values
) );
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java?rev=233372&r1=233371&r2=233372&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java
Thu Aug 18 13:22:50 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
 import java.util.Date;
@@ -24,7 +23,7 @@
  */
 public class KerberosTime implements Comparable
 {
-    public static final KerberosTime INFINITY = new KerberosTime(Long.MAX_VALUE);
+    public static final KerberosTime INFINITY = new KerberosTime( Long.MAX_VALUE );
 
     private long localTime;
 
@@ -33,24 +32,24 @@
         localTime = System.currentTimeMillis();
     }
 
-    public KerberosTime(long time)
+    public KerberosTime( long time )
     {
         localTime = time;
     }
 
-    public KerberosTime(Date time)
+    public KerberosTime( Date time )
     {
         localTime = time.getTime();
     }
 
-    public int compareTo(Object o)
+    public int compareTo( Object o )
     {
         final int BEFORE = -1;
         final int EQUAL = 0;
         final int AFTER = 1;
 
         // this optimization is usually worthwhile, and can always be added
-        if (this == o)
+        if ( this == o )
         {
             return EQUAL;
         }
@@ -61,12 +60,12 @@
         final KerberosTime that = (KerberosTime) o;
 
         // primitive numbers follow this form
-        if (this.localTime < that.localTime)
+        if ( this.localTime < that.localTime )
         {
             return BEFORE;
         }
-        
-        if (this.localTime > that.localTime)
+
+        if ( this.localTime > that.localTime )
         {
             return AFTER;
         }
@@ -81,25 +80,25 @@
 
     public Date toDate()
     {
-        return new Date(localTime);
+        return new Date( localTime );
     }
 
-    public boolean isInClockSkew(long clockSkew)
+    public boolean isInClockSkew( long clockSkew )
     {
-        return Math.abs(localTime - System.currentTimeMillis()) < clockSkew;
+        return Math.abs( localTime - System.currentTimeMillis() ) < clockSkew;
     }
 
-    public boolean greaterThan(KerberosTime time)
+    public boolean greaterThan( KerberosTime time )
     {
         return localTime > time.localTime;
     }
 
-    public boolean lessThan(KerberosTime time)
+    public boolean lessThan( KerberosTime time )
     {
         return localTime < time.localTime;
     }
 
-    public boolean equals(KerberosTime time)
+    public boolean equals( KerberosTime time )
     {
         return localTime == time.localTime;
     }



Mime
View raw message