You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/08/11 07:10:42 UTC
[lucene-solr] 02/02: @501 Transformer can be shared.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 6f05fc3af8749365618c76f76c68e6d758c60ba5
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Aug 11 02:05:57 2020 -0500
@501 Transformer can be shared.
---
solr/core/src/java/org/apache/solr/core/XmlConfigFile.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java b/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java
index e1a9ad5..1256cfa 100644
--- a/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java
+++ b/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java
@@ -23,6 +23,8 @@ import com.fasterxml.aalto.WFCException;
import com.fasterxml.aalto.dom.DOMWriterImpl;
import com.fasterxml.aalto.stax.InputFactoryImpl;
import com.fasterxml.aalto.util.IllegalCharHandler;
+import net.sf.saxon.BasicTransformerFactory;
+import net.sf.saxon.TransformerFactoryImpl;
import net.sf.saxon.dom.DocumentBuilderImpl;
import net.sf.saxon.jaxp.SaxonTransformerFactory;
import net.sf.saxon.xpath.XPathFactoryImpl;
@@ -87,10 +89,11 @@ public class XmlConfigFile { // formerly simply "Config"
public static final XMLErrorLogger xmllog = new XMLErrorLogger(log);
public static final DOMConverter convertor = new DOMConverter();
public static final XPathFactory xpathFactory = new XPathFactoryImpl();
- public static final SaxonTransformerFactory tfactory = new SaxonTransformerFactory();
+ public static final SaxonTransformerFactory tfactory = new BasicTransformerFactory();
static {
// tfactory.getConfiguration().setBooleanProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.TRUE);
}
+ public static final Transformer tx = tfactory.newTransformer();
private final Document doc;
//private final Document origDoc; // with unsubstituted properties
@@ -281,9 +284,7 @@ public class XmlConfigFile { // formerly simply "Config"
} catch (XMLStreamException e) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
}
-
-
-
+
this.substituteProperties = substituteProps;
if (substituteProps != null) {
DOMUtil.substituteProperties(doc, substituteProperties);
@@ -291,7 +292,6 @@ public class XmlConfigFile { // formerly simply "Config"
}
private static Document copyDoc(Document doc) throws TransformerException {
- Transformer tx = tfactory.newTransformer();
DOMSource source = new DOMSource(doc);
DOMResult result = new DOMResult();
tx.transform(source, result);