Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepaen2013-08-28 12:30:47 -0400
committerepaen2013-08-28 12:34:50 -0400
commitc9d936e6f05dbd06f21f915832af82f692afc85a (patch)
tree9eb580598d63e812d26edb31b6570851a738d2d8 /runtime/org.eclipse.etrice.runtime.java/src/org/eclipse
parent2ab69f3e1024d95e1817b236d3b0f50b727742ac (diff)
downloadorg.eclipse.etrice-c9d936e6f05dbd06f21f915832af82f692afc85a.tar.gz
org.eclipse.etrice-c9d936e6f05dbd06f21f915832af82f692afc85a.tar.xz
org.eclipse.etrice-c9d936e6f05dbd06f21f915832af82f692afc85a.zip
[org.eclipse.etrice.runtime.java] fixed a name creation bug in
ReplicatedInterfaceItemBase.createSubInterfaceItem(), fixed an assert in ReplicatedInterfaceItemBase.removeItem(..)
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.java/src/org/eclipse')
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java
index f6a92fe6b..73aa23d15 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java
@@ -65,15 +65,18 @@ public abstract class ReplicatedInterfaceItemBase extends RTObject implements IR
*/
@Override
public InterfaceItemBase createSubInterfaceItem() {
- InterfaceItemBase item = createInterfaceItem(this, getName()+SEP+items.size(), localId, getFreeIndex());
+ int newIndex = getFreeIndex();
+ InterfaceItemBase item = createInterfaceItem(this, getName()+SEP+newIndex, localId, newIndex);
items.add(item);
return item;
}
public void removeItem(InterfaceItemBase item) {
- assert(item.getParent()==this): "is own child";
- releasedIndices.push(item.getIdx());
- items.remove(item);
+ boolean isRemoved = items.remove(item);
+ assert(isRemoved): "is own child";
+ if(isRemoved) {
+ releasedIndices.push(item.getIdx());
+ }
}
private int getFreeIndex() {

Back to the top