Skip to content

Commit

Permalink
Fix infinite recursion for subapp through connections in monitoring
Browse files Browse the repository at this point in the history
Fix infinite recursion for subapp through connections in monitoring by
only considering connections from input to input and output to output
when recursively resolving subapp interface connections.
  • Loading branch information
mx990 authored and oberlehner committed Jan 23, 2025
1 parent fc07be6 commit f47fd24
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.fordiac.ide.deployment.debug.watch;

import java.util.function.Predicate;
import java.util.stream.Stream;

import org.eclipse.fordiac.ide.model.libraryElement.AdapterDeclaration;
Expand Down Expand Up @@ -73,9 +74,11 @@ public static <T extends IInterfaceElement> Stream<T> resolveSubappInterfaceConn
subapp.loadSubAppNetwork(); // ensure network is loaded
if (element.isIsInput()) {
yield (Stream<T>) element.getOutputConnections().stream().map(Connection::getDestination)
.filter(IInterfaceElement::isIsInput) // skip inner connections to output
.flatMap(DeploymentDebugWatchUtils::resolveSubappInterfaceConnections);
}
yield (Stream<T>) element.getInputConnections().stream().map(Connection::getSource)
.filter(Predicate.not(IInterfaceElement::isIsInput)) // skip inner connections to input
.flatMap(DeploymentDebugWatchUtils::resolveSubappInterfaceConnections);
}
case final AdapterFB adapterFB -> (Stream<T>) resolveSubappInterfaceConnections(adapterFB.getAdapterDecl())
Expand Down

0 comments on commit f47fd24

Please sign in to comment.