This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208909 - XMLUtil.write lacks newlines in document header on JDK 7u4
Summary: XMLUtil.write lacks newlines in document header on JDK 7u4
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: JDK_SPECIFIC
Depends on:
Blocks: 208442
  Show dependency tree
 
Reported: 2012-02-27 15:28 UTC by Jiri Skrivanek
Modified: 2012-07-17 15:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test results. (58.17 KB, text/html)
2012-02-27 15:28 UTC, Jiri Skrivanek
Details
JavaProjectNatureTest results. (34.42 KB, text/html)
2012-02-27 15:34 UTC, Jiri Skrivanek
Details
WebProjectNatureTest results. (42.33 KB, text/html)
2012-02-27 15:35 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2012-02-27 15:28:59 UTC
Created attachment 116139 [details]
Test results.

As reported in bug 208442 org.netbeans.modules.java.freeform.JavaActionsTest is failing on Linux with JDK7u4. Please evaluate ASAP, escalated by JDK team. We need to know whether it's a random failure, issue in test or problem in JDK.
Comment 1 Jiri Skrivanek 2012-02-27 15:34:14 UTC
Created attachment 116140 [details]
JavaProjectNatureTest results.
Comment 2 Jiri Skrivanek 2012-02-27 15:35:38 UTC
Created attachment 116141 [details]
WebProjectNatureTest results.

Please, evaluate also JavaProjectNatureTest and WebProjectNatureTest results. It is similar failure.
Comment 3 Marian Mirilovic 2012-03-01 13:33:35 UTC
Please evaluate ASAP, escalated by JDK team ... we need to know whether it's a
random failure, issue in test or problem in JDK.
Comment 4 Jesse Glick 2012-03-02 15:30:03 UTC
Looks to be a JDK bug. It is failing to insert a newline between the XML declaration and the root element when serializing XML using org.openide.util.XMLUtil.write.

I do not see this failure in 7u2.
Comment 5 Jesse Glick 2012-03-02 15:46:22 UTC
7u3 I meant. I can reproduce the failures in 7u4. Probably a result of the JAXP upgrade [1] [2].

[1] http://hg.openjdk.java.net/jdk7u/jdk7u/jaxp/rev/d9891683fc16
[2] http://hg.openjdk.java.net/jdk7u/jdk7u/jaxp/rev/4a61ac055189
Comment 6 Jesse Glick 2012-03-02 15:49:21 UTC
Not just a test failure of theoretical interest, either; make a new Java Library and you will see that build.xml, build-impl.xml, and project.xml are all missing a newline after the XML declaration, e.g.:


<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
Comment 7 Jesse Glick 2012-03-02 15:51:54 UTC
org.openide.xml.XMLUtilTest shows these failures in a more basic form, by the way - testCopyDocument, testEntityIncludes, testIndentation2, testSignificantWhitespace.
Comment 8 Jesse Glick 2012-03-02 16:59:52 UTC
Filed upstream bug report.
Comment 9 Jesse Glick 2012-03-06 00:06:21 UTC
Looking for a workaround in XMLUtil.
Comment 10 Jesse Glick 2012-03-06 00:16:43 UTC
core-main #15e04e1e6e01
Comment 12 Jesse Glick 2012-03-06 15:09:16 UTC
Not merely a test issue.
Comment 13 Quality Engineering 2012-03-07 18:10:10 UTC
Integrated into 'main-golden', will be available in build *201203071105* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/15e04e1e6e01
User: Jesse Glick <jglick@netbeans.org>
Log: #208909: XMLUtilTest failures on JDK 7u4
Comment 14 Jesse Glick 2012-03-15 02:11:51 UTC
Simplifying to use a new transformer property which restores the 7u3 behavior: core-main #921fea600d94
Comment 15 Quality Engineering 2012-03-17 10:39:03 UTC
Integrated into 'main-golden', will be available in build *201203170400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/921fea600d94
User: Jesse Glick <jglick@netbeans.org>
Log: #208909 cont'd: use ORACLE_IS_STANDALONE output processor key.
Comment 16 Jesse Glick 2012-03-21 21:12:35 UTC
Note that revised fix depends on a JAXP impl honoring ORACLE_IS_STANDALONE, which 1.7.0_04-ea-b11 did not; this change is expected (AFAIK) in the final 7u4 release.

