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

Questionable code for cloneMap in NamedNodeMapImpl.java (Invalid XML written)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Incomplete
    • Affects Version/s: 11
    • Fix Version/s: None
    • Component/s: xml
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      We have detected that an invalid XML file is written when using DOMNormalizer to normalize a document.

      If you look at following code:
      https://github.com/openjdk/jdk/blob/master/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java#L572:L583

      It is totally different from the implementation in Xerces.
      Is there any reason why this code is different? The Xerces implementation works fine.

      Here's the Xerces implementation:
      http://svn.apache.org/viewvc/xerces/java/tags/Xerces-J_2_12_0/src/org/apache/xerces/dom/NamedNodeMapImpl.java?view=markup#l577

      Highlighting the problem:

       - The Xerces implementation creates a new list when the list parameter is null
       - The JDK implementation ignores the list parameter and overwrite it when "nodes" is not null.



        Attachments

          Activity

            People

            Assignee:
            joehw Joe Wang
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: