Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185515 | 7 | Joe Wang | P3 | Closed | Fixed | m05 |
JDK-2182519 | 6u18 | Joe Wang | P4 | Resolved | Fixed | b02 |
FULL PRODUCT VERSION :
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
I'm making localized properties files for XML parser errors.
There is an error in file :
com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
The property "SDDeclInvalid" is not formatted, so if this error occurs while parsing a document, the exception message is :
The standalone document declaration value must be \"yes\" or \"no\", not \"{0}\".
The {0} is not replaced.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just run the following commands :
javac TestCase.java
java TestCase
or
Just edit an XML document :
<?xml version="1.0" encoding="UTF-8" standalone="a_value" ?>
<root />
Try to parse this file and display the exception message.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected result should be (for the example) :
The standalone document declaration value must be "yes" or "no", not
"bad_value".
ACTUAL -
The standalone document declaration value must be "yes" or "no", not "{0}".
---------- BEGIN SOURCE ----------
Here is a test case that show the bug :
--
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.*;
public class TestCase extends DefaultHandler {
public void fatalError (SAXParseException e) throws SAXException {
System.out.println (e.getMessage ());
} // fatalError ()
public void error (SAXParseException e) throws SAXException {
System.out.println (e.getMessage ());
} // error ()
public void warning (SAXParseException e) throws SAXException {
System.out.println (e.getMessage ());
} // warning ()
public static void main (String[] args) {
try {
SAXParser parser = SAXParserFactory.newInstance ().newSAXParser
();
parser.parse (new InputSource (new FileInputStream
("invalid_case.xml")), new TestCase ());
} catch (Exception e) {}
} // main ()
} // TestCase ()
--
And the XML file associated :
--
<?xml version="1.0" encoding="UTF-8" standalone="bad_value" ?>
<root />
--
---------- END SOURCE ----------
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
I'm making localized properties files for XML parser errors.
There is an error in file :
com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
The property "SDDeclInvalid" is not formatted, so if this error occurs while parsing a document, the exception message is :
The standalone document declaration value must be \"yes\" or \"no\", not \"{0}\".
The {0} is not replaced.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just run the following commands :
javac TestCase.java
java TestCase
or
Just edit an XML document :
<?xml version="1.0" encoding="UTF-8" standalone="a_value" ?>
<root />
Try to parse this file and display the exception message.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected result should be (for the example) :
The standalone document declaration value must be "yes" or "no", not
"bad_value".
ACTUAL -
The standalone document declaration value must be "yes" or "no", not "{0}".
---------- BEGIN SOURCE ----------
Here is a test case that show the bug :
--
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.*;
public class TestCase extends DefaultHandler {
public void fatalError (SAXParseException e) throws SAXException {
System.out.println (e.getMessage ());
} // fatalError ()
public void error (SAXParseException e) throws SAXException {
System.out.println (e.getMessage ());
} // error ()
public void warning (SAXParseException e) throws SAXException {
System.out.println (e.getMessage ());
} // warning ()
public static void main (String[] args) {
try {
SAXParser parser = SAXParserFactory.newInstance ().newSAXParser
();
parser.parse (new InputSource (new FileInputStream
("invalid_case.xml")), new TestCase ());
} catch (Exception e) {}
} // main ()
} // TestCase ()
--
And the XML file associated :
--
<?xml version="1.0" encoding="UTF-8" standalone="bad_value" ?>
<root />
--
---------- END SOURCE ----------
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-2182519 No formatting for an parser error messages
-
- Resolved
-
-
JDK-2185515 No formatting for an parser error messages
-
- Closed
-