releases #8390ab8219ce, releases #5382c0aefa30, releases #20ac295fa225
Comment 17 Quality Engineering 2012-03-23 02:50:28 UTC
Integrated into 'releases', will be available in build *201203222205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/8390ab8219ce
User: Jesse Glick <jglick@netbeans.org>
Log: #208909: XMLUtilTest failures on JDK 7u4
Comment 18 Jesse Glick 2012-03-27 20:55:19 UTC
b18 said to have it.
Comment 19 Jesse Glick 2012-04-04 17:11:57 UTC
Revised fix confirmed in trunk using 7u4b18.
Comment 20 Jiri Skrivanek 2012-04-06 12:36:20 UTC
It is still reproducible on Windows with 7u4b20. My test case:

- create new java project
- go to Files and open build.xml
- formatting is as follows

<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><!-- Commands such as Run, Debug, and Test only use this build script if --><!-- the Compile on Save feature is turned off for the project. --><!-- You can turn off the Compile on Save (or Deploy on Save) setting --><!-- in the project's Project Properties dialog box.--><project name="JavaApplication3" default="default" basedir=".">
    <description>Builds, tests, and runs the project JavaApplication3.</description>
    <import file="nbproject/build-impl.xml"/>

Product Version: NetBeans IDE 7.1.2 (Build 201204052205)
Java: 1.7.0_04-ea; Java HotSpot(TM) Client VM 23.0-b20
System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)
Comment 21 Marian Mirilovic 2012-04-06 13:40:26 UTC
(In reply to comment #20)
> It is still reproducible on Windows with 7u4b20. My test case:
> 
> Product Version: NetBeans IDE 7.1.2 (Build 201204052205)
> Java: 1.7.0_04-ea; Java HotSpot(TM) Client VM 23.0-b20
> System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)

Jirka, please doublecheck the version of JDK build, from the text above it looks like you are using b20 - that is confusing, because last build of 7u4 is b19 .... also it says 'ea' and we are almost 'fcs' now
Comment 22 Jiri Skrivanek 2012-04-06 13:47:29 UTC
It is JDK from here:

http://jre.us.oracle.com/java/re/jdk/7u4/promoted/all/b19/bundles/windows-i586/jdk-7u4-ea-bin-b19-windows-i586-05_apr_2012.exe

IDE log says:

  Java; VM; Vendor        = 1.7.0_04-ea; Java HotSpot(TM) Client VM 23.0-b20; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.7.0_04-ea-b19
  Java Home               = D:\jdk1.7.0_04\jre
Comment 23 Jesse Glick 2012-04-06 15:25:02 UTC
The "b20" is HotSpot; the JRE here is b19.

Maybe Windows-specific - did you check also on Linux on Solaris? I will try it on Monday.
Comment 24 Jesse Glick 2012-04-09 14:28:36 UTC
Never mind, reproduced, this is just not covered by XMLUtilTest yet.
Comment 25 Jesse Glick 2012-04-09 15:17:29 UTC
Formatting in build.xml and build-impl.xml is actually a separate issue, though of course related to formatting in project.xml. Fixing that too: core-main #a87acbe31c0a, releases #449a2a0cb50f
Comment 26 Quality Engineering 2012-04-10 01:55:24 UTC
Integrated into 'releases', will be available in build *201204092205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/449a2a0cb50f
User: Jesse Glick <jglick@netbeans.org>
Log: #208909: need to use ORACLE_IS_STANDALONE in generateBuildScriptFromStylesheet as well.
Comment 27 Jiri Skrivanek 2012-04-10 09:11:12 UTC
Verified in NetBeans IDE 7.1.2 (Build 201204092205) and NetBeans IDE Dev (Build 20120410-70b4b50d1de5).
Comment 28 Quality Engineering 2012-04-10 10:03:55 UTC
Integrated into 'main-golden', will be available in build *201204100400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a87acbe31c0a
User: Jesse Glick <jglick@netbeans.org>
Log: #208909: need to use ORACLE_IS_STANDALONE in generateBuildScriptFromStylesheet as well.