directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r233998 - in /directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions: ErrorType.java KerberosException.java
Date Sat, 20 Aug 2005 04:48:03 GMT
Author: erodriguez
Date: Fri Aug 19 21:48:01 2005
New Revision: 233998

URL: http://svn.apache.org/viewcvs?rev=233998&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/exceptions/ErrorType.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/KerberosException.java

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/ErrorType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/ErrorType.java?rev=233998&r1=233997&r2=233998&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/ErrorType.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/ErrorType.java
Fri Aug 19 21:48:01 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.exceptions;
 
 import java.util.Arrays;
@@ -25,7 +24,7 @@
  * Type safe enumeration of Kerberos error types
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
+ * @version $Rev$, $Date$
  */
 public final class ErrorType implements Comparable
 {
@@ -245,17 +244,15 @@
     /** the value/code for the error type */
     private final int ordinal;
 
-
     /**
      * Private constructor prevents construction outside of this class.
      */
     private ErrorType( int ordinal, String name )
     {
         this.ordinal = ordinal;
-        this.name    = name;
+        this.name = name;
     }
 
-
     /**
      * Returns the message for this Kerberos error.
      *
@@ -263,9 +260,9 @@
      */
     public String getMessage()
     {
-		return name;
-	}
-    
+        return name;
+    }
+
     /**
      * Returns the message for this Kerberos error.
      *
@@ -273,9 +270,9 @@
      */
     public String toString()
     {
-		return name;
-	}
-    
+        return name;
+    }
+
     /**
      * Compares this type to another object hopefully one that is of the same
      * type.
@@ -283,38 +280,37 @@
      * @param that the object to compare this KerberosError to
      * @return ordinal - ( ( KerberosError ) that ).ordinal;
      */
-	public int compareTo( Object that )
+    public int compareTo( Object that )
     {
-		return ordinal - ( ( ErrorType ) that ).ordinal;
-	}
-	
+        return ordinal - ( (ErrorType) that ).ordinal;
+    }
+
     /**
      * Gets the ordinal by its ordinal value.
      *
      * @param ordinal the ordinal value of the ordinal
      * @return the type corresponding to the ordinal value
      */
-	public static ErrorType getTypeByOrdinal( int ordinal )
+    public static ErrorType getTypeByOrdinal( int ordinal )
     {
-		for ( int ii = 0; ii < values.length; ii++ )
+        for ( int ii = 0; ii < values.length; ii++ )
         {
-			if ( values[ ii ].ordinal == ordinal )
+            if ( values[ ii ].ordinal == ordinal )
             {
-				return values[ ii ];
+                return values[ ii ];
             }
         }
 
-		return KRB_ERR_GENERIC;
-	}
-	
+        return KRB_ERR_GENERIC;
+    }
+
     /**
      * Gets the ordinal value associated with this Kerberos error.
      *
      * @return the ordinal value associated with this Kerberos error
      */
-	public int getOrdinal()
+    public int getOrdinal()
     {
-		return ordinal;
-	}
+        return ordinal;
+    }
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/KerberosException.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/KerberosException.java?rev=233998&r1=233997&r2=233998&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/KerberosException.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/exceptions/KerberosException.java
Fri Aug 19 21:48:01 2005
@@ -14,14 +14,13 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.exceptions;
 
 /**
  * The root of the Kerberos exception hierarchy.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
+ * @version $Rev$, $Date$
  */
 public class KerberosException extends Exception
 {
@@ -29,18 +28,17 @@
      * The Kerberos error code associated with this exception
      */
     private final int errorCode;
-    
+
     /**
      * Additional data about the error for use by the application
      * to help it recover from or handle the error.
      */
-    private byte[] explanatoryData; 
-    
+    private byte[] explanatoryData;
+
     // ------------------------------------------------------------------------
     // C O N S T R U C T O R S
     // ------------------------------------------------------------------------
 
-
     /**
      * Creates a KerberosException with an error code and a message.
      *
@@ -54,7 +52,6 @@
         this.errorCode = errorCode;
     }
 
-
     /**
      * Creates a KerberosException with an error code, a message and an
      * underlying throwable that caused this fault.
@@ -69,8 +66,7 @@
 
         this.errorCode = errorCode;
     }
-    
-    
+
     /**
      * Creates a KerberosException with an error code and a message.
      *
@@ -83,8 +79,20 @@
 
         this.errorCode = errorType.getOrdinal();
     }
-    
-    
+
+    /**
+     * Creates a KerberosException with an error code and a custom error message.
+     *
+     * @param errorCode the error code associated with this KerberosException
+     * @param msg a custom error message for this KerberosException
+     */
+    public KerberosException( ErrorType errorType, String msg )
+    {
+        super( msg );
+
+        this.errorCode = errorType.getOrdinal();
+    }
+
     /**
      * Creates a KerberosException with an error code, a message, and
      * data helping to explain what caused this fault.
@@ -100,8 +108,7 @@
         this.errorCode = errorType.getOrdinal();
         this.explanatoryData = explanatoryData;
     }
-    
-    
+
     /**
      * Gets the protocol error code associated with this KerberosException.
      *
@@ -111,15 +118,14 @@
     {
         return this.errorCode;
     }
-    
+
     /**
      * Gets the explanatory data associated with this KerberosException.
      *
      * @return the explanatory data associated with this KerberosException
      */
-	public byte[] getExplanatoryData()
-	{
-		return explanatoryData;
-	}
+    public byte[] getExplanatoryData()
+    {
+        return explanatoryData;
+    }
 }
-



Mime
View raw message