Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2021-01-08 00:25:07 +0000
committerRyan D. Brooks2021-01-11 16:49:03 +0000
commitf8ee31d2ff4e136f341c22557d57f5abdc01e1ba (patch)
tree5d25b9b1d679150b2507f82f41ae769a0d2b6efb
parent8552e1dd899a1c0e1ab40e7153387a7a4e390d38 (diff)
downloadorg.eclipse.osee-f8ee31d2ff4e136f341c22557d57f5abdc01e1ba.tar.gz
org.eclipse.osee-f8ee31d2ff4e136f341c22557d57f5abdc01e1ba.tar.xz
org.eclipse.osee-f8ee31d2ff4e136f341c22557d57f5abdc01e1ba.zip
bug[TW18587]: ArtifactEditor XWdiget exception casting to Integer
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLongDam.java10
2 files changed, 8 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java
index 3de02aaeb28..e8429348a92 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java
@@ -54,16 +54,10 @@ public class XIntegerDam extends XInteger implements IAttributeWidget {
public void setAttributeType(Artifact artifact, AttributeTypeToken attributeType) {
this.artifact = artifact;
this.attributeType = attributeType;
- try {
- Integer value = artifact.getSoleAttributeValue(getAttributeType());
- if (value != null) {
- super.set(value.toString());
- } else {
- super.set("");
- }
- } catch (AttributeDoesNotExist ex) {
- super.set("");
- }
+
+ // getSoleAttributeValue may return a value of type other than Integer such as ArtifactId
+ Object value = artifact.getSoleAttributeValue(attributeType, null);
+ set(value == null ? "" : value.toString());
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLongDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLongDam.java
index eba6d2fcfb7..2a6b4e33e7f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLongDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLongDam.java
@@ -53,12 +53,10 @@ public class XLongDam extends XLong implements IAttributeWidget {
public void setAttributeType(Artifact artifact, AttributeTypeToken attributeType) {
this.artifact = artifact;
this.attributeType = attributeType;
- try {
- Long value = artifact.getSoleAttributeValue(getAttributeType());
- super.set(value.toString());
- } catch (AttributeDoesNotExist ex) {
- super.set("");
- }
+
+ // getSoleAttributeValue may return a value of type other than Long such as ArtifactId
+ Object value = artifact.getSoleAttributeValue(attributeType, null);
+ set(value == null ? "" : value.toString());
}
@Override

Back to the top