# HG changeset patch # User asaha # Date 1415294318 28800 # Node ID a8bd13c4c34dbff50f8fd7a6568acc65f9a50618 # Parent f910cbf0412383f8f383b736d8d86d4e8d9b7e18# Parent 45193c5ae26d67cd3dc6961506d8c06803ff646c Merge diff -r f910cbf04123 -r a8bd13c4c34d .hgtags --- a/.hgtags Wed Nov 05 15:38:04 2014 -0800 +++ b/.hgtags Thu Nov 06 09:18:38 2014 -0800 @@ -341,6 +341,7 @@ 60ee8e1e63aee861ea7606c5825c15209bb10aa2 jdk8u31-b04 e4e3070ba39416ea1f20a6583276117c5498466f jdk8u31-b05 90cd67a6b6e5e4db93155cc0260a94b55b35bc74 jdk8u31-b06 +06807f9a68358f9684ab59b249760ba2b47cc07b jdk8u31-b07 31d43d250c836c13fcc87025837783788c5cd0de jdk8u40-b00 262fb5353ffa661f88b4a9cf2581fcad8c2a43f7 jdk8u40-b01 8043f77ef8a4ded9505269a356c4e2f4f9604cd9 jdk8u40-b02 diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java --- a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java Thu Nov 06 09:18:38 2014 -0800 @@ -43,6 +43,8 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -197,7 +199,15 @@ static { - QName[] qnames = (System.getProperty(MAP_ANYURI_TO_URI) == null) ? new QName[] { + String MAP_ANYURI_TO_URI_VALUE = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public String run() { + return System.getProperty(MAP_ANYURI_TO_URI); + } + } + ); + QName[] qnames = (MAP_ANYURI_TO_URI_VALUE == null) ? new QName[] { createXS("string"), createXS("anySimpleType"), createXS("normalizedString"), @@ -310,7 +320,7 @@ return v.toExternalForm(); } }); - if (System.getProperty(MAP_ANYURI_TO_URI) == null) { + if (MAP_ANYURI_TO_URI_VALUE == null) { secondaryList.add( new StringImpl(URI.class, createXS("string")) { public URI parse(CharSequence text) throws SAXException { @@ -774,17 +784,18 @@ } }); primaryList.add( - new StringImpl(BigDecimal.class, - createXS("decimal") + new StringImpl(BigDecimal.class, + createXS("decimal") ) { - public BigDecimal parse(CharSequence text) { - return DatatypeConverterImpl._parseDecimal(text.toString()); + public BigDecimal parse(CharSequence text) { + return DatatypeConverterImpl._parseDecimal(text.toString()); + } + + public String print(BigDecimal v) { + return DatatypeConverterImpl._printDecimal(v); + } } - - public String print(BigDecimal v) { - return DatatypeConverterImpl._printDecimal(v); - } - }); + ); primaryList.add( new StringImpl(QName.class, createXS("QName") @@ -812,7 +823,7 @@ w.getNamespaceContext().declareNamespace(v.getNamespaceURI(),v.getPrefix(),false); } }); - if (System.getProperty(MAP_ANYURI_TO_URI) != null) { + if (MAP_ANYURI_TO_URI_VALUE != null) { primaryList.add( new StringImpl(URI.class, createXS("anyURI")) { public URI parse(CharSequence text) throws SAXException { @@ -830,16 +841,17 @@ }); } primaryList.add( - new StringImpl(Duration.class, createXS("duration")) { - public String print(Duration duration) { - return duration.toString(); + new StringImpl(Duration.class, createXS("duration")) { + public String print(Duration duration) { + return duration.toString(); + } + + public Duration parse(CharSequence lexical) { + TODO.checkSpec("JSR222 Issue #42"); + return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString()); + } } - - public Duration parse(CharSequence lexical) { - TODO.checkSpec("JSR222 Issue #42"); - return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString()); - } - }); + ); primaryList.add( new StringImpl(Void.class) { // 'void' binding isn't defined by the spec, but when the JAX-RPC processes user-defined diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -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); diff -r f910cbf04123 -r a8bd13c4c34d 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 Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java Thu Nov 06 09:18:38 2014 -0800 @@ -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 @@ -25,8 +25,10 @@ package com.sun.xml.internal.bind.v2.util; -import com.sun.xml.internal.bind.Util; import com.sun.xml.internal.bind.v2.Messages; + +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.XMLConstants; @@ -43,8 +45,6 @@ import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; -import static com.sun.xml.internal.bind.Util.getSystemProperty; - /** * Provides helper methods for creating properly configured XML parser * factory instances with namespace support turned on and configured for @@ -68,7 +68,14 @@ */ private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; - public static final boolean XML_SECURITY_DISABLED = Boolean.parseBoolean(getSystemProperty(DISABLE_XML_SECURITY)); + private static final boolean XML_SECURITY_DISABLED = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Boolean run() { + return Boolean.getBoolean(DISABLE_XML_SECURITY); + } + } + ); private static boolean isXMLSecurityDisabled(boolean runtimeSetting) { return XML_SECURITY_DISABLED || runtimeSetting; diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -54,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"); + } } } ); @@ -72,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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java Thu Nov 06 09:18:38 2014 -0800 @@ -147,19 +147,12 @@ } public EndpointReference readEndpointReference(final Source eprInfoset) { - // EPR constructors are private, so we need privilege escalation. - // this unmarshalling can only access instances of a fixed, known set of classes, - // so doing that shouldn't introduce security vulnerability. - return AccessController.doPrivileged(new PrivilegedAction() { - public EndpointReference run() { - try { - Unmarshaller unmarshaller = eprjc.get().createUnmarshaller(); - return (EndpointReference) unmarshaller.unmarshal(eprInfoset); - } catch (JAXBException e) { - throw new WebServiceException("Error creating Marshaller or marshalling.", e); - } - } - }); + try { + Unmarshaller unmarshaller = eprjc.get().createUnmarshaller(); + return (EndpointReference) unmarshaller.unmarshal(eprInfoset); + } catch (JAXBException e) { + throw new WebServiceException("Error creating Marshaller or marshalling.", e); + } } public T getPort(EndpointReference endpointReference, Class clazz, WebServiceFeature... webServiceFeatures) { diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java Thu Nov 06 09:18:38 2014 -0800 @@ -54,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"); + } } } ); @@ -72,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); diff -r f910cbf04123 -r a8bd13c4c34d src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java Wed Nov 05 15:38:04 2014 -0800 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java Thu Nov 06 09:18:38 2014 -0800 @@ -63,6 +63,8 @@ import java.io.OutputStreamWriter; import java.io.Writer; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; @@ -84,12 +86,16 @@ private static final Logger LOGGER = Logger.getLogger(XmlUtil.class.getName()); - private static boolean XML_SECURITY_DISABLED; + private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.ws.disableXmlSecurity"; - static { - String disableXmlSecurity = System.getProperty("com.sun.xml.internal.ws.disableXmlSecurity"); - XML_SECURITY_DISABLED = disableXmlSecurity == null || !Boolean.valueOf(disableXmlSecurity); - } + private static boolean XML_SECURITY_DISABLED = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Boolean run() { + return Boolean.getBoolean(DISABLE_XML_SECURITY); + } + } + ); public static String getPrefix(String s) { int i = s.indexOf(':');