changeset 989:5f7126a46c68

Merge
author asaha
date Wed, 18 Jun 2014 13:57:06 -0700
parents 8bc5c8101f01 814a3f0bb130
children 637ce902aa58
files
diffstat 9 files changed, 175 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Apr 22 13:45:11 2014 +0100
+++ b/.hgtags	Wed Jun 18 13:57:06 2014 -0700
@@ -407,6 +407,7 @@
 a257072fc2aa482abd6ffa28e235dbe532af6d00 jdk7u55-b02
 2916fdfc475bf29bc702887bf5ba02df67c98916 jdk7u55-b03
 f4759b4547602b3bc865db8c5f356f46979c6389 jdk7u55-b04
+8a8dfdbc66149b89f804c5a50e4692c2520569ae jdk7u65-b00
 8a8dfdbc66149b89f804c5a50e4692c2520569ae jdk7u55-b05
 2696d6747826cea92a97b2d80be4a59ff99462bd jdk7u55-b06
 1ad971afe2b5db93420654fa65b23f827760fed7 jdk7u55-b07
@@ -420,6 +421,11 @@
 5d726bf8fedc1f10d250e980653315919b7602f2 jdk7u55-b30
 81d0f297557c4a876727cabeb2bfcdf066a1fc9d jdk7u55-b14
 2d103c97c9bd0b3357e6d5e2b5b9ffb64c271288 jdk7u55-b31
+b15b4084288fa4ea9caf7f6b4e79d164c77bb1d6 jdk7u55-b32
+efd71c6ca0832e894b7e1619111860062fa96458 jdk7u55-b33
+485d7912bc20775bda670ea2236c883366590dd7 jdk7u55-b34
+587be38f9a6d60fbefc92dbe9fbd4c83d579c680 jdk7u55-b35
+62332eaec2ff8fc8bece2a905554ac08e375a661 jdk7u55-b36
 cb5f95263f620967f5097c5ff8e0b27cfb9e8c44 jdk7u60-b00
 f675dfce1e61a6ed01732ae7cfbae941791cba74 jdk7u60-b01
 8a3b9e8492a5ac4e2e0c166dbfc5d058be244377 jdk7u60-b02
@@ -437,7 +443,39 @@
 43b5a7cf08e7ee018b1fa42a89510b4c381dc4c5 jdk7u60-b14
 d00389bf5439e5c42599604d2ebc909d26df8dcf jdk7u60-b15
 2fc16d3a321212abc0cc93462b22c4be7f693ab9 jdk7u60-b16
+b312ec543dc09db784e161eb89607d4afd4cab1e jdk7u60-b17
 b312ec543dc09db784e161eb89607d4afd4cab1e jdk7u60-b18
-b312ec543dc09db784e161eb89607d4afd4cab1e jdk7u60-b17
+23598a667bb89b57d5abab5b37781a0952e16cf9 jdk7u65-b01
 1d21eb9011a060c7761c9a8a53e69d58bbea4893 jdk7u60-b19
 39e67887a3b112bf74f84df2aac0f46c65bfb005 jdk7u60-b30
