Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jastram2012-01-19 12:44:08 +0000
committerMichael Jastram2012-01-19 12:44:08 +0000
commit328dfe35b490b555db9f89d45e573ed1fbe365cc (patch)
treeb57fc367715eb8922c46b0be824415a6ff5cc33e
parentf6ba58439631ac378cf1d76416514f52941ae09e (diff)
downloadorg.eclipse.rmf-328dfe35b490b555db9f89d45e573ed1fbe365cc.tar.gz
org.eclipse.rmf-328dfe35b490b555db9f89d45e573ed1fbe365cc.tar.xz
org.eclipse.rmf-328dfe35b490b555db9f89d45e573ed1fbe365cc.zip
Slightly more graceful handling of incomprehensible ReqIF
-rw-r--r--org.eclipse.rmf.reqif10.model/src/org/eclipse/rmf/reqif10/impl/AttributeValueXhtmlImpl.java6
-rw-r--r--org.eclipse.rmf.reqif10.xsd.model/src/org/eclipse/rmf/reqif10/xsd/util/ReqifXMLLoad.java21
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);
+ }
+ }
+ }
+
}

Back to the top