boolean (@Nullable RunConfiguration configuration, @NotNull ExecutionTarget target) { if (configuration == null) { return false; } boolean isCompound = configuration instanceof CompoundRunConfiguration; if (isCompound && target == MULTIPLE_TARGETS) { return true; } ExecutionTarget defaultTarget = DefaultExecutionTarget.INSTANCE; boolean checkFallbackToDefault = isCompound && !target.equals(defaultTarget); return doWithEachNonCompoundWithSpecifiedTarget(configuration, (subConfiguration, executionTarget) -> { if (!(subConfiguration instanceof TargetAwareRunProfile targetAwareProfile)) { return true; } if ((Registry.is("update.run.configuration.actions.from.cache", false)) && getRunManager().isInvalidInCache(subConfiguration)) { return false; } return target.canRun(subConfiguration) && targetAwareProfile.canRunOn(target) || (checkFallbackToDefault && defaultTarget.canRun(subConfiguration) && targetAwareProfile.canRunOn(defaultTarget)); }); }