xsddoc/src/net/sf/xframe/ex ExceptionUtil.java,1.6,1.7

Kurt Riede <[email protected]> Thu, 03 Mar 2005 17:24:56 +0000
Newsgroups gmane.text.xml.xframe.xsddoc.devel
Message-ID <[email protected]>
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/ex
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14632/src/net/sf/xframe/ex

Modified Files:
	ExceptionUtil.java 
Log Message:
Logging changed to use a Listener interface instead of direct logging. A programatic user now can decide externaly how logging is done.

Index: ExceptionUtil.java
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/ex/ExceptionUtil.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ExceptionUtil.java	13 Dec 2004 13:22:13 -0000	1.6
--- ExceptionUtil.java	3 Mar 2005 17:24:54 -0000	1.7
***************
*** 197,199 ****
--- 197,214 ----
          return result;
      }
+ 
+     /**
+      * Returns the message of a throwable or the class name if the message is
+      * null or empty.
+      *
+      * @param t any throwable
+      * @return message or class name
+      */
+     public static String getMessage(final Throwable t) {
+         final String s = t.getMessage();
+         if (s == null || "".equals(s)) {
+             return t.getClass().getName();
+         }
+         return s;
+     }
  }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click