File tree 2 files changed +9
-0
lines changed
src/utils/IdealGraphVisualizer/Data/src
main/java/com/sun/hotspot/igv/data/serialization
test/java/com/sun/hotspot/igv/data/serialization
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 34
34
import java .nio .channels .ReadableByteChannel ;
35
35
import java .util .ArrayList ;
36
36
import java .util .HashMap ;
37
+ import java .util .Locale ;
37
38
import java .util .Map ;
38
39
import javax .swing .SwingUtilities ;
39
40
import javax .xml .parsers .ParserConfigurationException ;
@@ -529,6 +530,8 @@ public GraphDocument parse() throws IOException {
529
530
}
530
531
try {
531
532
XMLReader reader = createReader ();
533
+ // To enforce using English for non-English users, we must use Locale.ROOT rather than Locale.ENGLISH
534
+ reader .setProperty ("http://apache.org/xml/properties/locale" , Locale .ROOT );
532
535
reader .setContentHandler (new XMLParser (xmlDocument , monitor ));
533
536
reader .parse (new InputSource (Channels .newInputStream (channel )));
534
537
} catch (SAXException ex ) {
Original file line number Diff line number Diff line change @@ -222,4 +222,10 @@ public void testParse() {
222
222
testBoth (new GraphDocument (), "<graphDocument></graphDocument>" );
223
223
}
224
224
225
+ @ Test
226
+ public void testParseIncompleteXML () {
227
+ // Exception should be swallowed, see catch clause in GraphParser.parse.
228
+ testBoth (new GraphDocument (), "<graphDocument>" );
229
+ }
230
+
225
231
}
You can’t perform that action at this time.
0 commit comments