|
8 | 8 | import javax.annotation.Nullable; |
9 | 9 | import java.io.*; |
10 | 10 | import java.lang.instrument.Instrumentation; |
| 11 | +import java.lang.reflect.InvocationTargetException; |
11 | 12 | import java.lang.reflect.Method; |
12 | 13 | import java.text.SimpleDateFormat; |
13 | 14 | import java.util.*; |
@@ -79,7 +80,7 @@ public static void agentmain(@Nonnull String agentArgument) throws Exception { |
79 | 80 | if (filePrinter != null) { |
80 | 81 | try { |
81 | 82 | filePrinter.close(); |
82 | | - } catch (Throwable e) { |
| 83 | + } catch (Exception e) { |
83 | 84 | // do nothing! |
84 | 85 | } |
85 | 86 | } |
@@ -164,7 +165,7 @@ private static boolean isDcmAgentSupressExceptionStack() { |
164 | 165 | return "true".equalsIgnoreCase(supressException); |
165 | 166 | } |
166 | 167 |
|
167 | | - private static Object invokeAction(String action, String[] arguments) throws Exception { |
| 168 | + private static Object invokeAction(String action, String[] arguments) throws InvocationTargetException, IllegalAccessException { |
168 | 169 | Method method = action2Method.get(action); |
169 | 170 |
|
170 | 171 | final Class<?>[] parameterTypes = method.getParameterTypes(); |
@@ -248,7 +249,7 @@ private static void printDnsCacheEntry(DnsCacheEntry entry, PrintWriter writer) |
248 | 249 | private static volatile Map<String, Method> action2Method; |
249 | 250 | private static volatile ArrayList<String> actionList; |
250 | 251 |
|
251 | | - private static synchronized void initAction2Method() throws Exception { |
| 252 | + private static synchronized void initAction2Method() throws NoSuchMethodException { |
252 | 253 | if (action2Method != null) return; |
253 | 254 |
|
254 | 255 | Map<String, Method> map = new LinkedHashMap<String, Method>(); |
|
0 commit comments