减少重复代码

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@449 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-07-15 09:31:25 +00:00
parent 777832ac03
commit 49646878a2
5 changed files with 24 additions and 36 deletions
@@ -74,8 +74,7 @@ public final class JMXUtils {
public static CompositeType getThrowableCompositeType() throws JMException {
if (THROWABLE_COMPOSITE_TYPE == null) {
THROWABLE_COMPOSITE_TYPE = new CompositeType("Throwable", "Throwable", THROWABLE_COMPOSITE_INDEX_NAMES, THROWABLE_COMPOSITE_INDEX_DESCRIPTIONS,
THROWABLE_COMPOSITE_INDEX_TYPES);
THROWABLE_COMPOSITE_TYPE = new CompositeType("Throwable", "Throwable", THROWABLE_COMPOSITE_INDEX_NAMES, THROWABLE_COMPOSITE_INDEX_DESCRIPTIONS, THROWABLE_COMPOSITE_INDEX_TYPES);
}
return THROWABLE_COMPOSITE_TYPE;
@@ -91,10 +90,7 @@ public final class JMXUtils {
map.put("class", error.getClass().getName());
map.put("message", error.getMessage());
StringWriter buf = new StringWriter();
error.printStackTrace(new PrintWriter(buf));
map.put("stackTrace", buf.toString());
map.put("stackTrace", JdbcUtils.getStackTrace(error));
return new CompositeDataSupport(getThrowableCompositeType(), map);
}