+dfc2c4b9b16bd2d68435ddc9bb12036982021844 jdk7u60-b31
+0e17943c39fadb810b4dd2e9ac732503b86043f4 jdk7u60-b32
+910559d7f754d8fd6ab80a627869877443358316 jdk7u60-b33
+8ac19021e6af5d92b46111a6c41430f36ccdb901 jdk7u65-b02
+a70d681bc273a110d10cf3c4f9b35b25ca6a600f jdk7u65-b03
+7cd17f96988509e99fbb71003aeb76d92b638fef jdk7u65-b04
+7bafb24c6466999bc08742b160d0e450bc12a2c5 jdk7u65-b05
+35b31c516cab0a81fa9d2a119ec101be3f5a2969 jdk7u65-b06
+eb89c1c30a93b1d43cbc1b7520bca46d31d0829a jdk7u65-b07
+d63ca1c5bdb9fb2e36ec4afda431c0d1dfdfc07c jdk7u65-b08
+e4cc1e93c6332c8463e75a25c3d735884d185259 jdk7u65-b09
+d10ec17267415303a71d358ae6202369db77ba96 jdk7u65-b10
+2f5dcee6d56b00551db21408ebad2ff2faad7c7a jdk7u65-b11
+f03350485cd388620981bb7e7faa2d1890d11a1b jdk7u65-b12
+471f883e9830d8341248b99da7c9cfab9fcc94d6 jdk7u65-b13
+11deffa2096f08dab69de13d4fcf361c6d252636 jdk7u65-b14
+39ad61a579fd824fbec1bec4e071376449ba8195 jdk7u65-b15
+198bf1acd262f2c16715d3be5e33d7b8de1e7776 jdk7u65-b16
+df4dc644fe344e973fc1692c28683eec8ba82600 jdk7u65-b17
+d63ca1c5bdb9fb2e36ec4afda431c0d1dfdfc07c jdk7u66-b00
+1dce52b208a9528266c26352e03e67ec0ddb4dd7 jdk7u66-b01
+04481967eff566b8a379a0315d2a3a255928d6ce jdk7u66-b09
+73d97ba8b2d94c904f2b087b9f28664eb19e9ce2 jdk7u66-b10
+7ecf8d9df00c185f381fa8cb92ea66fe1e5798ca jdk7u66-b11
+9ac1d99f712a04548d7e5d784f06c87e35023080 jdk7u66-b12
+f562dd8fb2b211a11b9a84849995d61b541723c3 jdk7u66-b13
+ae584331109f291e03af72cc9fcbbe5f8f789ab1 jdk7u66-b14
+36461c772d3101a8cb1eca16a9c81ed53218a4c9 jdk7u66-b15
+19ed8a653a3e8c6536fd1090c14f93e690eda7a3 jdk7u66-b16
+ea1e6f01f95c9a0984378643754d0f493bfa4484 jdk7u66-b17
+6092d0059338df25e82fbc69cc749b95e2565547 jdk7u71-b00
--- a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,14 +130,6 @@
     private final Map<TypeReference,Bridge> bridges = new LinkedHashMap<TypeReference,Bridge>();
 
     /**
-     * Shared instance of {@link TransformerFactory}.
-     * Lock before use, because a {@link TransformerFactory} is not thread-safe
-     * whereas {@link JAXBContextImpl} is.
-     * Lazily created.
-     */
-    private volatile static SAXTransformerFactory tf;
-
-    /**
      * Shared instance of {@link DocumentBuilder}.
      * Lock before use. Lazily created.
      */
@@ -702,13 +694,7 @@
      */
     static Transformer createTransformer() {
         try {
-            if (tf==null) {
-                synchronized(JAXBContextImpl.class) {
-                    if (tf==null) {
-                        tf = (SAXTransformerFactory)TransformerFactory.newInstance();
-                    }
-                }
-            }
+            SAXTransformerFactory tf = (SAXTransformerFactory)TransformerFactory.newInstance();
             return tf.newTransformer();
         } catch (TransformerConfigurationException e) {
             throw new Error(e); // impossible
@@ -720,13 +706,7 @@
      */
     public static TransformerHandler createTransformerHandler() {
         try {
-            if (tf==null) {
-                synchronized(JAXBContextImpl.class) {
-                    if (tf==null) {
-                        tf = (SAXTransformerFactory)TransformerFactory.newInstance();
-                    }
-                }
-            }
+            SAXTransformerFactory tf = (SAXTransformerFactory)TransformerFactory.newInstance();
             return tf.newTransformerHandler();
         } catch (TransformerConfigurationException e) {
             throw new Error(e); // impossible
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java	Tue Apr 22 13:45:11 2014 +0100
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java	Wed Jun 18 13:57:06 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -41,22 +43,32 @@
  *
  * Has *package private* access to avoid inappropriate usage.
  */
-/* package */ final class Utils {
+final class Utils {
 
     private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
 
     /**
      * static ReflectionNavigator field to avoid usage of reflection every time we use it.
      */
-    /* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+    static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
 
     static { // we statically initializing REFLECTION_NAVIGATOR property
-        Class refNav = null;
         try {
-            refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
+            Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
             //noinspection unchecked
-            Method getInstance = refNav.getDeclaredMethod("getInstance");
-            getInstance.setAccessible(true);
+            final Method getInstance = refNav.getDeclaredMethod("getInstance");
+
+            // requires accessClassInPackage privilege
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Object>() {
+                        @Override
+                        public Object run() {
+                            getInstance.setAccessible(true);
+                            return null;
+                        }
+                    }
+            );
+
             //noinspection unchecked
             REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
         } catch (ClassNotFoundException e) {