United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8014891 Redundant setting of external access properties in setFeatures
JDK-8014891 : Redundant setting of external access properties in setFeatures

Details
Type:
Bug
Submit Date:
2013-05-20
Status:
Resolved
Updated Date:
2013-05-21
Project Name:
JDK
Resolved Date:
2013-05-20
Component:
xml
OS:
generic
Sub-Component:
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u40,8-pool
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
There are properties incorrectky set in method com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl#setFeatures:

{code}
    private void setFeatures(Hashtable features)
        throws SAXNotSupportedException, SAXNotRecognizedException {
        if (features != null) {
            Iterator entries = features.entrySet().iterator();
            while (entries.hasNext()) {
                Map.Entry entry = (Map.Entry) entries.next();
                String feature = (String) entry.getKey();
                boolean value = ((Boolean) entry.getValue()).booleanValue();
                domParser.setFeature(feature, value);
                if (feature.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
                    domParser.setProperty(ACCESS_EXTERNAL_DTD, "");
                    domParser.setProperty(ACCESS_EXTERNAL_SCHEMA, "");
                }
            }
        }
    }
{code}

Actual value isn't used in the condition. If XMLConstants.FEATURE_SECURE_PROCESSING is explicitly turned of (value = false), restrictions are set anyway
                                    

Comments
Redundant settings, should be removed. It was already removed in jaxp standalone, but was mistakenly left in the JDK patch.
                                     
2013-05-20
URL:   http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/a7cec93e4682
User:  joehw
Date:  2013-05-20 23:12:37 +0000

                                     
2013-05-20



Hardware and Software, Engineered to Work Together