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

XML parser omits characters callback to ContentHandler since 6u18

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6u18
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      1.4
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        Starting with update 18 of JDK 1.6.0, the bundled XML Parser is omitting a characters callback to the content handler in the following scenario:

        -Using XMLReader
        -Set a javax.xml.validation.Schema on the XMLReader
        -The schema contains an xs:any with processContents="skip"
        -Parse an XML document which has an element containing a text node for the any
        -The characters method on the ContentHandler is not invoked for the text contianed in the element

        If the Schema isn't set on the SAXParserFactory then the characters method is called as expected. Also if the ProcessContents="skip" is removed, then the characters method is also called as expected. Finally in any JDK version previous to jdk1.6.0_18 the characters method is always called as expected.

        A testcase has been attached.

        How to reproduce:
        Extract the attachment of this CR and go to the folder called xmlparser.characters.issue.
        Run java test/Test with the JDK of your choice. 6u17 looks fine, but with 6u18 through 6u20 the issue is reproducible.

        $ java -showversion test/Test
        java version "1.6.0_17"
        Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
        Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)

        Parse InputStream:
        Characters called:

        Characters called: text
        Characters called:

        $ java -showversion test/Test
        java version "1.6.0_18"
        Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
        Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)

        Parse InputStream:

        $ java -showversion test/Test
        java version "1.6.0_19"
        Java(TM) SE Runtime Environment (build 1.6.0_19-b04)
        Java HotSpot(TM) Server VM (build 16.2-b04, mixed mode)

        Parse InputStream:

        $ java -showversion test/Test
        java version "1.6.0_20"
        Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
        Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

        Parse InputStream:

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  joehw Joe Wang
                  Reporter:
                  jloefflm Johann Löfflmann (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: