jdk/src/share/classes/sun/management/Agent.java
changeset 11530 a9d059c15b80
parent 5506 202f599c92aa
child 11991 800d0ff7b043
--- a/jdk/src/share/classes/sun/management/Agent.java	Tue Jan 17 14:10:04 2012 +0000
+++ b/jdk/src/share/classes/sun/management/Agent.java	Tue Jan 17 15:55:40 2012 -0800
@@ -216,11 +216,8 @@
                     adaptorClass.getMethod("initialize",
                         String.class, Properties.class);
             initializeMethod.invoke(null,snmpPort,props);
-        } catch (ClassNotFoundException x) {
-            // The SNMP packages are not present: throws an exception.
-            throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x);
-        } catch (NoSuchMethodException x) {
-            // should not happen...
+        } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException x) {
+            // snmp runtime doesn't exist - initialization fails
             throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x);
         } catch (InvocationTargetException x) {
             final Throwable cause = x.getCause();
@@ -230,9 +227,6 @@
                 throw (Error) cause;
             // should not happen...
             throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,cause);
-        } catch (IllegalAccessException x) {
-            // should not happen...
-            throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x);
         }
     }
 
@@ -273,8 +267,8 @@
                 } catch (IOException e) {
                     error(CONFIG_FILE_CLOSE_FAILED, fname);
                 }
-            }
-        }
+             }
+         }
     }
 
     public static void startAgent() throws Exception {
@@ -309,7 +303,7 @@
                 // invoke the premain(String args) method
                 Class<?> clz = ClassLoader.getSystemClassLoader().loadClass(cname);
                 Method premain = clz.getMethod("premain",
-                                               new Class[] { String.class });
+                                               new Class<?>[] { String.class });
                 premain.invoke(null, /* static */
                                new Object[] { args });
             } catch (ClassNotFoundException ex) {