diff -r e044bd1da6b8 -r a14efa699f0f src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Mon Oct 20 23:05:00 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Fri Oct 24 15:02:28 2014 +0200 @@ -38,6 +38,9 @@ /** * Utils class. + * + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. + * * Has *package private* access to avoid inappropriate usage. */ final class Utils { @@ -51,17 +54,20 @@ static { // we statically initializing REFLECTION_NAVIGATOR property try { - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); - //noinspection unchecked - final Method getInstance = refNav.getDeclaredMethod("getInstance"); + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); // requires accessClassInPackage privilege - AccessController.doPrivileged( - new PrivilegedAction() { + final Method getInstance = AccessController.doPrivileged( + new PrivilegedAction() { @Override - public Object run() { - getInstance.setAccessible(true); - return null; + public Method run() { + try { + Method getInstance = refNav.getDeclaredMethod("getInstance"); + getInstance.setAccessible(true); + return getInstance; + } catch (NoSuchMethodException e) { + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); + } } } ); @@ -69,16 +75,10 @@ //noinspection unchecked REFLECTION_NAVIGATOR = (Navigator) getInstance.invoke(null); } catch (ClassNotFoundException e) { - e.printStackTrace(); throw new IllegalStateException("Can't find ReflectionNavigator class"); } catch (InvocationTargetException e) { - e.printStackTrace(); throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); } catch (IllegalAccessException e) { - e.printStackTrace(); throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); } catch (SecurityException e) { LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);