提交 0ccb4c06 编写于 作者: C coffeys

7099658: Properties.loadFromXML fails with ClassCastException

Reviewed-by: alanb, mchung
上级 cae9bd99
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -76,7 +76,7 @@ public class XMLUtils {
} catch (SAXException saxe) {
throw new InvalidPropertiesFormatException(saxe);
}
Element propertiesElement = (Element)doc.getChildNodes().item(1);
Element propertiesElement = doc.getDocumentElement();
String xmlVersion = propertiesElement.getAttribute("version");
if (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0)
throw new InvalidPropertiesFormatException(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册