diff --git a/src/main/java/ca/teamdman/sfm/common/program/IInputResourceTracker.java b/src/main/java/ca/teamdman/sfm/common/program/IInputResourceTracker.java index b863e83c..7a52880b 100644 --- a/src/main/java/ca/teamdman/sfm/common/program/IInputResourceTracker.java +++ b/src/main/java/ca/teamdman/sfm/common/program/IInputResourceTracker.java @@ -55,9 +55,11 @@ default boolean matchesStack(Object stack) { } default boolean matchesCapabilityType(Object capability) { - return getResourceLimit() - .resourceIds() - .getReferencedResourceTypes() - .anyMatch(rt -> rt.matchesCapabilityType(capability)); + for (ResourceType resourceType : getResourceLimit().resourceIds().getReferencedResourceTypes()) { + if (resourceType.matchesCapabilityType(capability)) { + return true; + } + } + return false; } } diff --git a/src/main/java/ca/teamdman/sfm/common/program/IOutputResourceTracker.java b/src/main/java/ca/teamdman/sfm/common/program/IOutputResourceTracker.java index fbc07702..5999cc67 100644 --- a/src/main/java/ca/teamdman/sfm/common/program/IOutputResourceTracker.java +++ b/src/main/java/ca/teamdman/sfm/common/program/IOutputResourceTracker.java @@ -31,10 +31,12 @@ long getMaxTransferable( ); default boolean matchesCapabilityType(Object capability) { - return getResourceLimit() - .resourceIds() - .getReferencedResourceTypes() - .anyMatch(rt -> rt.matchesCapabilityType(capability)); + for (ResourceType resourceType : getResourceLimit().resourceIds().getReferencedResourceTypes()) { + if (resourceType.matchesCapabilityType(capability)) { + return true; + } + } + return false; } default boolean matchesStack(Object stack) { diff --git a/src/main/java/ca/teamdman/sfm/common/program/SimulateExploreAllPathsProgramBehaviour.java b/src/main/java/ca/teamdman/sfm/common/program/SimulateExploreAllPathsProgramBehaviour.java index 25daf03d..7cac99ac 100644 --- a/src/main/java/ca/teamdman/sfm/common/program/SimulateExploreAllPathsProgramBehaviour.java +++ b/src/main/java/ca/teamdman/sfm/common/program/SimulateExploreAllPathsProgramBehaviour.java @@ -11,7 +11,6 @@ import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import java.util.stream.Stream; public class SimulateExploreAllPathsProgramBehaviour implements ProgramBehaviour { @@ -182,11 +181,10 @@ public record Branch( ) implements ExecutionPathElement { } - @SuppressWarnings("rawtypes") public record IO( IOStatement statement, IOKind kind, - Set usedResourceTypes, + Set> usedResourceTypes, Set