Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2020-12-19 18:21:11 +0000
committerRyan D. Brooks2020-12-19 18:28:04 +0000
commit93673a6127e3b086ce860cb303110cbfb9f5c987 (patch)
treea7cd2fa7890b491e0c0e630ecd6e915760a6ffca
parente34d6e76c5e37c6c5d9de1f1ea7bbb08115daaf4 (diff)
downloadorg.eclipse.osee-93673a6127e3b086ce860cb303110cbfb9f5c987.tar.gz
org.eclipse.osee-93673a6127e3b086ce860cb303110cbfb9f5c987.tar.xz
org.eclipse.osee-93673a6127e3b086ce860cb303110cbfb9f5c987.zip
bug[TW18542]: Gracefully handle invalid attribute multiplicity in XStackedDam
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java6
2 files changed, 8 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java
index e19e161b35d..68981e01867 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java
@@ -95,8 +95,11 @@ public class XStackedDam extends XStackedWidget<String> implements IAttributeWid
int minOccurrence = artifact.getArtifactType().getMin(attributeType);
int maxOccurrence = artifact.getArtifactType().getMax(attributeType);
- if (minOccurrence == 0) {
- minOccurrence = 1;
+ if (minOccurrence < 0) {
+ minOccurrence = 0;
+ }
+ if (maxOccurrence < 0) {
+ maxOccurrence = 0;
}
setPageRange(minOccurrence, maxOccurrence);
OseeEventManager.addListener(this);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
index c177d1337c5..4ffb318ec15 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
@@ -76,10 +76,10 @@ public abstract class XStackedWidget<T> extends XLabel {
protected void setPageRange(int minPage, int maxPage) {
if (minPage < 0) {
- throw new OseeArgumentException("Min Number of Pages must be greater than 0");
+ throw new OseeArgumentException("Min Number of Pages must be at lesat 0");
}
- if (maxPage < 1) {
- throw new OseeArgumentException("Max Number of Pages must be at least 1");
+ if (maxPage < 0) {
+ throw new OseeArgumentException("Max Number of Pages must be at least 0");
}
if (maxPage < minPage) {

Back to the top