# HG changeset patch # User dfuchs # Date 1370544433 -7200 # Node ID ade6118af296d66075212aeac28b5be49b790eb3 # Parent 9849cc530d6d104a007fce0420a6064ce8108642 8013434: Xalan and Xerces internal ObjectFactory need rework Summary: With this changeset, DTMManager and XSLTCDTMManager will always use their own default implementation. Reviewed-by: joehw, alanb diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.transform.TransformerFactory --- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.transform.TransformerFactory Tue May 23 13:19:17 2017 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.xpath.XPathFactory --- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.xpath.XPathFactory Tue May 23 13:19:17 2017 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl \ No newline at end of file diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/META-INF/services/org.apache.xml.dtm.DTMManager --- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/META-INF/services/org.apache.xml.dtm.DTMManager Tue May 23 13:19:17 2017 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java --- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java Tue May 23 13:19:17 2017 +0300 +++ b/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java Thu Jun 06 20:47:13 2013 +0200 @@ -23,26 +23,11 @@ package com.sun.org.apache.xalan.internal.utils; -import java.io.InputStream; -import java.io.IOException; -import java.io.File; -import java.io.FileInputStream; - -import java.util.Properties; -import java.io.BufferedReader; -import java.io.InputStreamReader; - /** * This class is duplicated for each JAXP subpackage so keep it in sync. * It is package private and therefore is not exposed as part of the JAXP * API. *
- * This code is designed to implement the JAXP 1.1 spec pluggability - * feature and is designed to run on JDK version 1.1 and - * later, and to compile on JDK 1.2 and onward. - * The code also runs both as part of an unbundled jar file and - * when bundled as part of the JDK. - *
* This class was moved from the javax.xml.parsers.ObjectFactory
* class and modified to be used as a general utility for creating objects
* dynamically.
@@ -57,329 +42,9 @@
private static final String JAXP_INTERNAL = "com.sun.org.apache";
private static final String STAX_INTERNAL = "com.sun.xml.internal";
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
/** Set to true for debugging */
private static final boolean DEBUG = false;
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
System.getProperty
- * META-INF/services/factoryId
file
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager
property, is
- * checked.xalan.propeties
file is checked for a property
- * of the same name.META-INF/services/com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager
- * file is checked.
- * com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager
.
+ * Creates a new instance of the XSLTC DTM Manager service.
+ * Creates a new instance of the default class
+ * com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager
.
*/
- public static Class getDTMManagerClass() {
- Class mgrClass = ObjectFactory.lookUpFactoryClass(DEFAULT_PROP_NAME,
- null,
- DEFAULT_CLASS_NAME);
- // If no class found, default to this one. (This should never happen -
- // the ObjectFactory has already been told that the current class is
- // the default).
- return (mgrClass != null) ? mgrClass : XSLTCDTMManager.class;
+ public static XSLTCDTMManager createNewDTMManagerInstance() {
+ return newInstance();
}
/**
@@ -132,6 +108,7 @@
*
* @return a non-null DTM reference.
*/
+ @Override
public DTM getDTM(Source source, boolean unique,
DTMWSFilter whiteSpaceFilter, boolean incremental,
boolean doIndexing)
diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java Tue May 23 13:19:17 2017 +0300
+++ b/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java Thu Jun 06 20:47:13 2013 +0200
@@ -200,14 +200,6 @@
private int _indentNumber = -1;
/**
- * The provider of the XSLTC DTM Manager service. This is fixed for any
- * instance of this class. In order to change service providers, a new
- * XSLTC TransformerFactory
must be instantiated.
- * @see XSLTCDTMManager#getDTMManagerClass()
- */
- private Class m_DTMManagerClass;
-
- /**
* State of secure processing feature.
*/ private boolean _isNotSecureProcessing = true; @@ -219,7 +211,6 @@ * javax.xml.transform.sax.TransformerFactory implementation. */ public TransformerFactoryImpl() { - m_DTMManagerClass = XSLTCDTMManager.getDTMManagerClass(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; @@ -240,6 +231,7 @@ * @param listener The error listener to use with the TransformerFactory * @throws IllegalArgumentException */ + @Override public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { @@ -257,6 +249,7 @@ * * @return The error listener used with the TransformerFactory */ + @Override public ErrorListener getErrorListener() { return _errorListener; } @@ -269,6 +262,7 @@ * @return An object representing the attribute value * @throws IllegalArgumentException */ + @Override public Object getAttribute(String name) throws IllegalArgumentException { @@ -305,6 +299,7 @@ * @param value An object representing the attribute value * @throws IllegalArgumentException */ + @Override public void setAttribute(String name, Object value) throws IllegalArgumentException { @@ -424,6 +419,7 @@ * or theTransformer
s or Template
s it creates cannot support this feature.
* @throws NullPointerException If the name
parameter is null.
*/
+ @Override
public void setFeature(String name, boolean value)
throws TransformerConfigurationException {
@@ -459,6 +455,7 @@
* @param name The feature name
* @return 'true' if feature is supported, 'false' if not
*/
+ @Override
public boolean getFeature(String name) {
// All supported features should be listed here
String[] features = {
@@ -502,7 +499,8 @@
*
* @return The URLResolver used for this TransformerFactory and all
* Templates and Transformer objects created using this factory
- */
+ */
+ @Override
public URIResolver getURIResolver() {
return _uriResolver;
}
@@ -516,7 +514,8 @@
*
* @param resolver The URLResolver used for this TransformerFactory and all
* Templates and Transformer objects created using this factory
- */
+ */
+ @Override
public void setURIResolver(URIResolver resolver) {
_uriResolver = resolver;
}
@@ -536,13 +535,14 @@
* @return A Source object suitable for passing to the TransformerFactory.
* @throws TransformerConfigurationException
*/
+ @Override
public Source getAssociatedStylesheet(Source source, String media,
String title, String charset)
throws TransformerConfigurationException {
String baseId;
- XMLReader reader = null;
- InputSource isource = null;
+ XMLReader reader;
+ InputSource isource;
/**
@@ -623,7 +623,8 @@
*
* @return A Transformer object that simply copies the source to the result.
* @throws TransformerConfigurationException
- */
+ */
+ @Override
public Transformer newTransformer()
throws TransformerConfigurationException
{
@@ -649,6 +650,7 @@
* @return A Templates object that can be used to create Transformers.
* @throws TransformerConfigurationException
*/
+ @Override
public Transformer newTransformer(Source source) throws
TransformerConfigurationException
{
@@ -712,6 +714,7 @@
* @return A Templates object that can be used to create Transformers.
* @throws TransformerConfigurationException
*/
+ @Override
public Templates newTemplates(Source source)
throws TransformerConfigurationException
{
@@ -746,7 +749,7 @@
// If _autoTranslet is true, we will try to load the bytecodes
// from the translet classes without compiling the stylesheet.
if (_autoTranslet) {
- byte[][] bytecodes = null;
+ byte[][] bytecodes;
String transletClassName = getTransletBaseName(source);
if (_packageName != null)
@@ -864,7 +867,7 @@
if (bytecodes == null) {
Vector errs = xsltc.getErrors();
- ErrorMsg err = null;
+ ErrorMsg err;
if (errs != null) {
err = (ErrorMsg)errs.get(errs.size()-1);
} else {
@@ -909,6 +912,7 @@
* @return A TemplatesHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TemplatesHandler newTemplatesHandler()
throws TransformerConfigurationException
{
@@ -928,6 +932,7 @@
* @return A TransformerHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TransformerHandler newTransformerHandler()
throws TransformerConfigurationException
{
@@ -948,6 +953,7 @@
* @return A TransformerHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TransformerHandler newTransformerHandler(Source src)
throws TransformerConfigurationException
{
@@ -967,7 +973,8 @@
* @param templates Represents a pre-processed stylesheet
* @return A TransformerHandler object that can handle SAX events
* @throws TransformerConfigurationException
- */
+ */
+ @Override
public TransformerHandler newTransformerHandler(Templates templates)
throws TransformerConfigurationException
{
@@ -985,6 +992,7 @@
* @return An XMLFilter object, or null if this feature is not supported.
* @throws TransformerConfigurationException
*/
+ @Override
public XMLFilter newXMLFilter(Source src)
throws TransformerConfigurationException
{
@@ -1002,6 +1010,7 @@
* @return An XMLFilter object, or null if this feature is not supported.
* @throws TransformerConfigurationException
*/
+ @Override
public XMLFilter newXMLFilter(Templates templates)
throws TransformerConfigurationException
{
@@ -1033,6 +1042,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void error(TransformerException e)
throws TransformerException
{
@@ -1061,6 +1071,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void fatalError(TransformerException e)
throws TransformerException
{
@@ -1089,6 +1100,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (never does in our case).
*/
+ @Override
public void warning(TransformerException e)
throws TransformerException
{
@@ -1112,6 +1124,7 @@
* @param xsltc The compiler that resuests the document
* @return An InputSource with the loaded document
*/
+ @Override
public InputSource loadSource(String href, String context, XSLTC xsltc) {
try {
if (_uriResolver != null) {
@@ -1198,7 +1211,7 @@
Vector bytecodes = new Vector();
int fileLength = (int)transletFile.length();
if (fileLength > 0) {
- FileInputStream input = null;
+ FileInputStream input;
try {
input = new FileInputStream(transletFile);
}
@@ -1230,6 +1243,7 @@
// Find all the auxiliary files which have a name pattern of "transletClass$nnn.class".
final String transletAuxPrefix = transletName + "$";
File[] auxfiles = transletParentFile.listFiles(new FilenameFilter() {
+ @Override
public boolean accept(File dir, String name)
{
return (name.endsWith(".class") && name.startsWith(transletAuxPrefix));
@@ -1293,7 +1307,7 @@
xslFile = new File(xslFileName);
// Construct the path for the jar file
- String jarPath = null;
+ String jarPath;
if (_destinationDirectory != null)
jarPath = _destinationDirectory + "/" + _jarFileName;
else {
@@ -1318,7 +1332,7 @@
}
// Create a ZipFile object for the jar file
- ZipFile jarFile = null;
+ ZipFile jarFile;
try {
jarFile = new ZipFile(file);
}
@@ -1436,7 +1450,7 @@
if (file.exists())
return systemId;
else {
- URL url = null;
+ URL url;
try {
url = new URL(systemId);
}
@@ -1455,9 +1469,9 @@
}
/**
- * Returns the Class object the provides the XSLTC DTM Manager service.
+ * Returns a new instance of the XSLTC DTM Manager service.
*/
- protected Class getDTMManagerClass() {
- return m_DTMManagerClass;
+ protected final XSLTCDTMManager createNewDTMManagerInstance() {
+ return XSLTCDTMManager.newInstance();
}
}
diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java Tue May 23 13:19:17 2017 +0300
+++ b/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java Thu Jun 06 20:47:13 2013 +0200
@@ -96,6 +96,7 @@
* resolved.
* @return The systemID that was set with setSystemId(String id)
*/
+ @Override
public String getSystemId() {
return _systemId;
}
@@ -106,6 +107,7 @@
* resolved.
* @param id Base URI for this stylesheet
*/
+ @Override
public void setSystemId(String id) {
_systemId = id;
}
@@ -116,6 +118,7 @@
* order to set parameters and output properties.
* @return The Transformer object
*/
+ @Override
public Transformer getTransformer() {
return _transformer;
}
@@ -127,6 +130,7 @@
* @param result A Result instance, should not be null
* @throws IllegalArgumentException if result is invalid for some reason
*/
+ @Override
public void setResult(Result result) throws IllegalArgumentException {
_result = result;
@@ -166,6 +170,7 @@
* Implements org.xml.sax.ContentHandler.characters()
* Receive notification of character data.
*/
+ @Override
public void characters(char[] ch, int start, int length)
throws SAXException
{
@@ -176,6 +181,7 @@
* Implements org.xml.sax.ContentHandler.startDocument()
* Receive notification of the beginning of a document.
*/
+ @Override
public void startDocument() throws SAXException {
// Make sure setResult() was called before the first SAX event
if (_result == null) {
@@ -189,10 +195,8 @@
// Create an internal DOM (not W3C) and get SAX2 input handler
try {
- dtmManager =
- (XSLTCDTMManager)_transformer.getTransformerFactory()
- .getDTMManagerClass()
- .newInstance();
+ dtmManager = _transformer.getTransformerFactory()
+ .createNewDTMManagerInstance();
} catch (Exception e) {
throw new SAXException(e);
}
@@ -230,6 +234,7 @@
* Implements org.xml.sax.ContentHandler.endDocument()
* Receive notification of the end of a document.
*/
+ @Override
public void endDocument() throws SAXException {
// Signal to the DOMBuilder that the document is complete
_handler.endDocument();
@@ -260,6 +265,7 @@
* Implements org.xml.sax.ContentHandler.startElement()
* Receive notification of the beginning of an element.
*/
+ @Override
public void startElement(String uri, String localName,
String qname, Attributes attributes)
throws SAXException
@@ -271,6 +277,7 @@
* Implements org.xml.sax.ContentHandler.endElement()
* Receive notification of the end of an element.
*/
+ @Override
public void endElement(String namespaceURI, String localName, String qname)
throws SAXException
{
@@ -281,6 +288,7 @@
* Implements org.xml.sax.ContentHandler.processingInstruction()
* Receive notification of a processing instruction.
*/
+ @Override
public void processingInstruction(String target, String data)
throws SAXException
{
@@ -290,6 +298,7 @@
/**
* Implements org.xml.sax.ext.LexicalHandler.startCDATA()
*/
+ @Override
public void startCDATA() throws SAXException {
if (_lexHandler != null) {
_lexHandler.startCDATA();
@@ -299,6 +308,7 @@
/**
* Implements org.xml.sax.ext.LexicalHandler.endCDATA()
*/
+ @Override
public void endCDATA() throws SAXException {
if (_lexHandler != null) {
_lexHandler.endCDATA();
@@ -309,6 +319,7 @@
* Implements org.xml.sax.ext.LexicalHandler.comment()
* Receieve notification of a comment
*/
+ @Override
public void comment(char[] ch, int start, int length)
throws SAXException
{
@@ -322,6 +333,7 @@
* Receive notification of ignorable whitespace in element
* content. Similar to characters(char[], int, int).
*/
+ @Override
public void ignorableWhitespace(char[] ch, int start, int length)
throws SAXException
{
@@ -332,6 +344,7 @@
* Implements org.xml.sax.ContentHandler.setDocumentLocator()
* Receive an object for locating the origin of SAX document events.
*/
+ @Override
public void setDocumentLocator(Locator locator) {
_locator = locator;
@@ -344,6 +357,7 @@
* Implements org.xml.sax.ContentHandler.skippedEntity()
* Receive notification of a skipped entity.
*/
+ @Override
public void skippedEntity(String name) throws SAXException {
_handler.skippedEntity(name);
}
@@ -352,6 +366,7 @@
* Implements org.xml.sax.ContentHandler.startPrefixMapping()
* Begin the scope of a prefix-URI Namespace mapping.
*/
+ @Override
public void startPrefixMapping(String prefix, String uri)
throws SAXException {
_handler.startPrefixMapping(prefix, uri);
@@ -361,6 +376,7 @@
* Implements org.xml.sax.ContentHandler.endPrefixMapping()
* End the scope of a prefix-URI Namespace mapping.
*/
+ @Override
public void endPrefixMapping(String prefix) throws SAXException {
_handler.endPrefixMapping(prefix);
}
@@ -368,6 +384,7 @@
/**
* Implements org.xml.sax.ext.LexicalHandler.startDTD()
*/
+ @Override
public void startDTD(String name, String publicId, String systemId)
throws SAXException
{
@@ -379,6 +396,7 @@
/**
* Implements org.xml.sax.ext.LexicalHandler.endDTD()
*/
+ @Override
public void endDTD() throws SAXException {
if (_lexHandler != null) {
_lexHandler.endDTD();
@@ -388,6 +406,7 @@
/**
* Implements org.xml.sax.ext.LexicalHandler.startEntity()
*/
+ @Override
public void startEntity(String name) throws SAXException {
if (_lexHandler != null) {
_lexHandler.startEntity(name);
@@ -397,6 +416,7 @@
/**
* Implements org.xml.sax.ext.LexicalHandler.endEntity()
*/
+ @Override
public void endEntity(String name) throws SAXException {
if (_lexHandler != null) {
_lexHandler.endEntity(name);
@@ -406,6 +426,7 @@
/**
* Implements org.xml.sax.DTDHandler.unparsedEntityDecl()
*/
+ @Override
public void unparsedEntityDecl(String name, String publicId,
String systemId, String notationName) throws SAXException
{
@@ -418,6 +439,7 @@
/**
* Implements org.xml.sax.DTDHandler.notationDecl()
*/
+ @Override
public void notationDecl(String name, String publicId, String systemId)
throws SAXException
{
@@ -429,6 +451,7 @@
/**
* Implements org.xml.sax.ext.DeclHandler.attributeDecl()
*/
+ @Override
public void attributeDecl(String eName, String aName, String type,
String valueDefault, String value) throws SAXException
{
@@ -440,6 +463,7 @@
/**
* Implements org.xml.sax.ext.DeclHandler.elementDecl()
*/
+ @Override
public void elementDecl(String name, String model)
throws SAXException
{
@@ -451,6 +475,7 @@
/**
* Implements org.xml.sax.ext.DeclHandler.externalEntityDecl()
*/
+ @Override
public void externalEntityDecl(String name, String publicId, String systemId)
throws SAXException
{
@@ -462,6 +487,7 @@
/**
* Implements org.xml.sax.ext.DeclHandler.externalEntityDecl()
*/
+ @Override
public void internalEntityDecl(String name, String value)
throws SAXException
{
diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java Tue May 23 13:19:17 2017 +0300
+++ b/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java Thu Jun 06 20:47:13 2013 +0200
@@ -100,10 +100,6 @@
public final class TransformerImpl extends Transformer
implements DOMCache, ErrorListener
{
- private final static String EMPTY_STRING = "";
- private final static String NO_STRING = "no";
- private final static String YES_STRING = "yes";
- private final static String XML_STRING = "xml";
private final static String LEXICAL_HANDLER_PROPERTY =
"http://xml.org/sax/properties/lexical-handler";
@@ -157,7 +153,7 @@
private TransletOutputHandlerFactory _tohFactory = null;
/**
- * A reference to a internal DOM represenation of the input.
+ * A reference to a internal DOM representation of the input.
*/
private DOM _dom = null;
@@ -224,7 +220,8 @@
public MessageHandler(ErrorListener errorListener) {
_errorListener = errorListener;
}
-
+
+ @Override
public void displayMessage(String msg) {
if(_errorListener == null) {
System.err.println(msg);
@@ -296,6 +293,7 @@
* @param result Will contain the output from the transformation
* @throws TransformerException
*/
+ @Override
public void transform(Source source, Result result)
throws TransformerException
{
@@ -438,7 +436,7 @@
// System Id may be in one of several forms, (1) a uri
// that starts with 'file:', (2) uri that starts with 'http:'
// or (3) just a filename on the local system.
- URL url = null;
+ URL url;
if (systemId.startsWith("file:")) {
// if StreamResult(File) or setSystemID(File) was used,
// the systemId will be URI encoded as a result of File.toURI(),
@@ -516,7 +514,7 @@
*/
private DOM getDOM(Source source) throws TransformerException {
try {
- DOM dom = null;
+ DOM dom;
if (source != null) {
DTMWSFilter wsfilter;
@@ -531,8 +529,7 @@
if (_dtmManager == null) {
_dtmManager =
- (XSLTCDTMManager)_tfactory.getDTMManagerClass()
- .newInstance();
+ _tfactory.createNewDTMManagerInstance();
}
dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true,
false, false, 0, hasIdCall);
@@ -654,8 +651,8 @@
}
} else if (source instanceof StAXSource) {
final StAXSource staxSource = (StAXSource)source;
- StAXEvent2SAX staxevent2sax = null;
- StAXStream2SAX staxStream2SAX = null;
+ StAXEvent2SAX staxevent2sax;
+ StAXStream2SAX staxStream2SAX;
if (staxSource.getXMLEventReader() != null) {
final XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
staxevent2sax = new StAXEvent2SAX(xmlEventReader);
@@ -750,6 +747,7 @@
*
* @return The error event handler currently in effect
*/
+ @Override
public ErrorListener getErrorListener() {
return _errorListener;
}
@@ -763,6 +761,7 @@
* @param listener The error event listener to use
* @throws IllegalArgumentException
*/
+ @Override
public void setErrorListener(ErrorListener listener)
throws IllegalArgumentException {
if (listener == null) {
@@ -812,6 +811,7 @@
*
* @return Properties in effect for this Transformer
*/
+ @Override
public Properties getOutputProperties() {
return (Properties) _properties.clone();
}
@@ -825,6 +825,7 @@
* @param name A non-null string that contains the name of the property
* @throws IllegalArgumentException if the property name is not known
*/
+ @Override
public String getOutputProperty(String name)
throws IllegalArgumentException
{
@@ -844,6 +845,7 @@
* @param properties The properties to use for the Transformer
* @throws IllegalArgumentException Never, errors are ignored
*/
+ @Override
public void setOutputProperties(Properties properties)
throws IllegalArgumentException
{
@@ -880,6 +882,7 @@
* @param value The value to assign to the property
* @throws IllegalArgumentException Never, errors are ignored
*/
+ @Override
public void setOutputProperty(String name, String value)
throws IllegalArgumentException
{
@@ -1149,6 +1152,7 @@
* @param name The name of the parameter
* @param value The value to assign to the parameter
*/
+ @Override
public void setParameter(String name, Object value) {
if (value == null) {
@@ -1172,6 +1176,7 @@
* Clear all parameters set with setParameter. Clears the translet's
* parameter stack.
*/
+ @Override
public void clearParameters() {
if (_isIdentity && _parameters != null) {
_parameters.clear();
@@ -1189,6 +1194,7 @@
* @param name The name of the parameter
* @return An object that contains the value assigned to the parameter
*/
+ @Override
public final Object getParameter(String name) {
if (_isIdentity) {
return (_parameters != null) ? _parameters.get(name) : null;
@@ -1204,6 +1210,7 @@
*
* @return The URLResolver object currently in use
*/
+ @Override
public URIResolver getURIResolver() {
return _uriResolver;
}
@@ -1214,6 +1221,7 @@
*
* @param resolver The URIResolver to use in document()
*/
+ @Override
public void setURIResolver(URIResolver resolver) {
_uriResolver = resolver;
}
@@ -1232,6 +1240,7 @@
* @param href The href argument passed to the document function.
* @param translet A reference to the translet requesting the document
*/
+ @Override
public DOM retrieveDocument(String baseURI, String href, Translet translet) {
try {
// Argument to document function was: document('');
@@ -1274,6 +1283,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void error(TransformerException e)
throws TransformerException
{
@@ -1302,6 +1312,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void fatalError(TransformerException e)
throws TransformerException
{
@@ -1330,6 +1341,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (never does in our case).
*/
+ @Override
public void warning(TransformerException e)
throws TransformerException
{
@@ -1350,6 +1362,7 @@
* created
* @since 1.5
*/
+ @Override
public void reset() {
_method = null;
diff -r 9849cc530d6d -r ade6118af296 drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java Tue May 23 13:19:17 2017 +0300
+++ b/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java Thu Jun 06 20:47:13 2013 +0200
@@ -20,15 +20,6 @@
package com.sun.org.apache.xerces.internal.utils;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.util.Properties;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
/**
* This class is duplicated for each JAXP subpackage so keep it in sync.
* It is package private and therefore is not exposed as part of the JAXP
@@ -51,113 +42,9 @@
private static final String JAXP_INTERNAL = "com.sun.org.apache";
private static final String STAX_INTERNAL = "com.sun.xml.internal";
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties";
-
/** Set to true for debugging */
private static final boolean DEBUG = isDebugEnabled();
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /** cache the contents of the xerces.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXercesProperties = null;
-
- /***
- * Cache the time stamp of the xerces.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * DTMManager
.
* This static method creates a new factory instance
- * This method uses the following ordered lookup procedure to determine
- * the DTMManager
implementation class to
- * load:
- * com.sun.org.apache.xml.internal.dtm.DTMManager
system
- * property.
- * META-INF/services/com.sun.org.apache.xml.internal.dtm.DTMManager
- * in jars available to the runtime.
- * DTMManager
classname, which is
+ * using the default DTMManager
implementation, which is
* com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault
.
*