Author: scabanovich
Date: 2007-07-20 09:09:26 -0400 (Fri, 20 Jul 2007)
New Revision: 2541
Modified:
trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java
Log:
EXIN-86
Modified:
trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java
===================================================================
---
trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java 2007-07-20
13:08:50 UTC (rev 2540)
+++
trunk/shale/plugins/org.jboss.tools.shale/src/org/jboss/tools/shale/model/clay/ClayConfigLoader.java 2007-07-20
13:09:26 UTC (rev 2541)
@@ -26,8 +26,9 @@
public void load(XModelObject object) {
String body = XModelObjectLoaderUtil.getTempBody(object);
- String[] errors = XMLUtil.getXMLErrors(new StringReader(body));
- if(errors != null && errors.length > 0) {
+ String[] errors = XMLUtil.getXMLErrors(new StringReader(body), false);
+ boolean hasErrors = (errors != null && errors.length > 0);
+ if(hasErrors) {
object.setAttributeValue("isIncorrect", "yes");
object.setAttributeValue("incorrectBody", body);
object.set("actualBodyTimeStamp", "-1");
@@ -46,6 +47,8 @@
}
Element element = doc.getDocumentElement();
util.load(element, object);
+ String loadingError = util.getError();
+
setEncoding(object, body);
NodeList nl = doc.getChildNodes();
@@ -58,6 +61,13 @@
}
reloadProcess(object);
object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+
+ ((AbstractXMLFileImpl)object).setLoaderError(loadingError);
+ if(!hasErrors && loadingError != null) {
+ object.setAttributeValue("isIncorrect", "yes");
+ object.setAttributeValue("incorrectBody", body);
+ object.set("actualBodyTimeStamp", "" + object.getTimeStamp());
+ }
}
public void reloadProcess(XModelObject object) {
Show replies by date