7099658: Properties.loadFromXML fails with ClassCastException
Reviewed-by: alanb, mchung
This commit is contained in:
parent
3cd4eaa1f0
commit
f65db39c04
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -76,7 +76,7 @@ public class XMLUtils {
|
|||||||
} catch (SAXException saxe) {
|
} catch (SAXException saxe) {
|
||||||
throw new InvalidPropertiesFormatException(saxe);
|
throw new InvalidPropertiesFormatException(saxe);
|
||||||
}
|
}
|
||||||
Element propertiesElement = (Element)doc.getChildNodes().item(1);
|
Element propertiesElement = doc.getDocumentElement();
|
||||||
String xmlVersion = propertiesElement.getAttribute("version");
|
String xmlVersion = propertiesElement.getAttribute("version");
|
||||||
if (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0)
|
if (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0)
|
||||||
throw new InvalidPropertiesFormatException(
|
throw new InvalidPropertiesFormatException(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user