src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java

changeset 1386
65d3b0e44551
parent 408
b0610cd08440
child 1435
a90b319bae7a
equal deleted inserted replaced
1384:631033c46a0d 1386:65d3b0e44551
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
110 public DOMForest(InternalizationLogic logic, @NotNull EntityResolver entityResolver, WsimportOptions options, ErrorReceiver errReceiver) { 110 public DOMForest(InternalizationLogic logic, @NotNull EntityResolver entityResolver, WsimportOptions options, ErrorReceiver errReceiver) {
111 this.options = options; 111 this.options = options;
112 this.entityResolver = entityResolver; 112 this.entityResolver = entityResolver;
113 this.errorReceiver = errReceiver; 113 this.errorReceiver = errReceiver;
114 this.logic = logic; 114 this.logic = logic;
115 try { 115 // secure xml processing can be switched off if input requires it
116 // secure xml processing can be switched off if input requires it 116 boolean disableXmlSecurity = options == null ? false : options.disableXmlSecurity;
117 boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity; 117
118 DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled); 118 DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(disableXmlSecurity);
119 dbf.setNamespaceAware(true); 119 this.parserFactory = XmlUtil.newSAXParserFactory(disableXmlSecurity);
120 try {
120 this.documentBuilder = dbf.newDocumentBuilder(); 121 this.documentBuilder = dbf.newDocumentBuilder();
121
122 this.parserFactory = XmlUtil.newSAXParserFactory(secureProcessingEnabled);
123 this.parserFactory.setNamespaceAware(true);
124 } catch (ParserConfigurationException e) { 122 } catch (ParserConfigurationException e) {
125 throw new AssertionError(e); 123 throw new AssertionError(e);
126 } 124 }
127 } 125 }
128 126

mercurial