ComponentRelation relation = (ComponentRelation) relations.next();
try {
relation.setContainer(null);
} catch (KernelException ex) {
throw new InternalErrorException(ex);
}
}
// Remove the ports from the inside entity only if this
// is not being called as a side effect of calling _removeEntity().
if (_inRemoveEntity) {
return;
}
Iterator entities = entityList().iterator();
while (entities.hasNext()) {
Entity insideEntity = (Entity) entities.next();
Port insidePort = insideEntity.getPort(port.getName());
if (insidePort != null) {
try {
insidePort.setContainer(null);
} catch (KernelException ex) {
throw new InternalErrorException(ex);
}
}
}
}