Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5049252

DOMConfiguration param. from getParameterNames() not recognized by getParameter

    XMLWordPrintable

Details

    • 1.3
    • x86
    • windows_xp

    Backports

      Description

        Name: rmT116609 Date: 05/18/2004


        FULL PRODUCT VERSION :
        java version "1.5.0-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
        Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows XP [Version 5.1.2600]

        A DESCRIPTION OF THE PROBLEM :
        DOMConfiguration.getParameterNames() returns parameters names that
        DOMConfiguration.getParameter(...) does not recognize (even for the same
        DOMConfiguration instance).

        Something seems out of sync.


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        (Compile and run test case below.)

        Call getParameterNames to get a list of parameter names known to the
        DOM implementation. Call getParameter( name ) to get the current setting
        of each supposedly known parameter.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        getParameter should never reject a parameter name from getParameterNames
        as unknown (or getParameterNames should never return an unknown
        parameter).

        ACTUAL -
        (See exact error below.)

        getParameter throws a FEATURE_NOT_FOUND DOMException, saying it
        doesn't recognize the feature name even though the feature name came
        right from the DOM implementation.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://xml.org/sax/features/validation is not recognized.
        at com.sun.org.apache.xerces.internal.dom.DOMConfigurationImpl.getParameter(DOMConfigurationImpl.java:863)
        at prototype.ExploreDOM.main(Bug.java:29)
        Exception in thread "main"


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        package prototype;

        import javax.xml.parsers.*;

        import org.w3c.dom.*;


        class Bug
        {

            public static void main( String[] args )
        throws Exception
            {
        DocumentBuilder builder =
        DocumentBuilderFactory.newInstance().newDocumentBuilder();

        DOMConfiguration config = builder.newDocument().getDomConfig();
        {
        DOMStringList names = config.getParameterNames();
        for ( int sx = 0; sx < names.getLength(); sx++ ) {
        String name = names.item( sx );
        Object value = config.getParameter( name );
        // Throws exception:
        // org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://xml.org/sax/features/validation is not recognized.
        // at com.sun.org.apache.xerces.internal.dom.DOMConfigurationImpl.getParameter(DOMConfigurationImpl.java:863)
        // at prototype.ExploreDOM.main(Bug.java:29)
        }
        }
            } // main( String[] )


        } // class Bug

        ---------- END SOURCE ----------
        (Incident Review ID: 270140)
        ======================================================================

        Attachments

          Issue Links

            Activity

              People

                vkorcl Venugopal K (Inactive)
                rmandalasunw Ranjith Mandala (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: