diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-05-02 16:22:20 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-05-02 16:22:20 +0200 |
| commit | a1bcd4a2304134db7d5fa1f3cbe2f70df6549566 (patch) | |
| tree | f19d5565b639c23d4beba2d20c3f07911da71d85 /source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java | |
| parent | 246994285ab3e4bf754d2d684a21c4b66e619c9b (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.java | 5 |
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()));
}
|
