commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [math] Eliminating [lang] dependency
Date Sat, 10 Jul 2004 16:38:50 GMT
Thats Great! Thanks for all the time you've put in lately to get the 
library dependency free! :-)

-Mark

Phil Steitz wrote:

> For those keeping score, this change will make us runtime dependency 
> free :-)
> 
> Phil
> 
>>
>> Stephen
>>
>> ----- Original Message -----
>> From: "Henri Yandell" <bayard@generationjava.com>
>>
>>> Is using the same name as Throwable for getCause() wise?
>>>
>>> Won't this lead to times when you can compile on 1.3, and the code won't
>>> run on 1.4? (unsure, but it seems likely to me).
>>>
>>> I'd suggest getThrowable as with Lang. You know it's supported by the
>>> reflection Utils in Lang if someone puts them together, and it keeps
>>> things standard.
>>>
>>> Hen
>>>
>>> On Fri, 9 Jul 2004, Mark R. Diggory wrote:
>>>
>>>
>>>> I suspect that would just look like this, is this adequate for our
>>
>>
>> needs?
>>
>>>> -Mark
>>>>
>>>> /**
>>>>  * A generic exception indicating problems in the math package.
>>>>  * @version $Revision: 1.16 $ $Date: 2004/06/02 00:05:28 $
>>>>  */
>>>> public class MathException extends Exception implements Serializable {
>>>>
>>>>     /** Serializable version identifier */
>>>>     static final long serialVersionUID = -8594613561393443827L;
>>>>
>>>>     private Throwable cause = null;
>>>>
>>>>     /**
>>>>      * Constructs a MathException
>>>>      */
>>>>     public MathException() {
>>>>         super();
>>>>     }
>>>>
>>>>     /**
>>>>      * Create an exception with a given error message.
>>>>      * @param message message describing the problem
>>>>      */
>>>>     public MathException(final String message) {
>>>>         super(message);
>>>>     }
>>>>
>>>>     /**
>>>>      * Create an exception with a given error message and root cause.
>>>>      * @param message message describing the problem
>>>>      * @param throwable caught exception causing this problem
>>>>      */
>>>>     public MathException(final String message, final Throwable
>>
>>
>> throwable) {
>>
>>>>         super(message, throwable);
>>>>         this.cause = throwable;
>>>>     }
>>>>
>>>>     /**
>>>>      * Create an exception with a given root cause.
>>>>      * @param throwable caught exception causing this problem
>>>>      */
>>>>     public MathException(final Throwable throwable) {
>>>>         super();
>>>>         this.cause = throwable;
>>>>     }
>>>>
>>>>
>>>>     /* (non-Javadoc)
>>>>      * @see java.lang.Throwable#getCause()
>>>>      */
>>>>     public Throwable getCause() {
>>>>         return cause;
>>>>     }
>>>>
>>>>     /* (non-Javadoc)
>>>>      * @see java.lang.Throwable#printStackTrace()
>>>>      */
>>>>     public void printStackTrace() {
>>>>         super.printStackTrace();
>>>>
>>>>         if(cause != null)
>>>>             cause.printStackTrace();
>>>>     }
>>>>
>>>>     /* (non-Javadoc)
>>>>      * @see java.lang.Throwable#printStackTrace(java.io.PrintStream)
>>>>      */
>>>>     public void printStackTrace(PrintStream s) {
>>>>         super.printStackTrace(s);
>>>>
>>>>         if(cause != null){
>>>>             s.print("\n\nCaused By:\n\n");
>>>>             cause.printStackTrace(s);
>>>>         }
>>>>     }
>>>>
>>>>     /* (non-Javadoc)
>>>>      * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter)
>>>>      */
>>>>     public void printStackTrace(PrintWriter s) {
>>>>         super.printStackTrace(s);
>>>>
>>>>         if(cause != null){
>>>>             s.print("\n\nCaused By:\n\n");
>>>>             cause.printStackTrace(s);
>>>>         }
>>>>     }
>>>>
>>>> }
>>>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message