Skip to content

Commit a5a602d

Browse files
committed
Merge pull request #737 from Systems-Modeling/ST6RI-913
ST6RI-913 Exception opening .kermlx and .sysmlx files in editor
2 parents b2c66a5 + d62ff99 commit a5a602d

2 files changed

Lines changed: 41 additions & 22 deletions

File tree

org.omg.sysml/src/org/omg/sysml/adapter/FeatureAdapter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,11 @@ protected void computeValueConnector() {
822822
if (FeatureUtil.getValuationFor(target).isInitial()) {
823823
Feature that = (Feature)getLibraryType("Base::things::that");
824824
Feature startShot = (Feature)getLibraryType("Occurrences::Occurrence::startShot");
825-
featuringTypes = Collections.singletonList(FeatureUtil.chainFeatures(that, startShot));
825+
if (that != null && startShot != null) {
826+
featuringTypes = Collections.singletonList(FeatureUtil.chainFeatures(that, startShot));
827+
} else {
828+
featuringTypes = target.getFeaturingType();
829+
}
826830
} else {
827831
featuringTypes = target.getFeaturingType();
828832
}

org.omg.sysml/src/org/omg/sysml/util/OperandEList.java

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
package org.omg.sysml.util;
2323

2424
import java.util.Collection;
25+
import java.util.Collections;
2526
import java.util.Iterator;
2627
import java.util.List;
2728
import java.util.ListIterator;
@@ -102,17 +103,17 @@ public int basicIndexOf(Object object) {
102103

103104
@Override
104105
public int basicLastIndexOf(Object object) {
105-
throw new UnsupportedOperationException();
106+
return -1;
106107
}
107108

108109
@Override
109110
public boolean basicContains(Object object) {
110-
throw new UnsupportedOperationException();
111+
return false;
111112
}
112113

113114
@Override
114115
public boolean basicContainsAll(Collection<?> collection) {
115-
throw new UnsupportedOperationException();
116+
return false;
116117
}
117118

118119
@Override
@@ -127,22 +128,22 @@ public NotificationChain basicAdd(Expression object, NotificationChain notificat
127128

128129
@Override
129130
public List<Expression> basicList() {
130-
throw new UnsupportedOperationException();
131+
return Collections.emptyList();
131132
}
132133

133134
@Override
134135
public Iterator<Expression> basicIterator() {
135-
throw new UnsupportedOperationException();
136+
return Collections.emptyIterator();
136137
}
137138

138139
@Override
139140
public ListIterator<Expression> basicListIterator() {
140-
throw new UnsupportedOperationException();
141+
return Collections.emptyListIterator();
141142
}
142143

143144
@Override
144145
public ListIterator<Expression> basicListIterator(int i) {
145-
throw new UnsupportedOperationException();
146+
return Collections.emptyListIterator();
146147
}
147148

148149
@Override
@@ -176,43 +177,53 @@ public boolean contains(Object o) {
176177

177178
@Override
178179
public Iterator<Expression> iterator() {
179-
throw new UnsupportedOperationException(); }
180+
return Collections.emptyIterator();
181+
}
180182

181183
@Override
182184
public Object[] toArray() {
183-
throw new UnsupportedOperationException(); }
185+
throw new UnsupportedOperationException();
186+
}
184187

185188
@Override
186189
public <T> T[] toArray(T[] a) {
187-
throw new UnsupportedOperationException(); }
190+
throw new UnsupportedOperationException();
191+
}
188192

189193
@Override
190194
public boolean add(Expression e) {
191-
throw new UnsupportedOperationException(); }
195+
throw new UnsupportedOperationException();
196+
}
192197

193198
@Override
194199
public boolean containsAll(Collection<?> c) {
195-
throw new UnsupportedOperationException(); }
200+
return false;
201+
}
196202

197203
@Override
198204
public boolean addAll(Collection<? extends Expression> c) {
199-
throw new UnsupportedOperationException(); }
205+
throw new UnsupportedOperationException();
206+
}
200207

201208
@Override
202209
public boolean addAll(int index, Collection<? extends Expression> c) {
203-
throw new UnsupportedOperationException(); }
210+
throw new UnsupportedOperationException();
211+
}
204212

205213
@Override
206214
public boolean removeAll(Collection<?> c) {
207-
throw new UnsupportedOperationException(); }
215+
throw new UnsupportedOperationException();
216+
}
208217

209218
@Override
210219
public boolean retainAll(Collection<?> c) {
211-
throw new UnsupportedOperationException(); }
220+
throw new UnsupportedOperationException();
221+
}
212222

213223
@Override
214224
public Expression set(int index, Expression element) {
215-
throw new UnsupportedOperationException(); }
225+
throw new UnsupportedOperationException();
226+
}
216227

217228
@Override
218229
public void add(int index, Expression element) {
@@ -231,17 +242,21 @@ public int lastIndexOf(Object o) {
231242

232243
@Override
233244
public ListIterator<Expression> listIterator() {
234-
throw new UnsupportedOperationException(); }
245+
return Collections.emptyListIterator();
246+
}
235247

236248
@Override
237249
public ListIterator<Expression> listIterator(int index) {
238-
throw new UnsupportedOperationException(); }
250+
throw new UnsupportedOperationException();
251+
}
239252

240253
@Override
241254
public List<Expression> subList(int fromIndex, int toIndex) {
242-
throw new UnsupportedOperationException(); }
255+
return Collections.emptyList();
256+
}
243257

244258
@Override
245259
public Expression basicGet(int index) {
246-
throw new UnsupportedOperationException(); }
260+
throw new UnsupportedOperationException();
261+
}
247262
}

0 commit comments

Comments
 (0)