commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/exception NestableDelegate.java
Date Mon, 26 Aug 2002 06:02:44 GMT
This rename was more to be clear about what the private Throwable
field it is _not_ (it could have a better name yet to reflect what it
is).

dlr@apache.org writes:

> dlr         2002/08/25 12:09:38
> 
>   Modified:    lang/src/java/org/apache/commons/lang/exception
>                         NestableDelegate.java
>   Log:
>   Renamed "cause" private field to "nestable" to better reflect what it
>   is.
>   
>   Revision  Changes    Path
>   1.8       +16 -15    jakarta-commons/lang/src/java/org/apache/commons/lang/exception/NestableDelegate.java
>   
>   Index: NestableDelegate.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/exception/NestableDelegate.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -u -r1.7 -r1.8
>   --- NestableDelegate.java	25 Aug 2002 19:02:49 -0000	1.7
>   +++ NestableDelegate.java	25 Aug 2002 19:09:38 -0000	1.8
>   @@ -77,23 +77,24 @@
>            + "constructor must extend java.lang.Throwable";
>    
>        /**
>   -     * Holds the reference to the exception or error that caused this
>   -     * exception to be thrown.
>   +     * Holds the reference to the exception or error that we're
>   +     * wrapping (which must be a {@link
>   +     * org.apache.commons.lang.exception.Nestable} implementation).
>         */
>   -    private Throwable cause = null;
>   +    private Throwable nestable = null;
>    
>        /**
>         * Constructs a new <code>NestableDelegate</code> instance to manage
the
>         * specified <code>Nestable</code>.
>         *
>   -     * @param cause the Nestable implementation (<i>must</i> extend
>   +     * @param nestable the Nestable implementation (<i>must</i> extend
>         * {@link java.lang.Throwable})
>         */
>   -    NestableDelegate(Nestable cause) // package
>   +    NestableDelegate(Nestable nestable) // package
>        {
>   -        if (cause instanceof Throwable)
>   +        if (nestable instanceof Throwable)
>            {
>   -            this.cause = (Throwable) cause;
>   +            this.nestable = (Throwable) nestable;
>            }
>            else
>            {
>   @@ -146,7 +147,7 @@
>                msg.append(baseMsg);
>            }
>    
>   -        Throwable nestedCause = ExceptionUtils.getCause(this.cause);
>   +        Throwable nestedCause = ExceptionUtils.getCause(this.nestable);
>            if (nestedCause != null)
>            {
>                String causeMsg = nestedCause.getMessage();
>   @@ -201,7 +202,7 @@
>        {
>            if(index == 0)
>            {
>   -            return this.cause;
>   +            return this.nestable;
>            }
>            Throwable[] throwables = this.getThrowables();
>            return throwables[index];
>   @@ -215,7 +216,7 @@
>         */
>        int getThrowableCount() // package
>        {
>   -        return ExceptionUtils.getThrowableCount(this.cause);
>   +        return ExceptionUtils.getThrowableCount(this.nestable);
>        }
>        
>        /**
>   @@ -227,7 +228,7 @@
>         */
>        Throwable[] getThrowables() // package
>        {
>   -        return ExceptionUtils.getThrowables(this.cause);
>   +        return ExceptionUtils.getThrowables(this.nestable);
>        }
>    
>        /**
>   @@ -247,7 +248,7 @@
>         */
>        int indexOfThrowable(Class type, int fromIndex) // package
>        {
>   -        return ExceptionUtils.indexOfThrowable(this.cause, type, fromIndex);
>   +        return ExceptionUtils.indexOfThrowable(this.nestable, type, fromIndex);
>        }
>        
>        /**
>   @@ -287,8 +288,8 @@
>        {
>            synchronized (out)
>            {
>   -            String[] st = getStackFrames(this.cause);
>   -            Throwable nestedCause = ExceptionUtils.getCause(this.cause);
>   +            String[] st = getStackFrames(this.nestable);
>   +            Throwable nestedCause = ExceptionUtils.getCause(this.nestable);
>                if (nestedCause != null)
>                {
>                    if (nestedCause instanceof Nestable)

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


Mime
View raw message