summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2012-05-02 16:22:20 +0200
committerAndrew Branson <andrew.branson@cern.ch>2012-05-02 16:22:20 +0200
commita1bcd4a2304134db7d5fa1f3cbe2f70df6549566 (patch)
treef19d5565b639c23d4beba2d20c3f07911da71d85 /source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java
parent246994285ab3e4bf754d2d684a21c4b66e619c9b (diff)
Outcome form robustness
Diffstat (limited to 'source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java')
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java b/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java
index 45bdbc8..ac6a9f2 100644
--- a/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java
+++ b/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java
@@ -39,7 +39,6 @@ public class DimensionTableModel extends AbstractTableModel {
public DimensionTableModel(ElementDecl model, boolean readOnly) throws StructuralException {
XMLType modelContent = model.getType();
-
this.model = model;
this.readOnly = readOnly;
// use text node for simple types
@@ -63,6 +62,10 @@ public class DimensionTableModel extends AbstractTableModel {
// process attributes
for (Enumeration<?> e = elementType.getAttributeDecls(); e.hasMoreElements();) {
AttributeDecl thisAttr = (AttributeDecl)e.nextElement();
+ // HACK: if we don't resolve the reference, the type will be null
+ if (thisAttr.isReference()) thisAttr = thisAttr.getReference();
+ if (thisAttr.getSimpleType() == null)
+ throw new StructuralException("Attribute "+thisAttr.getName()+" in "+model.getName()+" has no type");
addColumn(thisAttr.getName(), thisAttr, thisAttr.getSimpleType().getTypeCode(), new Boolean(thisAttr.isFixed()));
}