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

behavior of javax.xml.stream.XMLEventFactory.createStartDocument(String encoding, String version) is wrong on some platforms

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 6-pool, 7, 8
    • xml
    • None

      XMLEventFactory.createStartDocument(null, "1.0") will generate <?xml version="1.0"?> correctly on solaris-sparc.
      But on linux-i586, it generates <?xml version="1.0" encoding="UTF-8"?> and the default encode is set as utf-8.

      It looks the encoding is wrong on linux-i586 since we set is as null.

      The Test.java has been attached.

      log on linux-i586:
      =================
      gtee@jsn-gtwy-1: ~ $ echo $JAVA_HOME
      /net/sqenfs-1/export1/jdk/re/8/promoted/latest/binaries/linux-i586
      gtee@jsn-gtwy-1: ~ $ pwd
      /net/sqenfs-1/export1/comp/jsn/users/patrick
      gtee@jsn-gtwy-1: ~ $ $JAVA_HOME/bin/javac Test.java
      gtee@jsn-gtwy-1: ~ $ $JAVA_HOME/bin/java Test
      <?xml version="1.0" encoding="UTF-8"?><root></root>
      =================

      log on solaris-sparc:
      =================
      gtee@jsn-sb2500-5: ~ $ echo $JAVA_HOME
      /net/sqenfs-1/export1/jdk/re/8/promoted/latest/binaries/solaris-sparc
      gtee@jsn-sb2500-5: ~ $ $JAVA_HOME/bin/javac Test.java
      gtee@jsn-sb2500-5: ~ $ $JAVA_HOME/bin/java Test
      <?xml version="1.0"?><root></root>
      =================

            joehw Joe Wang
            pzhang Patrick Zhang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: