admin@glassfish.java.net

Re: com.sun.enterprise.util.ExceptionUtil.java

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Mon, 30 Aug 2010 13:51:00 -0700

Joe Di Pol wrote on 08/30/10 01:13 PM:
>
> I'd like to use a method in org.glassfish.admin.amx.util.ExceptionUtil.java
> in a remote command but it seems wrong to add a dependency on AMX.
> It's a trivial method, getRootCause(), but it seems silly to duplicate
> it in my private code.
>
> So I'd like to create a new file:
>
> com.sun.enterprise.util.ExceptionUtil.java
>
> that contains a subset of:
>
> org.glassfish.admin.amx.util.ExceptionUtil.java
>
> Is that OK?

If you look around, you'll probably find lots of other methods that
could be added to such a class.

I support creating a common ExceptionUtil class. You can have the
existing AMX class subclass it (although I think FindBugs may complain
about that).

The getRootCause method could be implemented more efficiently while
you're there... :-)