Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-09-24 08:48:30 -0400
committerHenrik Rentz-Reichert2013-09-24 11:04:14 -0400
commit90b9e1cda6bf1fc506d6a4c2bca3656e5fa7667d (patch)
tree1bb4915bc0f4e81c874ce778844a6d21113d5d67 /runtime/org.eclipse.etrice.runtime.java/src/org/eclipse
parent5e19bc6778f987311cc9214518cd42b68a6e523b (diff)
downloadorg.eclipse.etrice-90b9e1cda6bf1fc506d6a4c2bca3656e5fa7667d.tar.gz
org.eclipse.etrice-90b9e1cda6bf1fc506d6a4c2bca3656e5fa7667d.tar.xz
org.eclipse.etrice-90b9e1cda6bf1fc506d6a4c2bca3656e5fa7667d.zip
[runtime.java] Bug 417914: OptionalActorInterfaceBase base doesn't resolve internal ports of the optional actor
https://bugs.eclipse.org/417914
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/InterfaceItemBase.java3
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java15
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/ReplicatedInterfaceItemBase.java3
3 files changed, 17 insertions, 4 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
index 5411e150a..b05d3b820 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
@@ -68,7 +68,8 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver {
this.ownMsgReceiver = msgSvc;
}
- connectWithPeer();
+ if (replicator==null)
+ connectWithPeer();
}
protected void connectWithPeer() {
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java
index 4231106ba..1bd912ffc 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/OptionalActorInterfaceBase.java
@@ -144,17 +144,28 @@ public abstract class OptionalActorInterfaceBase extends SystemPortOwner impleme
// remainder
path = path.substring(sep);
- // if remainder only contains >1 segment
+ // if remainder contains more than one segment it points into the optional actor
if (path.indexOf(PATH_DELIM, 1)>=0)
// we add the optional actor segment
path = optInst+path;
+ else {
+ /* the port is our own port
+ * a) on the interface ==> it is a broker and direct child
+ * b) internal ==> it is a child of the optional actor
+ */
+ IRTObject obj = super.getObject(getName()+path);
+ if (obj==null) {
+ obj = super.getObject(getName()+optInst+path);
+ }
+ return obj;
+ }
// finally we have to prefix with our own name since the relative path has to start with that
path = getName()+path;
}
}
- return super.getObject(path);
+ return getParent().getObject(path);
}
/**
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 73aa23d15..2b757f02e 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
@@ -50,7 +50,8 @@ public abstract class ReplicatedInterfaceItemBase extends RTObject implements IR
peer = ((InterfaceItemBase) object);
}
else if (object instanceof IReplicatedInterfaceItem) {
- peer = ((IReplicatedInterfaceItem) object).createSubInterfaceItem();
+ if (object!=this) // avoid connecting to myself: occurs in a special situation with optional actors
+ peer = ((IReplicatedInterfaceItem) object).createSubInterfaceItem();
}
if (peer!=null) {
InterfaceItemBase item = createSubInterfaceItem();

Back to the top