diff options
author | Denis S. Fokin <Denis.Fokin@gmail.com> | 2015-10-29 13:37:00 +0300 |
---|---|---|
committer | Denis S. Fokin <Denis.Fokin@gmail.com> | 2015-10-29 13:37:00 +0300 |
commit | 9389123be60012b8e9716416906a3fa1493ccee9 (patch) | |
tree | 142754c23c6463201f7cdc87f0a66399d191cefa /src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java | |
parent | 949e8d3d0130ce1690e6a465cb32edcc9e2e7906 (diff) | |
parent | 5f1c2b6af630c8807f51a2b69d032769cb846a75 (diff) | |
download | jdk8u_jaxws-9389123be60012b8e9716416906a3fa1493ccee9.tar.gz |
Merge with default before merge with jdk8u60
--HG--
branch : 8u40-verified-fixes
Diffstat (limited to 'src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java')
-rw-r--r-- | src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java index 0b9601fd..ad94478f 100644 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java @@ -38,6 +38,9 @@ import java.util.logging.Logger; /** * 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 @@ final class Utils { 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<Object>() { + final Method getInstance = AccessController.doPrivileged( + new PrivilegedAction<Method>() { @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 @@ final class Utils { //noinspection unchecked REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) 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); |