8078057: Reapply fixes for 8073361, 8073374, 8073696
authoraefimov
Fri, 17 Apr 2015 17:17:05 +0300
changeset 29953 d5894097fe65
parent 29952 6cccd9075e2f
child 29954 2146836f6f52
8078057: Reapply fixes for 8073361, 8073374, 8073696 Reviewed-by: alanb, mchung
jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java
jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Tue Apr 07 13:08:57 2015 +0200
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Fri Apr 17 17:17:05 2015 +0300
@@ -30,6 +30,8 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.ref.WeakReference;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
@@ -85,19 +87,25 @@
         if(consRef!=null)
             cons = consRef.get();
         if(cons==null) {
-            try {
-                cons = clazz.getDeclaredConstructor(emptyClass);
-            } catch (NoSuchMethodException e) {
-                logger.log(Level.INFO,"No default constructor found on "+clazz,e);
-                NoSuchMethodError exp;
-                if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
-                    exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS.format(clazz.getName()));
-                } else {
-                    exp = new NoSuchMethodError(e.getMessage());
+            cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() {
+                @Override
+                public Constructor<T> run() {
+                    try {
+                        return clazz.getDeclaredConstructor(emptyClass);
+                    } catch (NoSuchMethodException e) {
+                        logger.log(Level.INFO,"No default constructor found on "+clazz,e);
+                        NoSuchMethodError exp;
+                        if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
+                            exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS
+                                                                .format(clazz.getName()));
+                        } else {
+                            exp = new NoSuchMethodError(e.getMessage());
+                        }
+                        exp.initCause(e);
+                        throw exp;
+                    }
                 }
-                exp.initCause(e);
-                throw exp;
-            }
+            });
 
             int classMod = clazz.getModifiers();
 
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java	Tue Apr 07 13:08:57 2015 +0200
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java	Fri Apr 17 17:17:05 2015 +0300
@@ -36,9 +36,6 @@
 //TODO DOMHeader DOMMessage SAAJMessage StatefulInstanceResolver
 import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
 
-//TODO MtomCodec
-import com.sun.xml.internal.bind.v2.runtime.output.Encoded;
-
 //TODO ExceptionBean
 import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;
 
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java	Tue Apr 07 13:08:57 2015 +0200
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java	Fri Apr 17 17:17:05 2015 +0300
@@ -25,8 +25,6 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -37,7 +35,9 @@
 public interface SOAPConstants {
 
     // namespace URIs
-    public static final String URI_ENVELOPE = SOAPNamespaceConstants.ENVELOPE;
+    public static final String URI_ENVELOPE =
+        "http://schemas.xmlsoap.org/soap/envelope/";
+
     public static final String NS_WSDL_SOAP =
         "http://schemas.xmlsoap.org/wsdl/soap/";
     public static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";