src/java.base/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java
author redestad
Thu, 13 Dec 2018 15:31:05 +0100
changeset 53018 8bf9268df0e2
parent 52825 2077a5437d43
permissions -rw-r--r--
8215281: Use String.isEmpty() when applicable in java.base Reviewed-by: dfuchs, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     1
/*
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
     2
 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     4
 *
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    10
 *
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    15
 * accompanied this code).
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    16
 *
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    20
 *
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    23
 * questions.
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    24
 */
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    25
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    26
package jdk.internal.util.xml;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    27
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    28
import java.io.*;
48252
77b88d8f8380 8183743: Umbrella: add overloads that take a Charset parameter
joehw
parents: 47216
diff changeset
    29
import java.nio.charset.Charset;
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    30
import java.util.InvalidPropertiesFormatException;
21303
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
    31
import java.util.Map.Entry;
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    32
import java.util.Properties;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    33
import jdk.internal.org.xml.sax.Attributes;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    34
import jdk.internal.org.xml.sax.InputSource;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    35
import jdk.internal.org.xml.sax.SAXException;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    36
import jdk.internal.org.xml.sax.SAXParseException;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    37
import jdk.internal.org.xml.sax.helpers.DefaultHandler;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    38
import jdk.internal.util.xml.impl.SAXParserImpl;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    39
import jdk.internal.util.xml.impl.XMLStreamWriterImpl;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    40
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    41
/**
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    42
 * A class used to aid in Properties load and save in XML. This class is
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    43
 * re-implemented using a subset of SAX
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    44
 *
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    45
 * @author Joe Wang
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 24373
diff changeset
    46
 * @since 1.8
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    47
 */
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    48
public class PropertiesDefaultHandler extends DefaultHandler {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    49
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    50
    // Elements specified in the properties.dtd
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    51
    private static final String ELEMENT_ROOT = "properties";
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    52
    private static final String ELEMENT_COMMENT = "comment";
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    53
    private static final String ELEMENT_ENTRY = "entry";
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    54
    private static final String ATTR_KEY = "key";
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    55
    // The required DTD URI for exported properties
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    56
    private static final String PROPS_DTD_DECL =
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
    57
        "<!DOCTYPE properties SYSTEM \"http://java.sun.com/dtd/properties.dtd\">";
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    58
    private static final String PROPS_DTD_URI =
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
    59
        "http://java.sun.com/dtd/properties.dtd";
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    60
    private static final String PROPS_DTD =
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
    61
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    62
            + "<!-- DTD for properties -->"
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    63
            + "<!ELEMENT properties ( comment?, entry* ) >"
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    64
            + "<!ATTLIST properties"
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    65
            + " version CDATA #FIXED \"1.0\">"
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    66
            + "<!ELEMENT comment (#PCDATA) >"
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    67
            + "<!ELEMENT entry (#PCDATA) >"
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    68
            + "<!ATTLIST entry "
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    69
            + " key CDATA #REQUIRED>";
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    70
    /**
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    71
     * Version number for the format of exported properties files.
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    72
     */
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    73
    private static final String EXTERNAL_XML_VERSION = "1.0";
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    74
    private Properties properties;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    75
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    76
    public void load(Properties props, InputStream in)
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    77
        throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    78
    {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    79
        this.properties = props;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    80
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    81
        try {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    82
            SAXParser parser = new SAXParserImpl();
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    83
            parser.parse(in, this);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    84
        } catch (SAXException saxe) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    85
            throw new InvalidPropertiesFormatException(saxe);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    86
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    87
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    88
        /**
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    89
         * String xmlVersion = propertiesElement.getAttribute("version"); if
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    90
         * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    91
         * InvalidPropertiesFormatException( "Exported Properties file format
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    92
         * version " + xmlVersion + " is not supported. This java installation
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    93
         * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    94
         * " may need to install a newer version of JDK.");
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    95
         */
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    96
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    97
48252
77b88d8f8380 8183743: Umbrella: add overloads that take a Charset parameter
joehw
parents: 47216
diff changeset
    98
    public void store(Properties props, OutputStream os, String comment, Charset charset)
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
    99
        throws IOException
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   100
    {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   101
        try {
48252
77b88d8f8380 8183743: Umbrella: add overloads that take a Charset parameter
joehw
parents: 47216
diff changeset
   102
            XMLStreamWriter writer = new XMLStreamWriterImpl(os, charset);
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   103
            writer.writeStartDocument();
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   104
            writer.writeDTD(PROPS_DTD_DECL);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   105
            writer.writeStartElement(ELEMENT_ROOT);
53018
8bf9268df0e2 8215281: Use String.isEmpty() when applicable in java.base
redestad
parents: 52825
diff changeset
   106
            if (comment != null && !comment.isEmpty()) {
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   107
                writer.writeStartElement(ELEMENT_COMMENT);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   108
                writer.writeCharacters(comment);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   109
                writer.writeEndElement();
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   110
            }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   111
21303
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   112
            synchronized(props) {
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   113
                for (Entry<Object, Object> e : props.entrySet()) {
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   114
                    final Object k = e.getKey();
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   115
                    final Object v = e.getValue();
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   116
                    if (k instanceof String && v instanceof String) {
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   117
                        writer.writeStartElement(ELEMENT_ENTRY);
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   118
                        writer.writeAttribute(ATTR_KEY, (String)k);
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   119
                        writer.writeCharacters((String)v);
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   120
                        writer.writeEndElement();
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   121
                    }
24143f06640d 8016344: (props) Properties.storeToXML behaviour has changed from JDK 6 to 7
dfuchs
parents: 14908
diff changeset
   122
                }
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   123
            }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   124
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   125
            writer.writeEndElement();
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   126
            writer.writeEndDocument();
24373
d20f4a10c235 8043119: (props) Properties.storeToXML closes output stream
alanb
parents: 23010
diff changeset
   127
            writer.flush();
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   128
        } catch (XMLStreamException e) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   129
            if (e.getCause() instanceof UnsupportedEncodingException) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   130
                throw (UnsupportedEncodingException) e.getCause();
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   131
            }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   132
            throw new IOException(e);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   133
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   134
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   135
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   136
    ////////////////////////////////////////////////////////////////////
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   137
    // Validate while parsing
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   138
    ////////////////////////////////////////////////////////////////////
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   139
    static final String ALLOWED_ELEMENTS = "comment, entry";
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 25859
diff changeset
   140
    static final String ALLOWED_COMMENT = "comment";
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   141
    ////////////////////////////////////////////////////////////////////
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   142
    // Handler methods
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   143
    ////////////////////////////////////////////////////////////////////
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   144
    StringBuilder buf = new StringBuilder();
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   145
    boolean sawRoot = false; // whether a valid root element exists
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   146
    boolean sawComment = false;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   147
    boolean validEntry = false;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   148
    String key;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   149
    String rootElm;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   150
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   151
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   152
    public void startElement(String uri, String localName, String qName, Attributes attributes)
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   153
        throws SAXException
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   154
    {
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   155
        if (sawRoot) {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   156
            if (!ALLOWED_ELEMENTS.contains(qName)) {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   157
                fatalError(new SAXParseException("Element type \"" + qName + "\" must be declared.", null));
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   158
            }
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   159
        } else {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   160
            // check whether the root has been declared in the DTD
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   161
            if (rootElm == null) {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   162
                fatalError(new SAXParseException("An XML properties document must contain"
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   163
                    + " the DOCTYPE declaration as defined by java.util.Properties.", null));
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   164
            }
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   165
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   166
            // check whether the element name matches the declaration
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   167
            if (!rootElm.equals(qName)) {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   168
                fatalError(new SAXParseException("Document root element \"" + qName
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   169
                    + "\", must match DOCTYPE root \"" + rootElm + "\"", null));
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   170
            }
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   171
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   172
            // this is a valid root element
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   173
            sawRoot = true;
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   174
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   175
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   176
        if (qName.equals(ELEMENT_ENTRY)) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   177
            validEntry = true;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   178
            key = attributes.getValue(ATTR_KEY);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   179
            if (key == null) {
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   180
                fatalError(new SAXParseException("Attribute \"key\" is required and " +
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   181
                    "must be specified for element type \"entry\"", null));
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   182
            }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   183
        } else if (qName.equals(ALLOWED_COMMENT)) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   184
            if (sawComment) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   185
                fatalError(new SAXParseException("Only one comment element may be allowed. "
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   186
                    + "The content of element type \"properties\" must match \"(comment?,entry*)\"", null));
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   187
            }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   188
            sawComment = true;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   189
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   190
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   191
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   192
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   193
    public void characters(char[] ch, int start, int length) throws SAXException {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   194
        if (validEntry) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   195
            buf.append(ch, start, length);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   196
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   197
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   198
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   199
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   200
    public void endElement(String uri, String localName, String qName) throws SAXException {
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   201
        if (!ALLOWED_ELEMENTS.contains(qName) && !ELEMENT_ROOT.equals(qName)) {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   202
            fatalError(new SAXParseException("Element: " + qName +
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   203
                " is invalid, must match  \"(comment?,entry*)\".", null));
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   204
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   205
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   206
        if (validEntry) {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   207
            properties.setProperty(key, buf.toString());
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   208
            buf.delete(0, buf.length());
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   209
            validEntry = false;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   210
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   211
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   212
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   213
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   214
    public InputSource resolveEntity(String pubid, String sysid)
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   215
        throws SAXException, IOException {
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   216
        {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   217
            if (sysid.equals(PROPS_DTD_URI)) {
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   218
                // The properties DTD is known to the handler, no need to parse it
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   219
                return null;
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   220
            }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   221
            throw new SAXException("Invalid system identifier: " + sysid);
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   222
        }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   223
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   224
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   225
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   226
    public void error(SAXParseException x) throws SAXException {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   227
        throw x;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   228
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   229
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   230
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   231
    public void fatalError(SAXParseException x) throws SAXException {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   232
        throw x;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   233
    }
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   234
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   235
    @Override
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   236
    public void warning(SAXParseException x) throws SAXException {
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   237
        throw x;
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   238
    }
52825
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   239
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   240
    // SAX2 extension from DTDHandler
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   241
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   242
    @Override
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   243
    public void startDTD (String name, String publicId, String systemId) throws SAXException
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   244
    {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   245
        if (!ELEMENT_ROOT.equals(name) || !PROPS_DTD_URI.equals(systemId)) {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   246
            fatalError(new SAXParseException("An XML properties document must contain"
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   247
                + " the DOCTYPE declaration as defined by java.util.Properties.", null));
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   248
        }
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   249
        rootElm = name;
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   250
    }
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   251
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   252
    @Override
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   253
    public void startInternalSub () throws SAXException
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   254
    {
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   255
        fatalError(new SAXParseException("Internal DTD subset is not allowed. " +
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   256
            "The Properties XML document must have the following DOCTYPE declaration: \n" +
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   257
            PROPS_DTD_DECL, null));
2077a5437d43 8213325: (props) Properties.loadFromXML does not fully comply with the spec
joehw
parents: 48252
diff changeset
   258
    }
14908
1d01112e9ce5 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present
joehw
parents:
diff changeset
   259
}