1.1 --- a/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java Thu Apr 04 19:05:24 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java Tue Apr 09 14:51:13 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -26,15 +26,12 @@ 1.11 package com.sun.tools.internal.ws.wsdl.parser; 1.12 1.13 import com.sun.istack.internal.NotNull; 1.14 -import com.sun.tools.internal.ws.resources.WscompileMessages; 1.15 -import com.sun.tools.internal.ws.wscompile.AbortException; 1.16 -import com.sun.tools.internal.ws.wscompile.DefaultAuthenticator; 1.17 +import com.sun.tools.internal.ws.util.xml.XmlUtil; 1.18 import com.sun.tools.internal.ws.wscompile.ErrorReceiver; 1.19 import com.sun.tools.internal.ws.wscompile.WsimportOptions; 1.20 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants; 1.21 import com.sun.tools.internal.xjc.reader.internalizer.LocatorTable; 1.22 import com.sun.xml.internal.bind.marshaller.DataWriter; 1.23 -import com.sun.xml.internal.ws.util.JAXWSUtils; 1.24 import org.w3c.dom.Document; 1.25 import org.w3c.dom.Element; 1.26 import org.w3c.dom.NodeList; 1.27 @@ -51,9 +48,6 @@ 1.28 import javax.xml.transform.TransformerFactory; 1.29 import javax.xml.transform.dom.DOMSource; 1.30 import javax.xml.transform.sax.SAXResult; 1.31 -import javax.net.ssl.HttpsURLConnection; 1.32 -import javax.net.ssl.HostnameVerifier; 1.33 -import javax.net.ssl.SSLSession; 1.34 import java.io.IOException; 1.35 import java.io.InputStream; 1.36 import java.io.OutputStream; 1.37 @@ -119,11 +113,13 @@ 1.38 this.errorReceiver = errReceiver; 1.39 this.logic = logic; 1.40 try { 1.41 - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 1.42 + // secure xml processing can be switched off if input requires it 1.43 + boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; 1.44 + DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled); 1.45 dbf.setNamespaceAware(true); 1.46 this.documentBuilder = dbf.newDocumentBuilder(); 1.47 1.48 - this.parserFactory = SAXParserFactory.newInstance(); 1.49 + this.parserFactory = XmlUtil.newSAXParserFactory(secureProcessingEnabled); 1.50 this.parserFactory.setNamespaceAware(true); 1.51 } catch (ParserConfigurationException e) { 1.52 throw new AssertionError(e); 1.53 @@ -368,7 +364,10 @@ 1.54 public void dump(OutputStream out) throws IOException { 1.55 try { 1.56 // create identity transformer 1.57 - Transformer it = TransformerFactory.newInstance().newTransformer(); 1.58 + // secure xml processing can be switched off if input requires it 1.59 + boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; 1.60 + TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); 1.61 + Transformer it = tf.newTransformer(); 1.62 1.63 for (Map.Entry<String, Document> e : core.entrySet()) { 1.64 out.write(("---<< " + e.getKey() + '\n').getBytes());