directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r312978 - in /directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util: BooleanDecoder.java BooleanDecoderException.java
Date Tue, 11 Oct 2005 23:28:56 GMT
Author: elecharny
Date: Tue Oct 11 16:28:50 2005
New Revision: 312978

URL: http://svn.apache.org/viewcvs?rev=312978&view=rev
Log:
* added a new BooleanDecoderException
* changed the BooleanDecoder class to use the newly created exception

Added:
    directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoderException.java
Modified:
    directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoder.java

Modified: directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoder.java?rev=312978&r1=312977&r2=312978&view=diff
==============================================================================
--- directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoder.java
(original)
+++ directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoder.java
Tue Oct 11 16:28:50 2005
@@ -43,13 +43,13 @@
      *
      * @throws DecoderException Thrown if the byte stream does not contains a boolean
      */
-    public static boolean parse( Value value ) throws DecoderException
+    public static boolean parse( Value value ) throws BooleanDecoderException
     {
         byte[] bytes  = value.getData();
 
         if ( bytes.length != 1 )
         {
-            throw new DecoderException(
+            throw new BooleanDecoderException(
                 "The value is not 1 byte long. This is not allowed for a boolean" );
         }
 

Added: directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoderException.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoderException.java?rev=312978&view=auto
==============================================================================
--- directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoderException.java
(added)
+++ directory/asn1/trunk/ber-new/src/java/main/org/apache/asn1new/util/BooleanDecoderException.java
Tue Oct 11 16:28:50 2005
@@ -0,0 +1,44 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+
+package org.apache.asn1new.util;
+
+/**
+ * Thrown when a BooleanDecoderException has encountered a failure condition during a decode.

+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class BooleanDecoderException extends Exception {
+
+    /**
+     * Declares the Serial Version Uid.
+     * 
+     * @see <a href="http://c2.com/cgi/wiki?AlwaysDeclareSerialVersionUid">Always Declare
Serial Version Uid</a>
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Creates a BooleanDecoderException
+     * 
+     * @param pMessage A message with meaning to a human
+     */
+    public BooleanDecoderException(String pMessage) {
+        super(pMessage);
+    }
+
+}  
+



Mime
View raw message