Wed, 21 Jan 2015 17:08:09 +0000
Merge
.hgtags | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Wed Dec 17 14:46:36 2014 -0800 1.2 +++ b/.hgtags Wed Jan 21 17:08:09 2015 +0000 1.3 @@ -312,6 +312,8 @@ 1.4 1277c0d492fd9253f1ea2730eb160953397bd939 jdk8u20-b24 1.5 1277c0d492fd9253f1ea2730eb160953397bd939 jdk8u20-b25 1.6 7025a2c10ea4116ce8f31bb1e305f732aa1025f0 jdk8u20-b26 1.7 +7053deda0ffd69046ef480b3595cf13451b477ec jdk8u20-b31 1.8 +2f39063fee48f96fe9cacf704ce30c6fc333ae73 jdk8u20-b32 1.9 efc85d318f4697f40bdd1f3757677be97f1758d9 jdk8u25-b00 1.10 a76779e1b0376650dfc29a1f3b14760f05e0fc6d jdk8u25-b01 1.11 3d31955043b9f1807c9d695c7b5d604d11c132cf jdk8u25-b02 1.12 @@ -331,6 +333,21 @@ 1.13 4570a7d00aa9bd3df028f52d6f9d8c434163b689 jdk8u25-b16 1.14 d47a47f961ee423ce03623098f62d79254c6f328 jdk8u25-b17 1.15 cb0ad90bfe3c497c7236c5480447c4bde110934f jdk8u25-b18 1.16 +a345282d661be80f2cdee3c43e12fbe01e7ff6d5 jdk8u25-b31 1.17 +3a676fe898c93ad3afcaa55a71da96455e5f230e jdk8u31-b00 1.18 +1c73ca9179f22d4a73d1a248a3254f891c71ee30 jdk8u31-b01 1.19 +c1f1ed28e0bb68d7536fb30bb6f1a3623816b12a jdk8u31-b02 1.20 +31893650acaf8935ad395d04cbc1575bada97622 jdk8u31-b03 1.21 +60ee8e1e63aee861ea7606c5825c15209bb10aa2 jdk8u31-b04 1.22 +e4e3070ba39416ea1f20a6583276117c5498466f jdk8u31-b05 1.23 +90cd67a6b6e5e4db93155cc0260a94b55b35bc74 jdk8u31-b06 1.24 +06807f9a68358f9684ab59b249760ba2b47cc07b jdk8u31-b07 1.25 +45193c5ae26d67cd3dc6961506d8c06803ff646c jdk8u31-b08 1.26 +9a310a2276f9a01822b3cfc91268a67cbaaafd0a jdk8u31-b09 1.27 +dd0467f3fe130884849ad8fb226d76f02b4cbde4 jdk8u31-b10 1.28 +497c783d228ed188d61964edd409794af3ad3e5c jdk8u31-b11 1.29 +959e8fca46155528c8147da69a7c49edfb002cb1 jdk8u31-b12 1.30 +9d0c737694ece23547c0a27dcd0ba6cbcdf577f2 jdk8u31-b13 1.31 31d43d250c836c13fcc87025837783788c5cd0de jdk8u40-b00 1.32 262fb5353ffa661f88b4a9cf2581fcad8c2a43f7 jdk8u40-b01 1.33 8043f77ef8a4ded9505269a356c4e2f4f9604cd9 jdk8u40-b02 1.34 @@ -351,4 +368,6 @@ 1.35 83c4d5aca2ff8fd0c6b2a7091018b71313371176 jdk8u40-b17 1.36 fa07311627d085f1307f55298f59463bcf55db02 jdk8u40-b18 1.37 c8b402c28fe51e25f3298e1266f2ae48bda8d3e0 jdk8u40-b19 1.38 +a21c4edfdf4402f027183ac8c8aac2db49df3b7d jdk8u40-b20 1.39 +16485a38b6bc762b363f4e439047486742fbcfcb jdk8u40-b21 1.40 c8b402c28fe51e25f3298e1266f2ae48bda8d3e0 jdk8u60-b00
2.1 --- a/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java Wed Dec 17 14:46:36 2014 -0800 2.2 +++ b/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/Utils.java Wed Jan 21 17:08:09 2015 +0000 2.3 @@ -38,6 +38,9 @@ 2.4 2.5 /** 2.6 * Utils class. 2.7 + * 2.8 + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. 2.9 + * 2.10 * Has *package private* access to avoid inappropriate usage. 2.11 */ 2.12 final class Utils { 2.13 @@ -51,17 +54,20 @@ 2.14 2.15 static { // we statically initializing REFLECTION_NAVIGATOR property 2.16 try { 2.17 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 2.18 - //noinspection unchecked 2.19 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 2.20 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 2.21 2.22 // requires accessClassInPackage privilege 2.23 - AccessController.doPrivileged( 2.24 - new PrivilegedAction<Object>() { 2.25 + final Method getInstance = AccessController.doPrivileged( 2.26 + new PrivilegedAction<Method>() { 2.27 @Override 2.28 - public Object run() { 2.29 - getInstance.setAccessible(true); 2.30 - return null; 2.31 + public Method run() { 2.32 + try { 2.33 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 2.34 + getInstance.setAccessible(true); 2.35 + return getInstance; 2.36 + } catch (NoSuchMethodException e) { 2.37 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 2.38 + } 2.39 } 2.40 } 2.41 ); 2.42 @@ -69,16 +75,10 @@ 2.43 //noinspection unchecked 2.44 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 2.45 } catch (ClassNotFoundException e) { 2.46 - e.printStackTrace(); 2.47 throw new IllegalStateException("Can't find ReflectionNavigator class"); 2.48 } catch (InvocationTargetException e) { 2.49 - e.printStackTrace(); 2.50 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 2.51 - } catch (NoSuchMethodException e) { 2.52 - e.printStackTrace(); 2.53 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 2.54 } catch (IllegalAccessException e) { 2.55 - e.printStackTrace(); 2.56 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 2.57 } catch (SecurityException e) { 2.58 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
3.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java Wed Dec 17 14:46:36 2014 -0800 3.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Utils.java Wed Jan 21 17:08:09 2015 +0000 3.3 @@ -38,6 +38,9 @@ 3.4 3.5 /** 3.6 * Utils class. 3.7 + * 3.8 + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. 3.9 + * 3.10 * Has *package private* access to avoid inappropriate usage. 3.11 */ 3.12 final class Utils { 3.13 @@ -51,17 +54,20 @@ 3.14 3.15 static { // we statically initializing REFLECTION_NAVIGATOR property 3.16 try { 3.17 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 3.18 - //noinspection unchecked 3.19 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 3.20 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 3.21 3.22 // requires accessClassInPackage privilege 3.23 - AccessController.doPrivileged( 3.24 - new PrivilegedAction<Object>() { 3.25 + final Method getInstance = AccessController.doPrivileged( 3.26 + new PrivilegedAction<Method>() { 3.27 @Override 3.28 - public Object run() { 3.29 - getInstance.setAccessible(true); 3.30 - return null; 3.31 + public Method run() { 3.32 + try { 3.33 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 3.34 + getInstance.setAccessible(true); 3.35 + return getInstance; 3.36 + } catch (NoSuchMethodException e) { 3.37 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 3.38 + } 3.39 } 3.40 } 3.41 ); 3.42 @@ -69,16 +75,10 @@ 3.43 //noinspection unchecked 3.44 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 3.45 } catch (ClassNotFoundException e) { 3.46 - e.printStackTrace(); 3.47 throw new IllegalStateException("Can't find ReflectionNavigator class"); 3.48 } catch (InvocationTargetException e) { 3.49 - e.printStackTrace(); 3.50 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 3.51 - } catch (NoSuchMethodException e) { 3.52 - e.printStackTrace(); 3.53 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 3.54 } catch (IllegalAccessException e) { 3.55 - e.printStackTrace(); 3.56 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 3.57 } catch (SecurityException e) { 3.58 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
4.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java Wed Dec 17 14:46:36 2014 -0800 4.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java Wed Jan 21 17:08:09 2015 +0000 4.3 @@ -43,6 +43,8 @@ 4.4 import java.net.URI; 4.5 import java.net.URISyntaxException; 4.6 import java.net.URL; 4.7 +import java.security.AccessController; 4.8 +import java.security.PrivilegedAction; 4.9 import java.util.ArrayList; 4.10 import java.util.Calendar; 4.11 import java.util.Collections; 4.12 @@ -197,7 +199,15 @@ 4.13 4.14 static { 4.15 4.16 - QName[] qnames = (System.getProperty(MAP_ANYURI_TO_URI) == null) ? new QName[] { 4.17 + String MAP_ANYURI_TO_URI_VALUE = AccessController.doPrivileged( 4.18 + new PrivilegedAction<String>() { 4.19 + @Override 4.20 + public String run() { 4.21 + return System.getProperty(MAP_ANYURI_TO_URI); 4.22 + } 4.23 + } 4.24 + ); 4.25 + QName[] qnames = (MAP_ANYURI_TO_URI_VALUE == null) ? new QName[] { 4.26 createXS("string"), 4.27 createXS("anySimpleType"), 4.28 createXS("normalizedString"), 4.29 @@ -310,7 +320,7 @@ 4.30 return v.toExternalForm(); 4.31 } 4.32 }); 4.33 - if (System.getProperty(MAP_ANYURI_TO_URI) == null) { 4.34 + if (MAP_ANYURI_TO_URI_VALUE == null) { 4.35 secondaryList.add( 4.36 new StringImpl<URI>(URI.class, createXS("string")) { 4.37 public URI parse(CharSequence text) throws SAXException { 4.38 @@ -774,17 +784,18 @@ 4.39 } 4.40 }); 4.41 primaryList.add( 4.42 - new StringImpl<BigDecimal>(BigDecimal.class, 4.43 - createXS("decimal") 4.44 + new StringImpl<BigDecimal>(BigDecimal.class, 4.45 + createXS("decimal") 4.46 ) { 4.47 - public BigDecimal parse(CharSequence text) { 4.48 - return DatatypeConverterImpl._parseDecimal(text.toString()); 4.49 + public BigDecimal parse(CharSequence text) { 4.50 + return DatatypeConverterImpl._parseDecimal(text.toString()); 4.51 + } 4.52 + 4.53 + public String print(BigDecimal v) { 4.54 + return DatatypeConverterImpl._printDecimal(v); 4.55 + } 4.56 } 4.57 - 4.58 - public String print(BigDecimal v) { 4.59 - return DatatypeConverterImpl._printDecimal(v); 4.60 - } 4.61 - }); 4.62 + ); 4.63 primaryList.add( 4.64 new StringImpl<QName>(QName.class, 4.65 createXS("QName") 4.66 @@ -812,7 +823,7 @@ 4.67 w.getNamespaceContext().declareNamespace(v.getNamespaceURI(),v.getPrefix(),false); 4.68 } 4.69 }); 4.70 - if (System.getProperty(MAP_ANYURI_TO_URI) != null) { 4.71 + if (MAP_ANYURI_TO_URI_VALUE != null) { 4.72 primaryList.add( 4.73 new StringImpl<URI>(URI.class, createXS("anyURI")) { 4.74 public URI parse(CharSequence text) throws SAXException { 4.75 @@ -830,16 +841,17 @@ 4.76 }); 4.77 } 4.78 primaryList.add( 4.79 - new StringImpl<Duration>(Duration.class, createXS("duration")) { 4.80 - public String print(Duration duration) { 4.81 - return duration.toString(); 4.82 + new StringImpl<Duration>(Duration.class, createXS("duration")) { 4.83 + public String print(Duration duration) { 4.84 + return duration.toString(); 4.85 + } 4.86 + 4.87 + public Duration parse(CharSequence lexical) { 4.88 + TODO.checkSpec("JSR222 Issue #42"); 4.89 + return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString()); 4.90 + } 4.91 } 4.92 - 4.93 - public Duration parse(CharSequence lexical) { 4.94 - TODO.checkSpec("JSR222 Issue #42"); 4.95 - return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString()); 4.96 - } 4.97 - }); 4.98 + ); 4.99 primaryList.add( 4.100 new StringImpl<Void>(Void.class) { 4.101 // 'void' binding isn't defined by the spec, but when the JAX-RPC processes user-defined
5.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java Wed Dec 17 14:46:36 2014 -0800 5.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/Utils.java Wed Jan 21 17:08:09 2015 +0000 5.3 @@ -38,6 +38,9 @@ 5.4 5.5 /** 5.6 * Utils class. 5.7 + * 5.8 + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. 5.9 + * 5.10 * Has *package private* access to avoid inappropriate usage. 5.11 */ 5.12 final class Utils { 5.13 @@ -51,17 +54,20 @@ 5.14 5.15 static { // we statically initializing REFLECTION_NAVIGATOR property 5.16 try { 5.17 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 5.18 - //noinspection unchecked 5.19 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 5.20 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 5.21 5.22 // requires accessClassInPackage privilege 5.23 - AccessController.doPrivileged( 5.24 - new PrivilegedAction<Object>() { 5.25 + final Method getInstance = AccessController.doPrivileged( 5.26 + new PrivilegedAction<Method>() { 5.27 @Override 5.28 - public Object run() { 5.29 - getInstance.setAccessible(true); 5.30 - return null; 5.31 + public Method run() { 5.32 + try { 5.33 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 5.34 + getInstance.setAccessible(true); 5.35 + return getInstance; 5.36 + } catch (NoSuchMethodException e) { 5.37 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 5.38 + } 5.39 } 5.40 } 5.41 ); 5.42 @@ -69,16 +75,10 @@ 5.43 //noinspection unchecked 5.44 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 5.45 } catch (ClassNotFoundException e) { 5.46 - e.printStackTrace(); 5.47 throw new IllegalStateException("Can't find ReflectionNavigator class"); 5.48 } catch (InvocationTargetException e) { 5.49 - e.printStackTrace(); 5.50 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 5.51 - } catch (NoSuchMethodException e) { 5.52 - e.printStackTrace(); 5.53 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 5.54 } catch (IllegalAccessException e) { 5.55 - e.printStackTrace(); 5.56 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 5.57 } catch (SecurityException e) { 5.58 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
6.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Wed Dec 17 14:46:36 2014 -0800 6.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/Utils.java Wed Jan 21 17:08:09 2015 +0000 6.3 @@ -38,6 +38,9 @@ 6.4 6.5 /** 6.6 * Utils class. 6.7 + * 6.8 + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. 6.9 + * 6.10 * Has *package private* access to avoid inappropriate usage. 6.11 */ 6.12 final class Utils { 6.13 @@ -51,17 +54,20 @@ 6.14 6.15 static { // we statically initializing REFLECTION_NAVIGATOR property 6.16 try { 6.17 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 6.18 - //noinspection unchecked 6.19 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 6.20 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 6.21 6.22 // requires accessClassInPackage privilege 6.23 - AccessController.doPrivileged( 6.24 - new PrivilegedAction<Object>() { 6.25 + final Method getInstance = AccessController.doPrivileged( 6.26 + new PrivilegedAction<Method>() { 6.27 @Override 6.28 - public Object run() { 6.29 - getInstance.setAccessible(true); 6.30 - return null; 6.31 + public Method run() { 6.32 + try { 6.33 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 6.34 + getInstance.setAccessible(true); 6.35 + return getInstance; 6.36 + } catch (NoSuchMethodException e) { 6.37 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 6.38 + } 6.39 } 6.40 } 6.41 ); 6.42 @@ -69,16 +75,10 @@ 6.43 //noinspection unchecked 6.44 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 6.45 } catch (ClassNotFoundException e) { 6.46 - e.printStackTrace(); 6.47 throw new IllegalStateException("Can't find ReflectionNavigator class"); 6.48 } catch (InvocationTargetException e) { 6.49 - e.printStackTrace(); 6.50 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 6.51 - } catch (NoSuchMethodException e) { 6.52 - e.printStackTrace(); 6.53 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 6.54 } catch (IllegalAccessException e) { 6.55 - e.printStackTrace(); 6.56 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 6.57 } catch (SecurityException e) { 6.58 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
7.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java Wed Dec 17 14:46:36 2014 -0800 7.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/Utils.java Wed Jan 21 17:08:09 2015 +0000 7.3 @@ -38,6 +38,9 @@ 7.4 7.5 /** 7.6 * Utils class. 7.7 + * 7.8 + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. 7.9 + * 7.10 * Has *package private* access to avoid inappropriate usage. 7.11 */ 7.12 final class Utils { 7.13 @@ -51,17 +54,20 @@ 7.14 7.15 static { // we statically initializing REFLECTION_NAVIGATOR property 7.16 try { 7.17 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 7.18 - //noinspection unchecked 7.19 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 7.20 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 7.21 7.22 // requires accessClassInPackage privilege 7.23 - AccessController.doPrivileged( 7.24 - new PrivilegedAction<Object>() { 7.25 + final Method getInstance = AccessController.doPrivileged( 7.26 + new PrivilegedAction<Method>() { 7.27 @Override 7.28 - public Object run() { 7.29 - getInstance.setAccessible(true); 7.30 - return null; 7.31 + public Method run() { 7.32 + try { 7.33 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 7.34 + getInstance.setAccessible(true); 7.35 + return getInstance; 7.36 + } catch (NoSuchMethodException e) { 7.37 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 7.38 + } 7.39 } 7.40 } 7.41 ); 7.42 @@ -69,16 +75,10 @@ 7.43 //noinspection unchecked 7.44 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 7.45 } catch (ClassNotFoundException e) { 7.46 - e.printStackTrace(); 7.47 throw new IllegalStateException("Can't find ReflectionNavigator class"); 7.48 } catch (InvocationTargetException e) { 7.49 - e.printStackTrace(); 7.50 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 7.51 - } catch (NoSuchMethodException e) { 7.52 - e.printStackTrace(); 7.53 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 7.54 } catch (IllegalAccessException e) { 7.55 - e.printStackTrace(); 7.56 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 7.57 } catch (SecurityException e) { 7.58 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
8.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java Wed Dec 17 14:46:36 2014 -0800 8.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Utils.java Wed Jan 21 17:08:09 2015 +0000 8.3 @@ -38,6 +38,9 @@ 8.4 8.5 /** 8.6 * Utils class. 8.7 + * 8.8 + * WARNING: If you are doing any changes don't forget to change other Utils classes in different packages. 8.9 + * 8.10 * Has *package private* access to avoid inappropriate usage. 8.11 */ 8.12 final class Utils { 8.13 @@ -51,17 +54,20 @@ 8.14 8.15 static { // we statically initializing REFLECTION_NAVIGATOR property 8.16 try { 8.17 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 8.18 - //noinspection unchecked 8.19 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 8.20 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 8.21 8.22 // requires accessClassInPackage privilege 8.23 - AccessController.doPrivileged( 8.24 - new PrivilegedAction<Object>() { 8.25 + final Method getInstance = AccessController.doPrivileged( 8.26 + new PrivilegedAction<Method>() { 8.27 @Override 8.28 - public Object run() { 8.29 - getInstance.setAccessible(true); 8.30 - return null; 8.31 + public Method run() { 8.32 + try { 8.33 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 8.34 + getInstance.setAccessible(true); 8.35 + return getInstance; 8.36 + } catch (NoSuchMethodException e) { 8.37 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 8.38 + } 8.39 } 8.40 } 8.41 ); 8.42 @@ -69,16 +75,10 @@ 8.43 //noinspection unchecked 8.44 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 8.45 } catch (ClassNotFoundException e) { 8.46 - e.printStackTrace(); 8.47 throw new IllegalStateException("Can't find ReflectionNavigator class"); 8.48 } catch (InvocationTargetException e) { 8.49 - e.printStackTrace(); 8.50 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 8.51 - } catch (NoSuchMethodException e) { 8.52 - e.printStackTrace(); 8.53 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 8.54 } catch (IllegalAccessException e) { 8.55 - e.printStackTrace(); 8.56 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 8.57 } catch (SecurityException e) { 8.58 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
9.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java Wed Dec 17 14:46:36 2014 -0800 9.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java Wed Jan 21 17:08:09 2015 +0000 9.3 @@ -1,5 +1,5 @@ 9.4 /* 9.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 9.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 9.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.8 * 9.9 * This code is free software; you can redistribute it and/or modify it 9.10 @@ -25,8 +25,10 @@ 9.11 9.12 package com.sun.xml.internal.bind.v2.util; 9.13 9.14 -import com.sun.xml.internal.bind.Util; 9.15 import com.sun.xml.internal.bind.v2.Messages; 9.16 + 9.17 +import java.security.AccessController; 9.18 +import java.security.PrivilegedAction; 9.19 import java.util.logging.Level; 9.20 import java.util.logging.Logger; 9.21 import javax.xml.XMLConstants; 9.22 @@ -43,8 +45,6 @@ 9.23 import org.xml.sax.SAXNotRecognizedException; 9.24 import org.xml.sax.SAXNotSupportedException; 9.25 9.26 -import static com.sun.xml.internal.bind.Util.getSystemProperty; 9.27 - 9.28 /** 9.29 * Provides helper methods for creating properly configured XML parser 9.30 * factory instances with namespace support turned on and configured for 9.31 @@ -68,7 +68,14 @@ 9.32 */ 9.33 private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; 9.34 9.35 - public static final boolean XML_SECURITY_DISABLED = Boolean.parseBoolean(getSystemProperty(DISABLE_XML_SECURITY)); 9.36 + private static final boolean XML_SECURITY_DISABLED = AccessController.doPrivileged( 9.37 + new PrivilegedAction<Boolean>() { 9.38 + @Override 9.39 + public Boolean run() { 9.40 + return Boolean.getBoolean(DISABLE_XML_SECURITY); 9.41 + } 9.42 + } 9.43 + ); 9.44 9.45 private static boolean isXMLSecurityDisabled(boolean runtimeSetting) { 9.46 return XML_SECURITY_DISABLED || runtimeSetting;
10.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java Wed Dec 17 14:46:36 2014 -0800 10.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/model/Utils.java Wed Jan 21 17:08:09 2015 +0000 10.3 @@ -54,17 +54,20 @@ 10.4 10.5 static { // we statically initializing REFLECTION_NAVIGATOR property 10.6 try { 10.7 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 10.8 - //noinspection unchecked 10.9 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 10.10 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 10.11 10.12 // requires accessClassInPackage privilege 10.13 - AccessController.doPrivileged( 10.14 - new PrivilegedAction<Object>() { 10.15 + final Method getInstance = AccessController.doPrivileged( 10.16 + new PrivilegedAction<Method>() { 10.17 @Override 10.18 - public Object run() { 10.19 - getInstance.setAccessible(true); 10.20 - return null; 10.21 + public Method run() { 10.22 + try { 10.23 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 10.24 + getInstance.setAccessible(true); 10.25 + return getInstance; 10.26 + } catch (NoSuchMethodException e) { 10.27 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 10.28 + } 10.29 } 10.30 } 10.31 ); 10.32 @@ -72,16 +75,10 @@ 10.33 //noinspection unchecked 10.34 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 10.35 } catch (ClassNotFoundException e) { 10.36 - e.printStackTrace(); 10.37 throw new IllegalStateException("Can't find ReflectionNavigator class"); 10.38 } catch (InvocationTargetException e) { 10.39 - e.printStackTrace(); 10.40 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 10.41 - } catch (NoSuchMethodException e) { 10.42 - e.printStackTrace(); 10.43 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 10.44 } catch (IllegalAccessException e) { 10.45 - e.printStackTrace(); 10.46 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 10.47 } catch (SecurityException e) { 10.48 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
11.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java Wed Dec 17 14:46:36 2014 -0800 11.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java Wed Jan 21 17:08:09 2015 +0000 11.3 @@ -147,19 +147,12 @@ 11.4 } 11.5 11.6 public EndpointReference readEndpointReference(final Source eprInfoset) { 11.7 - // EPR constructors are private, so we need privilege escalation. 11.8 - // this unmarshalling can only access instances of a fixed, known set of classes, 11.9 - // so doing that shouldn't introduce security vulnerability. 11.10 - return AccessController.doPrivileged(new PrivilegedAction<EndpointReference>() { 11.11 - public EndpointReference run() { 11.12 - try { 11.13 - Unmarshaller unmarshaller = eprjc.get().createUnmarshaller(); 11.14 - return (EndpointReference) unmarshaller.unmarshal(eprInfoset); 11.15 - } catch (JAXBException e) { 11.16 - throw new WebServiceException("Error creating Marshaller or marshalling.", e); 11.17 - } 11.18 - } 11.19 - }); 11.20 + try { 11.21 + Unmarshaller unmarshaller = eprjc.get().createUnmarshaller(); 11.22 + return (EndpointReference) unmarshaller.unmarshal(eprInfoset); 11.23 + } catch (JAXBException e) { 11.24 + throw new WebServiceException("Error creating Marshaller or marshalling.", e); 11.25 + } 11.26 } 11.27 11.28 public <T> T getPort(EndpointReference endpointReference, Class<T> clazz, WebServiceFeature... webServiceFeatures) {
12.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java Wed Dec 17 14:46:36 2014 -0800 12.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/Utils.java Wed Jan 21 17:08:09 2015 +0000 12.3 @@ -54,17 +54,20 @@ 12.4 12.5 static { // we statically initializing REFLECTION_NAVIGATOR property 12.6 try { 12.7 - Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 12.8 - //noinspection unchecked 12.9 - final Method getInstance = refNav.getDeclaredMethod("getInstance"); 12.10 + final Class refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator"); 12.11 12.12 // requires accessClassInPackage privilege 12.13 - AccessController.doPrivileged( 12.14 - new PrivilegedAction<Object>() { 12.15 + final Method getInstance = AccessController.doPrivileged( 12.16 + new PrivilegedAction<Method>() { 12.17 @Override 12.18 - public Object run() { 12.19 - getInstance.setAccessible(true); 12.20 - return null; 12.21 + public Method run() { 12.22 + try { 12.23 + Method getInstance = refNav.getDeclaredMethod("getInstance"); 12.24 + getInstance.setAccessible(true); 12.25 + return getInstance; 12.26 + } catch (NoSuchMethodException e) { 12.27 + throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 12.28 + } 12.29 } 12.30 } 12.31 ); 12.32 @@ -72,16 +75,10 @@ 12.33 //noinspection unchecked 12.34 REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null); 12.35 } catch (ClassNotFoundException e) { 12.36 - e.printStackTrace(); 12.37 throw new IllegalStateException("Can't find ReflectionNavigator class"); 12.38 } catch (InvocationTargetException e) { 12.39 - e.printStackTrace(); 12.40 throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception"); 12.41 - } catch (NoSuchMethodException e) { 12.42 - e.printStackTrace(); 12.43 - throw new IllegalStateException("ReflectionNavigator.getInstance can't be found"); 12.44 } catch (IllegalAccessException e) { 12.45 - e.printStackTrace(); 12.46 throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible"); 12.47 } catch (SecurityException e) { 12.48 LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
13.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java Wed Dec 17 14:46:36 2014 -0800 13.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java Wed Jan 21 17:08:09 2015 +0000 13.3 @@ -63,6 +63,8 @@ 13.4 import java.io.OutputStreamWriter; 13.5 import java.io.Writer; 13.6 import java.net.URL; 13.7 +import java.security.AccessController; 13.8 +import java.security.PrivilegedAction; 13.9 import java.util.ArrayList; 13.10 import java.util.Enumeration; 13.11 import java.util.Iterator; 13.12 @@ -84,12 +86,16 @@ 13.13 13.14 private static final Logger LOGGER = Logger.getLogger(XmlUtil.class.getName()); 13.15 13.16 - private static boolean XML_SECURITY_DISABLED; 13.17 + private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.ws.disableXmlSecurity"; 13.18 13.19 - static { 13.20 - String disableXmlSecurity = System.getProperty("com.sun.xml.internal.ws.disableXmlSecurity"); 13.21 - XML_SECURITY_DISABLED = disableXmlSecurity == null || !Boolean.valueOf(disableXmlSecurity); 13.22 - } 13.23 + private static boolean XML_SECURITY_DISABLED = AccessController.doPrivileged( 13.24 + new PrivilegedAction<Boolean>() { 13.25 + @Override 13.26 + public Boolean run() { 13.27 + return Boolean.getBoolean(DISABLE_XML_SECURITY); 13.28 + } 13.29 + } 13.30 + ); 13.31 13.32 public static String getPrefix(String s) { 13.33 int i = s.indexOf(':');