jdk/src/share/classes/com/sun/servicetag/BrowserSupport.java
changeset 10419 12c063b39232
parent 5506 202f599c92aa
child 14342 8435a30053c1
--- a/jdk/src/share/classes/com/sun/servicetag/BrowserSupport.java	Tue Aug 30 14:41:12 2011 +0100
+++ b/jdk/src/share/classes/com/sun/servicetag/BrowserSupport.java	Tue Aug 30 11:53:11 2011 -0700
@@ -77,9 +77,7 @@
                         result = (Boolean) isDesktopSupportedMethod.invoke(null);
                     } catch (IllegalAccessException e) {
                         // should never reach here
-                        InternalError x =
-                            new InternalError("Desktop.getDesktop() method not found");
-                        x.initCause(e);
+                        throw new InternalError("Desktop.getDesktop() method not found", e);
                     } catch (InvocationTargetException e) {
                         // browser not supported
                         if (Util.isVerbose()) {
@@ -101,28 +99,10 @@
                 result = (Boolean) isSupportedMethod.invoke(desktopObj, browseField.get(null));
                 supported = result.booleanValue();
             }
-        } catch (ClassNotFoundException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
-        } catch (NoSuchMethodException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
-        } catch (NoSuchFieldException e) {
-            // browser not supported
-            if (Util.isVerbose()) {
-                e.printStackTrace();
-            }
         } catch (IllegalAccessException e) {
             // should never reach here
-            InternalError x =
-                    new InternalError("Desktop.getDesktop() method not found");
-            x.initCause(e);
-            throw x;
-        } catch (InvocationTargetException e) {
+            throw new InternalError("Desktop.getDesktop() method not found", e);
+        } catch (ReflectiveOperationException e) {
             // browser not supported
             if (Util.isVerbose()) {
                 e.printStackTrace();
@@ -175,10 +155,7 @@
             browseMethod.invoke(desktop, uri);
         } catch (IllegalAccessException e) {
             // should never reach here
-            InternalError x =
-                new InternalError("Desktop.getDesktop() method not found");
-            x.initCause(e);
-                throw x;
+            throw new InternalError("Desktop.getDesktop() method not found", e);
         } catch (InvocationTargetException e) {
             Throwable x = e.getCause();
             if (x != null) {