avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/collections/src/java/org/apache/avalon/excalibur/collections BufferOverflowException.java BufferUnderflowException.java
Date Fri, 29 Mar 2002 07:26:26 GMT
jefft       02/03/28 23:26:26

  Modified:    collections/src/java/org/apache/avalon/excalibur/collections
                        BufferOverflowException.java
                        BufferUnderflowException.java
  Log:
  Remove the dependency on framework.
  
  Done by not subclassing CascadingRuntimeException and reimplementing it's
  getCause() method. Note: this will break backards-compatibility if users are
  downcasting these exceptions (can't imagine why).
  
  Revision  Changes    Path
  1.2       +24 -6     jakarta-avalon-excalibur/collections/src/java/org/apache/avalon/excalibur/collections/BufferOverflowException.java
  
  Index: BufferOverflowException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/collections/src/java/org/apache/avalon/excalibur/collections/BufferOverflowException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BufferOverflowException.java	20 Dec 2001 18:28:33 -0000	1.1
  +++ BufferOverflowException.java	29 Mar 2002 07:26:26 -0000	1.2
  @@ -7,24 +7,42 @@
    */
   package org.apache.avalon.excalibur.collections;
   
  -import org.apache.avalon.framework.CascadingRuntimeException;
  -
   /**
    * The BufferOverflowException is used when the buffer's capacity has been
    * exceeded.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  + * @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
    */
  -public class BufferOverflowException extends CascadingRuntimeException
  +public class BufferOverflowException extends RuntimeException
   {
  +    private final Throwable     m_throwable;
   
  +    /** Construct a new BufferOverflowException.
  +     * @param message The detail message for this exception.
  +     */
       public BufferOverflowException( String message )
       {
  -        super( message, null );
  +        this( message, null );
       }
   
  +    /** Construct a new BufferOverflowException.
  +     * @param message The detail message for this exception.
  +     * @param throwable the root cause of the exception
  +     */
       public BufferOverflowException( String message, Throwable exception )
       {
  -        super( message, exception );
  +        super( message );
  +        m_throwable = exception;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +25 -7     jakarta-avalon-excalibur/collections/src/java/org/apache/avalon/excalibur/collections/BufferUnderflowException.java
  
  Index: BufferUnderflowException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/collections/src/java/org/apache/avalon/excalibur/collections/BufferUnderflowException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BufferUnderflowException.java	20 Dec 2001 18:28:33 -0000	1.1
  +++ BufferUnderflowException.java	29 Mar 2002 07:26:26 -0000	1.2
  @@ -7,23 +7,41 @@
    */
   package org.apache.avalon.excalibur.collections;
   
  -import org.apache.avalon.framework.CascadingRuntimeException;
  -
   /**
  - * The BufferOverflowException is used when the buffer is already empty
  + * The BufferUnderflowException is used when the buffer is already empty
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  + * @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
    */
  -public class BufferUnderflowException extends CascadingRuntimeException
  +public class BufferUnderflowException extends RuntimeException
   {
  +    private final Throwable     m_throwable;
   
  +    /** Construct a new BufferUnderflowException.
  +     * @param message The detail message for this exception.
  +     */
       public BufferUnderflowException( String message )
       {
  -        super( message, null );
  +        this( message, null );
       }
   
  +    /** Construct a new BufferUnderflowException.
  +     * @param message The detail message for this exception.
  +     * @param throwable the root cause of the exception
  +     */
       public BufferUnderflowException( String message, Throwable exception )
       {
  -        super( message, exception );
  +        super( message );
  +        m_throwable = exception;
  +    }
  +
  +    /**
  +     * Retrieve root cause of the exception.
  +     *
  +     * @return the root cause
  +     */
  +    public final Throwable getCause()
  +    {
  +        return m_throwable;
       }
  -}
  \ No newline at end of file
  +}
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message