--- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java 2015-09-30 14:27:42.396523042 -0700 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java 2015-09-30 14:27:42.288517669 -0700 @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -48,7 +48,6 @@ import com.sun.org.apache.xerces.internal.util.FeatureState; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; -import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; @@ -759,154 +758,172 @@ } // parse(boolean):boolean - /** - * Returns the state of a feature. - * - * @param featureId The feature identifier. - * @return true if the feature is supported - * - * @throws XMLConfigurationException Thrown for configuration error. - * In general, components should - * only throw this exception if - * it is really - * a critical error. - */ - public FeatureState getFeatureState(String featureId) - throws XMLConfigurationException { - // make this feature special - if (featureId.equals(PARSER_SETTINGS)){ - return FeatureState.is(fConfigUpdated); - } - return super.getFeatureState(featureId); + /** + * Stops the parsing process. + */ + @Override + public boolean stop() { + //no-op. this feature is implemented in the specific SAX parser. + return false; + } - } // getFeature(String):boolean + /** + * Resumes parsing after it was stopped by calling the stop method. + */ + @Override + public boolean resume() { + //no-op. this feature is implemented in the specific SAX parser. + return false; + } - /** - * Set the state of a feature. - * - * Set the state of any feature in a SAX2 parser. The parser - * might not recognize the feature, and if it does recognize - * it, it might not be able to fulfill the request. - * - * @param featureId The unique identifier (URI) of the feature. - * @param state The requested state of the feature (true or false). - * - * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the - * requested feature is not known. - */ - public void setFeature(String featureId, boolean state) - throws XMLConfigurationException { - fConfigUpdated = true; - // forward to every XML 1.0 component - int count = fComponents.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fComponents.get(i); - c.setFeature(featureId, state); - } - // forward it to common components - count = fCommonComponents.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fCommonComponents.get(i); - c.setFeature(featureId, state); - } + /** + * Returns the state of a feature. + * + * @param featureId The feature identifier. + * @return true if the feature is supported + * + * @throws XMLConfigurationException Thrown for configuration error. + * In general, components should + * only throw this exception if + * it is really + * a critical error. + */ + public FeatureState getFeatureState(String featureId) + throws XMLConfigurationException { + // make this feature special + if (featureId.equals(PARSER_SETTINGS)){ + return FeatureState.is(fConfigUpdated); + } + return super.getFeatureState(featureId); - // forward to every XML 1.1 component - count = fXML11Components.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fXML11Components.get(i); - try{ - c.setFeature(featureId, state); - } - catch (Exception e){ - // no op - } - } - // save state if noone "objects" - super.setFeature(featureId, state); + } // getFeature(String):boolean - } // setFeature(String,boolean) + /** + * Set the state of a feature. + * + * Set the state of any feature in a SAX2 parser. The parser + * might not recognize the feature, and if it does recognize + * it, it might not be able to fulfill the request. + * + * @param featureId The unique identifier (URI) of the feature. + * @param state The requested state of the feature (true or false). + * + * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the + * requested feature is not known. + */ + public void setFeature(String featureId, boolean state) + throws XMLConfigurationException { + fConfigUpdated = true; + // forward to every XML 1.0 component + int count = fComponents.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fComponents.get(i); + c.setFeature(featureId, state); + } + // forward it to common components + count = fCommonComponents.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fCommonComponents.get(i); + c.setFeature(featureId, state); + } - /** - * setProperty - * - * @param propertyId - * @param value - */ - public void setProperty(String propertyId, Object value) - throws XMLConfigurationException { - fConfigUpdated = true; - // forward to every XML 1.0 component - int count = fComponents.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fComponents.get(i); - c.setProperty(propertyId, value); - } - // forward it to every common Component - count = fCommonComponents.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fCommonComponents.get(i); - c.setProperty(propertyId, value); - } - // forward it to every XML 1.1 component - count = fXML11Components.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fXML11Components.get(i); - try{ - c.setProperty(propertyId, value); - } - catch (Exception e){ - // ignore it - } - } + // forward to every XML 1.1 component + count = fXML11Components.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fXML11Components.get(i); + try{ + c.setFeature(featureId, state); + } + catch (Exception e){ + // no op + } + } + // save state if noone "objects" + super.setFeature(featureId, state); - // store value if noone "objects" - super.setProperty(propertyId, value); + } // setFeature(String,boolean) - } // setProperty(String,Object) + /** + * setProperty + * + * @param propertyId + * @param value + */ + public void setProperty(String propertyId, Object value) + throws XMLConfigurationException { + fConfigUpdated = true; + // forward to every XML 1.0 component + int count = fComponents.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fComponents.get(i); + c.setProperty(propertyId, value); + } + // forward it to every common Component + count = fCommonComponents.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fCommonComponents.get(i); + c.setProperty(propertyId, value); + } + // forward it to every XML 1.1 component + count = fXML11Components.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fXML11Components.get(i); + try{ + c.setProperty(propertyId, value); + } + catch (Exception e){ + // ignore it + } + } + // store value if noone "objects" + super.setProperty(propertyId, value); - /** Returns the locale. */ - public Locale getLocale() { - return fLocale; - } // getLocale():Locale + } // setProperty(String,Object) - /** - * reset all XML 1.0 components before parsing and namespace context - */ - protected void reset() throws XNIException { - int count = fComponents.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fComponents.get(i); - c.reset(this); - } - } // reset() + /** Returns the locale. */ + public Locale getLocale() { + return fLocale; + } // getLocale():Locale - /** - * reset all common components before parsing - */ - protected void resetCommon() throws XNIException { - // reset common components - int count = fCommonComponents.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fCommonComponents.get(i); - c.reset(this); - } + /** + * reset all XML 1.0 components before parsing and namespace context + */ + protected void reset() throws XNIException { + int count = fComponents.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fComponents.get(i); + c.reset(this); + } - } // resetCommon() + } // reset() - /** - * reset all components before parsing and namespace context - */ - protected void resetXML11() throws XNIException { - // reset every component - int count = fXML11Components.size(); - for (int i = 0; i < count; i++) { - XMLComponent c = (XMLComponent) fXML11Components.get(i); - c.reset(this); - } + /** + * reset all common components before parsing + */ + protected void resetCommon() throws XNIException { + // reset common components + int count = fCommonComponents.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fCommonComponents.get(i); + c.reset(this); + } + + } // resetCommon() + + /** + * reset all components before parsing and namespace context + */ + protected void resetXML11() throws XNIException { + // reset every component + int count = fXML11Components.size(); + for (int i = 0; i < count; i++) { + XMLComponent c = (XMLComponent) fXML11Components.get(i); + c.reset(this); + } - } // resetXML11() + } // resetXML11() /** * Configures the XML 1.1 pipeline. @@ -956,14 +973,14 @@ fLastComponent = fXML11NSDTDValidator; } else { - // create components - if (fXML11DocScanner == null) { - // non namespace document pipeline - fXML11DocScanner = new XML11DocumentScannerImpl(); - addXML11Component(fXML11DocScanner); - fXML11DTDValidator = new XML11DTDValidator(); - addXML11Component(fXML11DTDValidator); - } + // create components + if (fXML11DocScanner == null) { + // non namespace document pipeline + fXML11DocScanner = new XML11DocumentScannerImpl(); + addXML11Component(fXML11DocScanner); + fXML11DTDValidator = new XML11DTDValidator(); + addXML11Component(fXML11DTDValidator); + } if (fCurrentScanner != fXML11DocScanner) { fCurrentScanner = fXML11DocScanner; setProperty(DOCUMENT_SCANNER, fXML11DocScanner);