Mercurial > hg > openjdk > jdk7u > jaxws
changeset 1023:c99e49a9c2bf jdk7u76-b07
Merge
author | asaha |
---|---|
date | Mon, 03 Nov 2014 12:24:02 -0800 |
parents | bc07693ddea8 (current diff) b85627d6afbb (diff) |
children | e78c30040601 |
files | .hgtags |
diffstat | 10 files changed, 117 insertions(+), 132 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Mon Oct 27 12:41:24 2014 -0700 +++ b/.hgtags Mon Nov 03 12:24:02 2014 -0800 @@ -534,6 +534,7 @@ f1266833b5a07aa84d5da263f4a18503838286f4 jdk7u75-b04 bfe594779717071439b94ddc771117eedb442a25 jdk7u75-b05 b700cddd5754a82fca4f5465116fbba516a96667 jdk7u75-b06 +781d7a0230eef7cbef89bb32bc0d722730c198e3 jdk7u75-b07 5d60eecdd6b881856ddfc34e0d34f3072575662a jdk7u76-b00 9fed28dcccaafd49f9a4b2aee30b2babc97d4a93 jdk7u76-b01 7e479fddbf5d7b7840319a44d9e72562d7cfd83b jdk7u76-b02
--- a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java Mon Nov 03 12:24:02 2014 -0800 @@ -54,17 +54,21 @@ 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"); + } } } ); @@ -72,16 +76,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java Mon Nov 03 12:24:02 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<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"); + } } } ); @@ -72,16 +75,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java Mon Nov 03 12:24:02 2014 -0800 @@ -40,6 +40,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; @@ -194,8 +196,15 @@ static { - QName[] qnames = (System.getProperty(MAP_ANYURI_TO_URI) == null) ? new QName[] { - createXS("string"), + String MAP_ANYURI_TO_URI_VALUE = AccessController.doPrivileged( + new PrivilegedAction<String>() { + @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"), createXS("anyURI"), @@ -307,7 +316,7 @@ return v.toExternalForm(); } }); - if (System.getProperty(MAP_ANYURI_TO_URI) == null) { + if (MAP_ANYURI_TO_URI_VALUE == null) { secondaryList.add( new StringImpl<URI>(URI.class, createXS("string")) { public URI parse(CharSequence text) throws SAXException { @@ -771,17 +780,18 @@ } }); primaryList.add( - new StringImpl<BigDecimal>(BigDecimal.class, - createXS("decimal") + new StringImpl<BigDecimal>(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>(QName.class, createXS("QName") @@ -809,7 +819,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>(URI.class, createXS("anyURI")) { public URI parse(CharSequence text) throws SAXException { @@ -827,16 +837,17 @@ }); } primaryList.add( - new StringImpl<Duration>(Duration.class, createXS("duration")) { - public String print(Duration duration) { - return duration.toString(); - } + new StringImpl<Duration>(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>(Void.class) { // 'void' binding isn't defined by the spec, but when the JAX-RPC processes user-defined
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java Mon Nov 03 12:24:02 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<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"); + } } } ); @@ -72,16 +75,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Mon Nov 03 12:24:02 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<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"); + } } } ); @@ -72,16 +75,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java Mon Nov 03 12:24:02 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<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"); + } } } ); @@ -72,16 +75,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java Mon Nov 03 12:24:02 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<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"); + } } } ); @@ -72,16 +75,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java Mon Nov 03 12:24:02 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<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"); + } } } ); @@ -72,16 +75,10 @@ //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);
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java Mon Oct 27 12:41:24 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java Mon Nov 03 12:24:02 2014 -0800 @@ -139,19 +139,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<EndpointReference>() { - 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> T getPort(EndpointReference endpointReference, Class<T> clazz, WebServiceFeature... webServiceFeatures) {