--- old/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java 2013-06-03 18:25:36.000000000 +0200 +++ new/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java 2013-06-03 18:25:35.000000000 +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 XALAN_INTERNAL = "com.sun.org.apache.xalan.internal";
private static final String XERCES_INTERNAL = "com.sun.org.apache.xerces.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() {
- return getDTMManagerClass(true);
- }
-
- public static Class getDTMManagerClass(boolean useServicesMechanism) {
- Class mgrClass = null;
- if (useServicesMechanism) {
- mgrClass = ObjectFactory.lookUpFactoryClass(DEFAULT_PROP_NAME,
- null,
- DEFAULT_CLASS_NAME);
- } else {
- try {
- mgrClass = ObjectFactory.findProviderClass(DEFAULT_CLASS_NAME, true);
- } catch (Exception e) {
- //will not happen
- }
- }
- // 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();
+ }
/**
* Get an instance of a DTM, loaded with the content from the
@@ -146,6 +108,7 @@
*
* @return a non-null DTM reference.
*/
+ @Override
public DTM getDTM(Source source, boolean unique,
DTMWSFilter whiteSpaceFilter, boolean incremental,
boolean doIndexing)
--- old/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java 2013-06-03 18:25:40.000000000 +0200
+++ new/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java 2013-06-03 18:25:40.000000000 +0200
@@ -23,6 +23,17 @@
package com.sun.org.apache.xalan.internal.xsltc.trax;
+import com.sun.org.apache.xalan.internal.XalanConstants;
+import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
+import com.sun.org.apache.xml.internal.utils.StopParseException;
+import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -37,11 +48,9 @@
import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-
import javax.xml.XMLConstants;
-import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.Source;
@@ -58,23 +67,9 @@
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TemplatesHandler;
import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stax.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stax.*;
-
-import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler;
-import com.sun.org.apache.xml.internal.utils.StopParseException;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
import org.xml.sax.InputSource;
import org.xml.sax.XMLFilter;
import org.xml.sax.XMLReader;
@@ -201,14 +196,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; @@ -246,7 +233,6 @@ } private TransformerFactoryImpl(boolean useServicesMechanism) { - this.m_DTMManagerClass = XSLTCDTMManager.getDTMManagerClass(useServicesMechanism); this._useServicesMechanism = useServicesMechanism; String defaultAccess = XalanConstants.EXTERNAL_ACCESS_DEFAULT; @@ -270,6 +256,7 @@ * @param listener The error listener to use with the TransformerFactory * @throws IllegalArgumentException */ + @Override public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { @@ -287,6 +274,7 @@ * * @return The error listener used with the TransformerFactory */ + @Override public ErrorListener getErrorListener() { return _errorListener; } @@ -299,6 +287,7 @@ * @return An object representing the attribute value * @throws IllegalArgumentException */ + @Override public Object getAttribute(String name) throws IllegalArgumentException { @@ -338,6 +327,7 @@ * @param value An object representing the attribute value * @throws IllegalArgumentException */ + @Override public void setAttribute(String name, Object value) throws IllegalArgumentException { @@ -460,6 +450,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 {
@@ -504,6 +495,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 = {
@@ -555,6 +547,7 @@
* @return The URLResolver used for this TransformerFactory and all
* Templates and Transformer objects created using this factory
*/
+ @Override
public URIResolver getURIResolver() {
return _uriResolver;
}
@@ -569,6 +562,7 @@
* @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;
}
@@ -588,13 +582,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;
/**
@@ -676,6 +671,7 @@
* @return A Transformer object that simply copies the source to the result.
* @throws TransformerConfigurationException
*/
+ @Override
public Transformer newTransformer()
throws TransformerConfigurationException
{
@@ -701,6 +697,7 @@
* @return A Templates object that can be used to create Transformers.
* @throws TransformerConfigurationException
*/
+ @Override
public Transformer newTransformer(Source source) throws
TransformerConfigurationException
{
@@ -764,6 +761,7 @@
* @return A Templates object that can be used to create Transformers.
* @throws TransformerConfigurationException
*/
+ @Override
public Templates newTemplates(Source source)
throws TransformerConfigurationException
{
@@ -797,7 +795,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)
@@ -919,7 +917,7 @@
// Check that the transformation went well before returning
if (bytecodes == null) {
Vector errs = xsltc.getErrors();
- ErrorMsg err = null;
+ ErrorMsg err;
if (errs != null) {
err = (ErrorMsg)errs.elementAt(errs.size()-1);
} else {
@@ -964,6 +962,7 @@
* @return A TemplatesHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TemplatesHandler newTemplatesHandler()
throws TransformerConfigurationException
{
@@ -983,6 +982,7 @@
* @return A TransformerHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TransformerHandler newTransformerHandler()
throws TransformerConfigurationException
{
@@ -1003,6 +1003,7 @@
* @return A TransformerHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TransformerHandler newTransformerHandler(Source src)
throws TransformerConfigurationException
{
@@ -1023,6 +1024,7 @@
* @return A TransformerHandler object that can handle SAX events
* @throws TransformerConfigurationException
*/
+ @Override
public TransformerHandler newTransformerHandler(Templates templates)
throws TransformerConfigurationException
{
@@ -1040,6 +1042,7 @@
* @return An XMLFilter object, or null if this feature is not supported.
* @throws TransformerConfigurationException
*/
+ @Override
public XMLFilter newXMLFilter(Source src)
throws TransformerConfigurationException
{
@@ -1057,6 +1060,7 @@
* @return An XMLFilter object, or null if this feature is not supported.
* @throws TransformerConfigurationException
*/
+ @Override
public XMLFilter newXMLFilter(Templates templates)
throws TransformerConfigurationException
{
@@ -1088,6 +1092,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void error(TransformerException e)
throws TransformerException
{
@@ -1116,6 +1121,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void fatalError(TransformerException e)
throws TransformerException
{
@@ -1144,6 +1150,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (never does in our case).
*/
+ @Override
public void warning(TransformerException e)
throws TransformerException
{
@@ -1167,6 +1174,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) {
@@ -1253,7 +1261,7 @@
Vector bytecodes = new Vector();
int fileLength = (int)transletFile.length();
if (fileLength > 0) {
- FileInputStream input = null;
+ FileInputStream input;
try {
input = new FileInputStream(transletFile);
}
@@ -1285,6 +1293,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));
@@ -1348,7 +1357,7 @@
xslFile = new File(xslFileName);
// Construct the path for the jar file
- String jarPath = null;
+ String jarPath;
if (_destinationDirectory != null)
jarPath = _destinationDirectory + "/" + _jarFileName;
else {
@@ -1373,7 +1382,7 @@
}
// Create a ZipFile object for the jar file
- ZipFile jarFile = null;
+ ZipFile jarFile;
try {
jarFile = new ZipFile(file);
}
@@ -1491,7 +1500,7 @@
if (file.exists())
return systemId;
else {
- URL url = null;
+ URL url;
try {
url = new URL(systemId);
}
@@ -1510,9 +1519,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.createNewDTMManagerInstance();
}
}
--- old/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java 2013-06-03 18:25:41.000000000 +0200
+++ new/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java 2013-06-03 18:25:41.000000000 +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
{
--- old/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java 2013-06-03 18:25:42.000000000 +0200
+++ new/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java 2013-06-03 18:25:42.000000000 +0200
@@ -99,10 +99,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";
@@ -156,7 +152,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;
@@ -238,6 +234,7 @@
_errorListener = errorListener;
}
+ @Override
public void displayMessage(String msg) {
if(_errorListener == null) {
System.err.println(msg);
@@ -323,6 +320,7 @@
* @param result Will contain the output from the transformation
* @throws TransformerException
*/
+ @Override
public void transform(Source source, Result result)
throws TransformerException
{
@@ -465,7 +463,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(),
@@ -537,7 +535,7 @@
*/
private DOM getDOM(Source source) throws TransformerException {
try {
- DOM dom = null;
+ DOM dom;
if (source != null) {
DTMWSFilter wsfilter;
@@ -552,8 +550,7 @@
if (_dtmManager == null) {
_dtmManager =
- (XSLTCDTMManager)_tfactory.getDTMManagerClass()
- .newInstance();
+ _tfactory.createNewDTMManagerInstance();
_dtmManager.setServicesMechnism(_useServicesMechanism);
}
dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true,
@@ -676,8 +673,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);
@@ -770,6 +767,7 @@
*
* @return The error event handler currently in effect
*/
+ @Override
public ErrorListener getErrorListener() {
return _errorListener;
}
@@ -783,6 +781,7 @@
* @param listener The error event listener to use
* @throws IllegalArgumentException
*/
+ @Override
public void setErrorListener(ErrorListener listener)
throws IllegalArgumentException {
if (listener == null) {
@@ -830,7 +829,7 @@
// Return a 'null' string if no CDATA section elements were specified
if (cdata == null) return null;
- StringBuffer result = new StringBuffer();
+ final StringBuilder result = new StringBuilder();
// Get an enumeration of all the elements in the hashtable
Enumeration elements = cdata.keys();
@@ -857,6 +856,7 @@
*
* @return Properties in effect for this Transformer
*/
+ @Override
public Properties getOutputProperties() {
return (Properties) _properties.clone();
}
@@ -870,6 +870,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
{
@@ -889,6 +890,7 @@
* @param properties The properties to use for the Transformer
* @throws IllegalArgumentException Never, errors are ignored
*/
+ @Override
public void setOutputProperties(Properties properties)
throws IllegalArgumentException
{
@@ -925,6 +927,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
{
@@ -1205,6 +1208,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) {
@@ -1228,6 +1232,7 @@
* Clear all parameters set with setParameter. Clears the translet's
* parameter stack.
*/
+ @Override
public void clearParameters() {
if (_isIdentity && _parameters != null) {
_parameters.clear();
@@ -1245,6 +1250,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;
@@ -1260,6 +1266,7 @@
*
* @return The URLResolver object currently in use
*/
+ @Override
public URIResolver getURIResolver() {
return _uriResolver;
}
@@ -1270,6 +1277,7 @@
*
* @param resolver The URIResolver to use in document()
*/
+ @Override
public void setURIResolver(URIResolver resolver) {
_uriResolver = resolver;
}
@@ -1288,6 +1296,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('');
@@ -1330,6 +1339,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void error(TransformerException e)
throws TransformerException
{
@@ -1358,6 +1368,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (always does in our case).
*/
+ @Override
public void fatalError(TransformerException e)
throws TransformerException
{
@@ -1386,6 +1397,7 @@
* @throws TransformerException if the application chooses to discontinue
* the transformation (never does in our case).
*/
+ @Override
public void warning(TransformerException e)
throws TransformerException
{
@@ -1406,6 +1418,7 @@
* created
* @since 1.5
*/
+ @Override
public void reset() {
_method = null;
--- old/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java 2013-06-03 18:25:43.000000000 +0200
+++ new/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java 2013-06-03 18:25:43.000000000 +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
@@ -50,113 +41,9 @@
//
private static final String DEFAULT_INTERNAL_CLASSES = "com.sun.org.apache.";
- // 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
.
*