Details
-
Bug
-
Resolution: Fixed
-
P2
-
7.0se, 8
Description
FULL PRODUCT VERSION :
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
(Have also visually inspected corresponding file on 7u55 and 8u5)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
(Don't believe to be OS specific)
A DESCRIPTION OF THE PROBLEM :
The message definition for InvalidCharRef in com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties has been corrupted. In Java 7 and 8 it is defined as
InvalidCharRef = Character reference \"&#
while in Java 6 is was
InvalidCharRef=Character reference "&\#{0}" is an invalid XML character.
This makes the error less useful in Java 7 and 8.
REGRESSION. Last worked in version 6u45
ADDITIONAL REGRESSION INFORMATION:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See executable test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
[Fatal Error] :1:12: Character reference "" is an invalid XML character.
Exception in thread "main" org.xml.sax.SAXParseException: Character reference "" is an invalid XML character.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at XMLTest.main(XMLTest.java:10)
(witnessed in Java 6u45)
ACTUAL -
[Fatal Error] :1:12: Character reference "&#
Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 12; Character reference "&#
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
at XMLTest.main(XMLTest.java:10)
(witnessed in Java 7u51 and appears to be the case from inspecting the properties file in 7u55 and 8u5).
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
public class XMLTest {
public static void main(String []args) throws Exception{
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream("<test></test>".getBytes()));
}
}
---------- END SOURCE ----------
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
(Have also visually inspected corresponding file on 7u55 and 8u5)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
(Don't believe to be OS specific)
A DESCRIPTION OF THE PROBLEM :
The message definition for InvalidCharRef in com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties has been corrupted. In Java 7 and 8 it is defined as
InvalidCharRef = Character reference \"&#
while in Java 6 is was
InvalidCharRef=Character reference "&\#{0}" is an invalid XML character.
This makes the error less useful in Java 7 and 8.
REGRESSION. Last worked in version 6u45
ADDITIONAL REGRESSION INFORMATION:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See executable test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
[Fatal Error] :1:12: Character reference "" is an invalid XML character.
Exception in thread "main" org.xml.sax.SAXParseException: Character reference "" is an invalid XML character.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at XMLTest.main(XMLTest.java:10)
(witnessed in Java 6u45)
ACTUAL -
[Fatal Error] :1:12: Character reference "&#
Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 12; Character reference "&#
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
at XMLTest.main(XMLTest.java:10)
(witnessed in Java 7u51 and appears to be the case from inspecting the properties file in 7u55 and 8u5).
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
public class XMLTest {
public static void main(String []args) throws Exception{
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream("<test></test>".getBytes()));
}
}
---------- END SOURCE ----------
Attachments
Issue Links
- duplicates
-
JDK-8064670 XMLMessages corrupted
-
- Closed
-
- relates to
-
JDK-8036611 Cleanup of handling of properties and other java resources in the build
-
- Resolved
-