diff options
author | Michael Jastram | 2012-01-19 12:44:08 +0000 |
---|---|---|
committer | Michael Jastram | 2012-01-19 12:44:08 +0000 |
commit | 328dfe35b490b555db9f89d45e573ed1fbe365cc (patch) | |
tree | b57fc367715eb8922c46b0be824415a6ff5cc33e | |
parent | f6ba58439631ac378cf1d76416514f52941ae09e (diff) | |
download | org.eclipse.rmf-328dfe35b490b555db9f89d45e573ed1fbe365cc.tar.gz org.eclipse.rmf-328dfe35b490b555db9f89d45e573ed1fbe365cc.tar.xz org.eclipse.rmf-328dfe35b490b555db9f89d45e573ed1fbe365cc.zip |
Slightly more graceful handling of incomprehensible ReqIF
2 files changed, 25 insertions, 2 deletions
diff --git a/org.eclipse.rmf.reqif10.model/src/org/eclipse/rmf/reqif10/impl/AttributeValueXhtmlImpl.java b/org.eclipse.rmf.reqif10.model/src/org/eclipse/rmf/reqif10/impl/AttributeValueXhtmlImpl.java index 3d9111d3..3ccd350f 100644 --- a/org.eclipse.rmf.reqif10.model/src/org/eclipse/rmf/reqif10/impl/AttributeValueXhtmlImpl.java +++ b/org.eclipse.rmf.reqif10.model/src/org/eclipse/rmf/reqif10/impl/AttributeValueXhtmlImpl.java @@ -207,13 +207,15 @@ public class AttributeValueXhtmlImpl extends AttributeValueImpl implements Attri /** * <!-- begin-user-doc --> + * TODO: Some patch-up that allows us to inspect ReqIF * <!-- end-user-doc --> - * @generated + * @generated NOT */ public XhtmlContent getTheOriginalValue() { // TODO: implement this method to return the 'The Original Value' containment reference // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); + return theValue; + } /** diff --git a/org.eclipse.rmf.reqif10.xsd.model/src/org/eclipse/rmf/reqif10/xsd/util/ReqifXMLLoad.java b/org.eclipse.rmf.reqif10.xsd.model/src/org/eclipse/rmf/reqif10/xsd/util/ReqifXMLLoad.java index f55535f1..51f47d38 100644 --- a/org.eclipse.rmf.reqif10.xsd.model/src/org/eclipse/rmf/reqif10/xsd/util/ReqifXMLLoad.java +++ b/org.eclipse.rmf.reqif10.xsd.model/src/org/eclipse/rmf/reqif10/xsd/util/ReqifXMLLoad.java @@ -10,6 +10,9 @@ ******************************************************************************/ package org.eclipse.rmf.reqif10.xsd.util; +import java.io.IOException; + +import org.eclipse.emf.ecore.resource.Resource.Diagnostic; import org.eclipse.emf.ecore.xmi.XMLHelper; import org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl; import org.xml.sax.helpers.DefaultHandler; @@ -25,4 +28,22 @@ public class ReqifXMLLoad extends XMLLoadImpl { return new ReqifSAXXMLHandler(resource, helper, options); } + /** + * TODO: If loading of a ReqIF fails, error propagation fails right now. We + * intercept here to output the errors at least to the console. + * <p> + * + * Rather than throwing an Exception (default behavior), we output the + * problems to the console and proceed. While less than optimal, this allows + * us to at least inspect the content. + */ + @Override + protected void handleErrors() throws IOException { + if (!resource.getErrors().isEmpty()) { + for (Diagnostic error : resource.getErrors()) { + System.err.println("Problem while loading ReqIF: " + error); + } + } + } + } |