src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java

changeset 721
06807f9a6835
parent 567
7d8cd27f1543
child 760
e530533619ec
     1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java	Mon Oct 27 12:57:38 2014 -0700
     1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java	Fri Oct 24 15:02:28 2014 +0200
     1.3 @@ -54,17 +54,20 @@
     1.4  
     1.5      static { // we statically initializing REFLECTION_NAVIGATOR property
     1.6          try {
     1.7 -            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
     1.8 -            //noinspection unchecked
     1.9 -            final Method getInstance = refNav.getDeclaredMethod("getInstance");
    1.10 +            final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
    1.11  
    1.12              // requires accessClassInPackage privilege
    1.13 -            AccessController.doPrivileged(
    1.14 -                    new PrivilegedAction<Object>() {
    1.15 +            final Method getInstance = AccessController.doPrivileged(
    1.16 +                    new PrivilegedAction<Method>() {
    1.17                          @Override
    1.18 -                        public Object run() {
    1.19 -                            getInstance.setAccessible(true);
    1.20 -                            return null;
    1.21 +                        public Method run() {
    1.22 +                            try {
    1.23 +                                Method getInstance = refNav.getDeclaredMethod("getInstance");
    1.24 +                                getInstance.setAccessible(true);
    1.25 +                                return getInstance;
    1.26 +                            } catch (NoSuchMethodException e) {
    1.27 +                                throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
    1.28 +                            }
    1.29                          }
    1.30                      }
    1.31              );
    1.32 @@ -72,16 +75,10 @@
    1.33              //noinspection unchecked
    1.34              REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
    1.35          } catch (ClassNotFoundException e) {
    1.36 -            e.printStackTrace();
    1.37              throw new IllegalStateException("Can't find ReflectionNavigator class");
    1.38          } catch (InvocationTargetException e) {
    1.39 -            e.printStackTrace();
    1.40              throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
    1.41 -        } catch (NoSuchMethodException e) {
    1.42 -            e.printStackTrace();
    1.43 -            throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
    1.44          } catch (IllegalAccessException e) {
    1.45 -            e.printStackTrace();
    1.46              throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
    1.47          } catch (SecurityException e) {
    1.48              LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);

mercurial