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

API method DOMSerializer.getNewLine() does not return a correct default value

XMLWordPrintable

    • 1.3
    • sparc
    • solaris_2.6

        Name: apR10229 Date: 09/26/2003


        Filed By : SPB JCK team (###@###.###)
        JDK : java full version "1.5.0-beta-b20"
        JCK : 1.5
        Platform[s] : Linux
        switch/Mode :
        JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
        Failing Test [s] : N/A


        Specification excerpt:
        ======================
        --------- J2SE API spec v.1.5 ---------
        public java.lang.String getNewLine()
        ...................

        The default value for this attribute is null.
        ...
        ---------- end-of-excerpt ---------------

        Problem description
        ===================
        According to a API Spec, org.w3c.dom.ls.DOMSerializer.getNewLine() should return null
        as a default value, but it returns CR+LF.
            
        Minimized test:
        ===============
        ------- Test.java -------
        import java.io.*;
        import org.w3c.dom.ls.*;
        import org.w3c.dom.*;
        import javax.xml.parsers.*;

        public class Test {
            public static void main(String[] argv) {
                Document doc = null;
                try {
                    DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    doc = parser.parse(new StringBufferInputStream("<ROOT/>"));
                } catch (Throwable e) {
                    e.printStackTrace();
                }
                DOMImplementationLS implLS = (DOMImplementationLS) doc.getImplementation().getFeature("LS","3.0");
                DOMSerializer dw = implLS.createDOMSerializer();
                if (dw.getNewLine() != null) {
                    System.out.println("FAILED: method does not return null by default!");
        } else {
        System.out.println("PASSED");
        }

            }
        }

        ------- end-of-Test.java -------

        Minimized test output:
        ======================
        <pav@hammer(pts/6).266> java Test
        FAILED: method does not return null by default!


        JCK test source location:
        ==========================
        /java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

        Specific Machine Info:
        =====================
        Linux hammer 2.4.21 #1 Wed Jun 25 20:18:22 MSD 2003 i686 unknown


        ======================================================================

              rmandavasunw Ramesh Mandava (Inactive)
              pavsunw Pav Pav (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: