com.sun.jdmk.defaults
Class Utils

java.lang.Object
  extended bycom.sun.jdmk.defaults.Utils

public class Utils
extends Object


Constructor Summary
Utils()
           
 
Method Summary
static Throwable getCause(Throwable t)
          Returns the cause field of a Throwable object.
static Throwable initCause(Throwable t, Throwable cause)
          Init the cause field of a Throwable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

initCause

public static Throwable initCause(Throwable t,
                                  Throwable cause)
Init the cause field of a Throwable object. The cause field is set only if t has an Throwable.initCause(Throwable) method (JDK Version >= 1.4)

Parameters:
t - Throwable on which the cause must be set.
cause - The cause to set on t.
Returns:
t with or without the cause field set.

getCause

public static Throwable getCause(Throwable t)
Returns the cause field of a Throwable object. The cause field can be got only if t has an Throwable.getCause() method (JDK Version >= 1.4)

Parameters:
t - Throwable on which the cause must be set.
Returns:
the cause if getCause() succeeded and the got value is not null, otherwise return the t.

FCS Release
jdmk-5_1-b34.2 2005.11.29_16:24:00_MET

Copyright 1998-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.