com.google.devtools.build.lib.util.Pair.of() - java examples

Here are the examples of the java api com.google.devtools.build.lib.util.Pair.of() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

81 Examples 7

19 View Complete Implementation : NinjaParserStep.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Parses variable at the current lexer position.
 */
public Pair<String, NinjaVariableValue> parseVariable() throws GenericParsingException {
    String name = replacedtring(parseExpected(NinjaToken.IDENTIFIER));
    parseExpected(NinjaToken.EQUALS);
    NinjaVariableValue value = parseVariableValue(name);
    return Pair.of(name, value);
}

19 View Complete Implementation : LineNumberTable.java
Copyright Apache License 2.0
Author : bazelbuild
Pair<Integer, Integer> getOffsetsForLine(int line) {
    if (line <= 0 || line >= linestart.length) {
        throw new IllegalArgumentException("Illegal line: " + line);
    }
    return Pair.of(linestart[line], line < linestart.length - 1 ? linestart[line + 1] : bufferLength);
}

19 View Complete Implementation : NativeProvider.java
Copyright Apache License 2.0
Author : bazelbuild
public static Pair<String, String> getSerializedRepresentationForNativeKey(NativeKey key) {
    return Pair.of(key.name, key.aClreplaced.getName());
}

19 View Complete Implementation : TrackingAwaiter.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Allow arbitrary errors to be recorded here for later throwing.
 */
public void injectExceptionAndMessage(Throwable throwable, String message) {
    exceptionsThrown.add(Pair.of(message, throwable));
}

19 View Complete Implementation : MiddlemanFactory.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Creates both normal and scheduling middlemen.
 *
 * <p>Note: there's no need to synchronize this method; the only use of a field is via a call to
 * another synchronized method (getArtifact()).
 *
 * @return null iff {@code inputs} is null or empty; the middleman file and the middleman action
 *     otherwise
 */
private Pair<Artifact, Action> createMiddleman(ActionOwner owner, String middlemanName, String purpose, NestedSet<Artifact> inputs, ArtifactRoot middlemanDir, MiddlemanType middlemanType) {
    if (inputs == null || inputs.isEmpty()) {
        return null;
    }
    Artifact stampFile = getStampFileArtifact(middlemanName, purpose, middlemanDir);
    Action action = MiddlemanAction.create(actionRegistry, owner, inputs, stampFile, purpose, middlemanType);
    return Pair.of(stampFile, action);
}

19 View Complete Implementation : NinjaScope.java
Copyright Apache License 2.0
Author : bazelbuild
public void addExpandedVariable(int offset, String name, String value) {
    expandedVariables.computeIfAbsent(name, k -> Lists.newArrayList()).add(Pair.of(offset, value));
}

19 View Complete Implementation : NinjaLexer.java
Copyright Apache License 2.0
Author : bazelbuild
private NinjaToken push(NinjaToken token) {
    step.ensureEnd();
    ranges.add(Pair.of(step.getStart(), step.getEnd()));
    tokens.add(token);
    if (step.getError() != null) {
        // Do not move in case of error.
        return NinjaToken.ERROR;
    }
    if (step.canAdvance()) {
        step = step.nextStep();
    }
    return token;
}

18 View Complete Implementation : BazelMockAndroidSupport.java
Copyright Apache License 2.0
Author : bazelbuild
public static CcToolchainConfig.Builder armeabiV7a() {
    return CcToolchainConfig.builder().withCpu("armeabi-v7a").withCompiler("gcc").withToolchainIdentifier("armeabi-v7a").withHostSystemName("x86").withTargetSystemName("arm-linux-androideabi").withTargetLibc("local").withAbiVersion("armeabi-v7a").withAbiLibcVersion("r7").withSysroot("").withToolPaths(Pair.of("gcc", "arm/bin/arm-linux-androideabi-gcc"), Pair.of("ar", "arm/bin/arm-linux-androideabi-ar"), Pair.of("cpp", "arm/bin/arm-linux-androideabi-cpp"), Pair.of("gcov", "arm/bin/arm-linux-androideabi-gcov"), Pair.of("ld", "arm/bin/arm-linux-androideabi-ld"), Pair.of("nm", "arm/bin/arm-linux-androideabi-nm"), Pair.of("objcopy", "arm/bin/arm-linux-androideabi-objcopy"), Pair.of("objdump", "arm/bin/arm-linux-androideabi-objdump"), Pair.of("strip", "arm/bin/arm-linux-androideabi-strip"), Pair.of("ld-bfd", "arm/bin/arm-linux-androideabi-ld.bfd"), Pair.of("ld-gold", "arm/bin/arm-linux-androideabi-ld.gold"));
}

18 View Complete Implementation : RepositoryName.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Extracts the repository name from a PathFragment that was created with
 * {@code PackageIdentifier.getSourceRoot}.
 *
 * @return a {@code Pair} of the extracted repository name and the path fragment with stripped
 * of "external/"-prefix and repository name, or null if none was found or the repository name
 * was invalid.
 */
public static Pair<RepositoryName, PathFragment> fromPathFragment(PathFragment path) {
    if (path.segmentCount() < 2 || !path.startsWith(LabelConstants.EXTERNAL_PATH_PREFIX)) {
        return null;
    }
    try {
        RepositoryName repoName = RepositoryName.create("@" + path.getSegment(1));
        PathFragment subPath = path.subFragment(2);
        return Pair.of(repoName, subPath);
    } catch (LabelSyntaxException e) {
        return null;
    }
}

18 View Complete Implementation : LineNumberTableTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testMultiLiner() {
    LineNumberTable table = create("\ntwo\nthree\n\nfive\n");
    // \n
    replacedertThat(table.getLineAndColumn(0)).isEqualTo(new LineAndColumn(1, 1));
    replacedertThat(table.getOffsetsForLine(1)).isEqualTo(Pair.of(0, 1));
    // two\n
    replacedertThat(table.getLineAndColumn(1)).isEqualTo(new LineAndColumn(2, 1));
    replacedertThat(table.getLineAndColumn(2)).isEqualTo(new LineAndColumn(2, 2));
    replacedertThat(table.getLineAndColumn(3)).isEqualTo(new LineAndColumn(2, 3));
    replacedertThat(table.getLineAndColumn(4)).isEqualTo(new LineAndColumn(2, 4));
    replacedertThat(table.getOffsetsForLine(2)).isEqualTo(Pair.of(1, 5));
    // three\n
    replacedertThat(table.getLineAndColumn(5)).isEqualTo(new LineAndColumn(3, 1));
    replacedertThat(table.getLineAndColumn(10)).isEqualTo(new LineAndColumn(3, 6));
    replacedertThat(table.getOffsetsForLine(3)).isEqualTo(Pair.of(5, 11));
    // \n
    replacedertThat(table.getLineAndColumn(11)).isEqualTo(new LineAndColumn(4, 1));
    replacedertThat(table.getOffsetsForLine(4)).isEqualTo(Pair.of(11, 12));
    // five\n
    replacedertThat(table.getLineAndColumn(12)).isEqualTo(new LineAndColumn(5, 1));
    replacedertThat(table.getLineAndColumn(16)).isEqualTo(new LineAndColumn(5, 5));
    replacedertThat(table.getOffsetsForLine(5)).isEqualTo(Pair.of(12, 17));
}

18 View Complete Implementation : LineNumberTableTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testOneLiner() {
    LineNumberTable table = create("foo");
    replacedertThat(table.getLineAndColumn(0)).isEqualTo(new LineAndColumn(1, 1));
    replacedertThat(table.getLineAndColumn(1)).isEqualTo(new LineAndColumn(1, 2));
    replacedertThat(table.getLineAndColumn(2)).isEqualTo(new LineAndColumn(1, 3));
    replacedertThat(table.getOffsetsForLine(1)).isEqualTo(Pair.of(0, 3));
}

18 View Complete Implementation : GlobCache.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Adds glob entries to the cache.
 */
private void setGlobPaths(String pattern, boolean excludeDirectories, Future<List<Path>> result) {
    globCache.put(Pair.of(pattern, excludeDirectories), result);
}

18 View Complete Implementation : CcCommon.java
Copyright Apache License 2.0
Author : bazelbuild
private List<Pair<Artifact, Label>> mapToListOfPairs(Map<Artifact, Label> map) {
    ImmutableList.Builder<Pair<Artifact, Label>> result = ImmutableList.builder();
    for (Map.Entry<Artifact, Label> entry : map.entrySet()) {
        result.add(Pair.of(entry.getKey(), entry.getValue()));
    }
    return result.build();
}

18 View Complete Implementation : BazelMockAndroidSupport.java
Copyright Apache License 2.0
Author : bazelbuild
public static CcToolchainConfig.Builder x86Config() {
    return CcToolchainConfig.builder().withCpu("x86").withCompiler("gcc").withToolchainIdentifier("x86").withHostSystemName("x86").withTargetSystemName("x86-linux-android").withTargetLibc("local").withAbiVersion("x86").withAbiLibcVersion("r7").withSysroot("").withToolPaths(Pair.of("gcc", "x86/bin/i686-linux-android-gcc"), Pair.of("ar", "x86/bin/i686-linux-android-ar"), Pair.of("cpp", "x86/bin/i686-linux-android-cpp"), Pair.of("gcov", "x86/bin/i686-linux-android-gcov"), Pair.of("ld", "x86/bin/i686-linux-android-ld"), Pair.of("nm", "x86/bin/i686-linux-android-nm"), Pair.of("objcopy", "x86/bin/i686-linux-android-objcopy"), Pair.of("objdump", "x86/bin/i686-linux-android-objdump"), Pair.of("strip", "x86/bin/i686-linux-android-strip"), Pair.of("ld-bfd", "x86/bin/i686-linux-android-ld.bfd"), Pair.of("ld-gold", "x86/bin/i686-linux-android-ld.gold"));
}

18 View Complete Implementation : LinkCommandLine.java
Copyright Apache License 2.0
Author : bazelbuild
private static Pair<List<String>, List<String>> splitCommandline(Artifact paramFile, List<String> args, LinkTargetType linkTargetType, boolean doNotSplitLinkingCmdline) {
    Preconditions.checkNotNull(paramFile);
    if (linkTargetType.linkerOrArchiver() == LinkerOrArchiver.ARCHIVER) {
        // Ar link commands can also generate huge command lines.
        List<String> paramFileArgs = new ArrayList<>();
        List<String> commandlineArgs = new ArrayList<>();
        extractArgumentsForStaticLinkParamFile(args, commandlineArgs, paramFileArgs);
        return Pair.of(commandlineArgs, paramFileArgs);
    } else {
        // Gcc link commands tend to generate humongous commandlines for some targets, which may
        // not fit on some remote execution machines. To work around this we will employ the help of
        // a parameter file and preplaced any linker options through it.
        List<String> paramFileArgs = new ArrayList<>();
        List<String> commandlineArgs = new ArrayList<>();
        extractArgumentsForDynamicLinkParamFile(args, commandlineArgs, paramFileArgs, doNotSplitLinkingCmdline);
        return Pair.of(commandlineArgs, paramFileArgs);
    }
}

18 View Complete Implementation : GlobCacheTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testGetKeySet() throws Exception {
    replacedertThat(cache.getKeySet()).isEmpty();
    cache.getGlobUnsorted("*.java");
    replacedertThat(cache.getKeySet()).containsExactly(Pair.of("*.java", false));
    cache.getGlobUnsorted("*.java");
    replacedertThat(cache.getKeySet()).containsExactly(Pair.of("*.java", false));
    cache.getGlobUnsorted("*.js");
    replacedertThat(cache.getKeySet()).containsExactly(Pair.of("*.java", false), Pair.of("*.js", false));
    cache.getGlobUnsorted("*.java", true);
    replacedertThat(cache.getKeySet()).containsExactly(Pair.of("*.java", false), Pair.of("*.js", false), Pair.of("*.java", true));
    replacedertThrows(BadGlobException.clreplaced, () -> cache.getGlobUnsorted("invalid?"));
    replacedertThat(cache.getKeySet()).containsExactly(Pair.of("*.java", false), Pair.of("*.js", false), Pair.of("*.java", true));
    cache.getGlobUnsorted("foo/first.*");
    replacedertThat(cache.getKeySet()).containsExactly(Pair.of("*.java", false), Pair.of("*.java", true), Pair.of("*.js", false), Pair.of("foo/first.*", false));
}

18 View Complete Implementation : CycleUtils.java
Copyright Apache License 2.0
Author : bazelbuild
static <S> Pair<ImmutableList<S>, ImmutableList<S>> splitIntoPathAndChain(Predicate<S> startOfCycle, Iterable<S> pathAndCycle) {
    boolean inPathToCycle = true;
    ImmutableList.Builder<S> pathToCycleBuilder = ImmutableList.builder();
    ImmutableList.Builder<S> cycleBuilder = ImmutableList.builder();
    for (S elt : pathAndCycle) {
        if (startOfCycle.apply(elt)) {
            inPathToCycle = false;
        }
        if (inPathToCycle) {
            pathToCycleBuilder.add(elt);
        } else {
            cycleBuilder.add(elt);
        }
    }
    return Pair.of(pathToCycleBuilder.build(), cycleBuilder.build());
}

18 View Complete Implementation : PerBuildSyscallCache.java
Copyright Apache License 2.0
Author : bazelbuild
@Override
public FileStatus statIfFound(Path path, Symlinks symlinks) throws IOException {
    Object result = statCache.getUnchecked(Pair.of(path, symlinks));
    if (result instanceof IOException) {
        throw (IOException) result;
    }
    FileStatus status = (FileStatus) result;
    return (status == NO_STATUS) ? null : status;
}

18 View Complete Implementation : BuildView.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Returns two numbers: number of replacedyzed and number of loaded targets.
 *
 * <p>The first number: configured targets freshly evaluated in the last replacedysis run.
 *
 * <p>The second number: targets (not configured targets) loaded in the last replacedysis run.
 */
public Pair<Integer, Integer> getTargetsConfiguredAndLoaded() {
    ImmutableSet<SkyKey> keys = skyframeBuildView.getEvaluatedTargetKeys();
    int targetsConfigured = keys.size();
    int targetsLoaded = keys.stream().map(key -> ((ConfiguredTargetKey) key).getLabel()).collect(toSet()).size();
    return Pair.of(targetsConfigured, targetsLoaded);
}

18 View Complete Implementation : CallUtils.java
Copyright Apache License 2.0
Author : bazelbuild
private static CacheValue getCacheValue(Clreplaced<?> cls, StarlarkSemantics semantics) {
    if (cls == String.clreplaced) {
        cls = StringModule.clreplaced;
    }
    try {
        return cache.get(Pair.of(cls, semantics));
    } catch (ExecutionException ex) {
        throw new IllegalStateException("cache error", ex);
    }
}

17 View Complete Implementation : ProtoCompileActionBuilderTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void directDependenciesOnExternalFiles() throws Exception {
    ImmutableList<Artifact> protos = ImmutableList.of(artifact("@bla//foo:bar", "external/bla/foo/bar.proto"));
    ImmutableList<Pair<Artifact, String>> protosImports = ImmutableList.of(Pair.of(artifact("@bla//foo:bar", "external/bla/foo/bar.proto"), null));
    replacedertThat(protoArgv(protosImports, protos, ImmutableList.of("external/bla"))).containsExactly("-Ifoo/bar.proto=external/bla/foo/bar.proto", "--direct_dependencies", "foo/bar.proto");
}

17 View Complete Implementation : ProtoCompileActionBuilderTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testProtoCommandLineArgv() throws Exception {
    replacedertThat(protoArgv(null, /* directDependencies */
    ImmutableList.of(derivedArtifact("foo.proto")), ImmutableList.of("."))).containsExactly("-Ifoo.proto=out/foo.proto");
    replacedertThat(protoArgv(ImmutableList.of(), /* directDependencies */
    ImmutableList.of(derivedArtifact("foo.proto")), ImmutableList.of("."))).containsExactly("-Ifoo.proto=out/foo.proto", "--direct_dependencies=");
    replacedertThat(protoArgv(ImmutableList.of(Pair.of(derivedArtifact("foo.proto"), null)), /* directDependencies */
    ImmutableList.of(derivedArtifact("foo.proto")), ImmutableList.of("."))).containsExactly("-Ifoo.proto=out/foo.proto", "--direct_dependencies", "foo.proto");
    replacedertThat(protoArgv(ImmutableList.of(Pair.of(derivedArtifact("foo.proto"), null), Pair.of(derivedArtifact("bar.proto"), null)), /* directDependencies */
    ImmutableList.of(derivedArtifact("foo.proto")), ImmutableList.of("."))).containsExactly("-Ifoo.proto=out/foo.proto", "--direct_dependencies", "foo.proto:bar.proto");
}

17 View Complete Implementation : TrackingAwaiter.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Threadpools can swallow exceptions. Make sure they don't get lost.
 */
public void awaitLatchAndTrackExceptions(CountDownLatch latch, String errorMessage) {
    try {
        waitAndMaybeThrowInterrupt(latch, errorMessage);
    } catch (Throwable e) {
        // We would expect e to be InterruptedException or replacedertionError, but we leave it open so
        // that any throwable gets recorded.
        exceptionsThrown.add(Pair.of(errorMessage, e));
        // Caller will replacedert exceptionsThrown is empty at end of test and fail, even if this is
        // swallowed.
        Throwables.propagate(e);
    }
}

17 View Complete Implementation : ActionExecutionStatusReporter.java
Copyright Apache License 2.0
Author : bazelbuild
private void setStatus(ActionExecutionMetadata action, String message) {
    actionStatus.put(action, Pair.of(message, clock.nanoTime()));
}

17 View Complete Implementation : CommandHelper.java
Copyright Apache License 2.0
Author : bazelbuild
private static Pair<List<String>, Artifact> buildCommandLineMaybeWithScriptFile(RuleContext ruleContext, String command, CommandConstructor constructor) {
    List<String> argv;
    Artifact scriptFileArtifact = null;
    if (command.length() <= maxCommandLength) {
        argv = constructor.asExecArgv(command);
    } else {
        // Use script file.
        scriptFileArtifact = constructor.commandreplacedcript(ruleContext, command);
        argv = constructor.asExecArgv(scriptFileArtifact);
    }
    return Pair.of(argv, scriptFileArtifact);
}

17 View Complete Implementation : RepositoryResolvedEvent.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Compare two maps from Strings to objects, returning a pair of the map with all entries not in
 * the original map or in the original map, but with a different value, and the keys dropped from
 * the original map. However, ignore changes where a value is explicitly set to its default.
 */
static Pair<Map<String, Object>, List<String>> compare(Map<String, Object> orig, Map<String, Object> defaults, Map<?, ?> modified) {
    ImmutableMap.Builder<String, Object> valuesChanged = ImmutableMap.<String, Object>builder();
    for (Map.Entry<?, ?> entry : modified.entrySet()) {
        if (entry.getKey() instanceof String) {
            Object value = entry.getValue();
            String key = (String) entry.getKey();
            Object old = orig.get(key);
            if (old == null) {
                Object defaultValue = defaults.get(key);
                if (defaultValue == null || !defaultValue.equals(value)) {
                    valuesChanged.put(key, value);
                }
            } else {
                if (!old.equals(entry.getValue())) {
                    valuesChanged.put(key, value);
                }
            }
        }
    }
    ImmutableList.Builder<String> keysDropped = ImmutableList.<String>builder();
    for (String key : orig.keySet()) {
        if (!modified.containsKey(key)) {
            keysDropped.add(key);
        }
    }
    return Pair.of(valuesChanged.build(), keysDropped.build());
}

17 View Complete Implementation : CcToolchainProviderTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testConfigWithMissingToolDefs() throws Exception {
    scratch.file("a/BUILD", "load(':cc_toolchain_config.bzl', 'cc_toolchain_config')", "filegroup(", "   name='empty')", "cc_toolchain_suite(", "    name = 'a',", "    toolchains = { 'k8': ':b' },", ")", "cc_toolchain(", "    name = 'b',", "    all_files = ':empty',", "    ar_files = ':empty',", "    as_files = ':empty',", "    compiler_files = ':empty',", "    dwp_files = ':empty',", "    linker_files = ':empty',", "    strip_files = ':empty',", "    objcopy_files = ':empty',", "    toolchain_identifier = 'banana',", "    toolchain_config = ':k8-compiler_config',", ")", CcToolchainConfig.builder().withToolPaths(Pair.of("gcc", "path-to-gcc-tool"), Pair.of("ar", "ar"), Pair.of("cpp", "cpp"), Pair.of("gcov", "gcov"), Pair.of("ld", "ld"), Pair.of("nm", "nm"), Pair.of("objdump", "objdump")).build().getCcToolchainConfigRule());
    replacedysisMock.ccSupport().setupCcToolchainConfig(mockToolsConfig, CcToolchainConfig.builder());
    mockToolsConfig.create("a/cc_toolchain_config.bzl", ResourceLoader.readFromResources("com/google/devtools/build/lib/replacedysis/mock/cc_toolchain_config.bzl"));
    reporter.removeHandler(failFastHandler);
    useConfiguration("--cpu=k8", "--host_cpu=k8");
    getConfiguredTarget("//a:a");
    replacedertContainsEvent("Tool path for 'strip' is missing");
}

17 View Complete Implementation : NinjaFileParseResult.java
Copyright Apache License 2.0
Author : bazelbuild
public void addVariable(String name, int offset, NinjaVariableValue value) {
    variables.computeIfAbsent(name, k -> Lists.newArrayList()).add(Pair.of(offset, value));
}

17 View Complete Implementation : NinjaFileParseResult.java
Copyright Apache License 2.0
Author : bazelbuild
public void addRule(int offset, NinjaRule rule) {
    rules.computeIfAbsent(rule.getName(), k -> Lists.newArrayList()).add(Pair.of(offset, rule));
}

17 View Complete Implementation : NinjaScope.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Finds the variable or rule with the name <code>name</code>, defined in the current scope before
 * the <code>offset</code>. (Ninja allows to re-define the values of rules and variables.)
 */
@Nullable
private static <T> Pair<Integer, T> findByNameAndOffset(int offset, String name, NinjaScope scope, Function<NinjaScope, Map<String, List<Pair<Integer, T>>>> mapFunction) {
    List<Pair<Integer, T>> pairs = Preconditions.checkNotNull(mapFunction.apply(scope)).get(name);
    if (pairs == null) {
        // We may want to search in the parent scope.
        return null;
    }
    int insertionPoint = Collections.binarySearch(pairs, Pair.of(offset, null), Comparator.comparing(Pair::getFirst));
    if (insertionPoint >= 0) {
        // Can not be, variable can not be defined in exactly same place.
        throw new IllegalStateException("Trying to interpret declaration as reference.");
    }
    // We need to access the previous element, before the insertion point.
    int idx = -insertionPoint - 2;
    if (idx < 0) {
        // Check the parent scope.
        return null;
    }
    Pair<Integer, T> pair = pairs.get(idx);
    return Pair.of(pair.getFirst(), pair.getSecond());
}

17 View Complete Implementation : GlobCache.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Returns the future result of evaluating glob "pattern" against this
 * package's directory, using the package's cache of previously-started
 * globs if possible.
 *
 * @return the list of paths matching the pattern, relative to the package's
 *   directory.
 * @throws BadGlobException if the glob was syntactically invalid, or
 *  contained uplevel references.
 */
Future<List<Path>> getGlobUnsortedAsync(String pattern, boolean excludeDirs) throws BadGlobException {
    Future<List<Path>> cached = globCache.get(Pair.of(pattern, excludeDirs));
    if (cached == null) {
        if (maxDirectoriesToEagerlyVisit > -1 && !globalStarted.getAndSet(true)) {
            packageDirectory.prefetchPackageAsync(maxDirectoriesToEagerlyVisit);
        }
        cached = safeGlobUnsorted(pattern, excludeDirs);
        setGlobPaths(pattern, excludeDirs, cached);
    }
    return cached;
}

17 View Complete Implementation : TestTargetUtils.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Separates a list of text "tags" into a Pair of Collections, where
 * the first element are the required or positive tags and the second element
 * are the excluded or negative tags.
 * This should work on tag list provided from the command line
 * --test_tags_filters flag or on tag filters explicitly declared in the
 * suite.
 *
 * @param tagList A collection of text targets to separate.
 */
public static Pair<Collection<String>, Collection<String>> sortTagsBySense(Iterable<String> tagList) {
    Collection<String> requiredTags = new HashSet<>();
    Collection<String> excludedTags = new HashSet<>();
    for (String tag : tagList) {
        if (tag.startsWith("-")) {
            excludedTags.add(tag.substring(1));
        } else if (tag.startsWith("+")) {
            requiredTags.add(tag.substring(1));
        } else if (tag.equals("manual")) {
            // Ignore manual attribute because it is an exception: it is not a filter
            // but a property of test_suite
            continue;
        } else {
            requiredTags.add(tag);
        }
    }
    return Pair.of(requiredTags, excludedTags);
}

17 View Complete Implementation : FdoHelper.java
Copyright Apache License 2.0
Author : bazelbuild
static Pair<FdoInputFile, Artifact> getFdoInputs(RuleContext ruleContext, FdoProfileProvider fdoProfileProvider) {
    if (fdoProfileProvider == null) {
        ruleContext.ruleError("--fdo_profile/--xbinary_fdo input needs to be an fdo_profile rule");
        return null;
    }
    return Pair.of(fdoProfileProvider.getInputFile(), fdoProfileProvider.getProtoProfileArtifact());
}

17 View Complete Implementation : AspectCollectionTest.java
Copyright Apache License 2.0
Author : bazelbuild
private static Pair<Aspect, ImmutableList<Aspect>> expectDeps(Aspect a, Aspect... deps) {
    return Pair.of(a, ImmutableList.copyOf(deps));
}

17 View Complete Implementation : PackageFactoryTestBase.java
Copyright Apache License 2.0
Author : bazelbuild
private List<Pair<String, Boolean>> createGlobCacheKeys(List<String> expressions, boolean excludeDirs) {
    List<Pair<String, Boolean>> keys = Lists.newArrayListWithCapacity(expressions.size());
    for (String expression : expressions) {
        keys.add(Pair.of(expression, excludeDirs));
    }
    return keys;
}

16 View Complete Implementation : ApiExporter.java
Copyright Apache License 2.0
Author : bazelbuild
// Extracts signature and parameter default value expressions from a SkylarkCallable annotation.
private static Pair<FunctionSignature, List<String>> getSignature(SkylarkCallable annot) {
    // Build-time annotation processing ensures mandatory parameters do not follow optional ones.
    int mandatoryPositionals = 0;
    int optionalPositionals = 0;
    int mandatoryNamedOnly = 0;
    int optionalNamedOnly = 0;
    boolean hreplacedtar = false;
    String star = null;
    String starStar = null;
    ArrayList<String> params = new ArrayList<>();
    ArrayList<String> defaults = new ArrayList<>();
    // optional named-only parameters are kept aside to be spliced after the mandatory ones.
    ArrayList<String> optionalNamedOnlyParams = new ArrayList<>();
    ArrayList<String> optionalNamedOnlyDefaultValues = new ArrayList<>();
    for (com.google.devtools.build.lib.skylarkinterface.Param param : annot.parameters()) {
        // Implicit * or *args parameter separates transition from positional to named.
        // f (..., *, ... )  or  f(..., *args, ...)
        if ((param.named() || param.legacyNamed()) && !param.positional() && !hreplacedtar) {
            hreplacedtar = true;
            if (!annot.extraPositionals().name().isEmpty()) {
                star = annot.extraPositionals().name();
            }
        }
        boolean mandatory = param.defaultValue().isEmpty();
        if (mandatory) {
            // f(..., name, ...): required parameter
            params.add(param.name());
            if (hreplacedtar) {
                mandatoryNamedOnly++;
            } else {
                mandatoryPositionals++;
            }
        } else {
            // f(..., name=value, ...): optional parameter
            if (hreplacedtar) {
                optionalNamedOnly++;
                optionalNamedOnlyParams.add(param.name());
                optionalNamedOnlyDefaultValues.add(orNone(param.defaultValue()));
            } else {
                optionalPositionals++;
                params.add(param.name());
                defaults.add(orNone(param.defaultValue()));
            }
        }
    }
    params.addAll(optionalNamedOnlyParams);
    defaults.addAll(optionalNamedOnlyDefaultValues);
    // f(..., *args, ...)
    if (!annot.extraPositionals().name().isEmpty() && !hreplacedtar) {
        star = annot.extraPositionals().name();
    }
    if (star != null) {
        params.add(star);
    }
    // f(..., **kwargs)
    if (!annot.extraKeywords().name().isEmpty()) {
        starStar = annot.extraKeywords().name();
        params.add(starStar);
    }
    // TODO(adonovan): simplify; the sole caller doesn't need a complete FunctionSignature.
    FunctionSignature signature = FunctionSignature.create(mandatoryPositionals, optionalPositionals, mandatoryNamedOnly, optionalNamedOnly, star != null, starStar != null, ImmutableList.copyOf(params));
    return Pair.of(signature, defaults);
}

16 View Complete Implementation : CacheHitReportingModule.java
Copyright Apache License 2.0
Author : bazelbuild
@Subscribe
public synchronized void cacheHit(RepositoryCacheHitEvent event) {
    String repo = event.getRepo();
    if (cacheHitsByRepo.get(repo) == null) {
        cacheHitsByRepo.put(repo, new HashSet<Pair<String, URL>>());
    }
    cacheHitsByRepo.get(repo).add(Pair.of(event.getFileHash(), event.getUrl()));
}

16 View Complete Implementation : BuildEventStreamer.java
Copyright Apache License 2.0
Author : bazelbuild
// @GuardedBy annotation is doing lexical replacedysis that doesn't understand the closures below
// will be running under the synchronized block.
@SuppressWarnings("GuardedBy")
void flush() {
    List<BuildEvent> updateEvents = null;
    synchronized (this) {
        Iterable<String> allOut = ImmutableList.of();
        Iterable<String> allErr = ImmutableList.of();
        if (outErrProvider != null) {
            allOut = orEmpty(outErrProvider.getOut());
            allErr = orEmpty(outErrProvider.getErr());
        }
        if (Iterables.isEmpty(allOut) && Iterables.isEmpty(allErr)) {
            // Nothing to flush; avoid generating an unneeded progress event.
            return;
        }
        if (announcedEvents != null) {
            updateEvents = new ArrayList<>();
            List<BuildEvent> finalUpdateEvents = updateEvents;
            consumeAsPairsofStrings(allOut, allErr, (s1, s2) -> finalUpdateEvents.add(flushStdoutStderrEvent(s1, s2)));
        } else {
            consumeAsPairsofStrings(allOut, allErr, (s1, s2) -> bufferedStdoutStderrPairs.add(Pair.of(s1, s2)));
        }
    }
    if (updateEvents != null) {
        for (BuildEvent updateEvent : updateEvents) {
            for (BuildEventTransport transport : transports) {
                transport.sendBuildEvent(updateEvent);
            }
        }
    }
}

16 View Complete Implementation : DelegatingWalkableGraph.java
Copyright Apache License 2.0
Author : bazelbuild
@Override
public Map<SkyKey, Pair<SkyValue, Iterable<SkyKey>>> getValueAndRdeps(Iterable<SkyKey> keys) throws InterruptedException {
    Map<SkyKey, ? extends NodeEntry> entries = getBatch(null, Reason.WALKABLE_GRAPH_VALUE_AND_RDEPS, keys);
    Map<SkyKey, Pair<SkyValue, Iterable<SkyKey>>> result = Maps.newHashMapWithExpectedSize(entries.size());
    for (Map.Entry<SkyKey, ? extends NodeEntry> entry : entries.entrySet()) {
        Preconditions.checkState(entry.getValue().isDone(), entry);
        result.put(entry.getKey(), Pair.of(getValueFromNodeEntry(entry.getValue()), entry.getValue().getReverseDepsForDoneEntry()));
    }
    return result;
}

16 View Complete Implementation : TopLevelArtifactHelperTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void importantArtifacts() {
    setup(asList(Pair.of(HIDDEN_OUTPUT_GROUP_PREFIX + "notimportant", 1), Pair.of("important", 2)));
    ArtifactsToBuild allArtifacts = getAllArtifactsToBuild(groupProvider, null, ctx);
    replacedertThat(allArtifacts.getAllArtifacts().toList()).hreplacedize(3);
    replacedertThat(allArtifacts.getImportantArtifacts().toList()).hreplacedize(2);
}

16 View Complete Implementation : CcToolchainProviderTest.java
Copyright Apache License 2.0
Author : bazelbuild
/*
   * Crosstools should load fine with or without 'gcov-tool'. Those that define 'gcov-tool'
   * should also add a make variable.
   */
@Test
public void testGcovToolNotDefined() throws Exception {
    // Crosstool with gcov-tool
    scratch.file("a/BUILD", "load(':cc_toolchain_config.bzl', 'cc_toolchain_config')", "filegroup(", "   name='empty')", "cc_toolchain_suite(", "    name = 'a',", "    toolchains = { 'k8': ':b' },", ")", "cc_toolchain(", "    name = 'b',", "    all_files = ':empty',", "    ar_files = ':empty',", "    as_files = ':empty',", "    compiler_files = ':empty',", "    dwp_files = ':empty',", "    linker_files = ':empty',", "    strip_files = ':empty',", "    objcopy_files = ':empty',", "    toolchain_identifier = 'banana',", "    toolchain_config = ':k8-compiler_config',", ")", CcToolchainConfig.builder().withToolPaths(Pair.of("gcc", "path-to-gcc-tool"), Pair.of("ar", "ar"), Pair.of("cpp", "cpp"), Pair.of("gcov", "gcov"), Pair.of("ld", "ld"), Pair.of("nm", "nm"), Pair.of("objdump", "objdump"), Pair.of("strip", "strip")).build().getCcToolchainConfigRule());
    replacedysisMock.ccSupport().setupCcToolchainConfig(mockToolsConfig, CcToolchainConfig.builder());
    mockToolsConfig.create("a/cc_toolchain_config.bzl", ResourceLoader.readFromResources("com/google/devtools/build/lib/replacedysis/mock/cc_toolchain_config.bzl"));
    useConfiguration("--cpu=k8", "--host_cpu=k8");
    CcToolchainProvider ccToolchainProvider = (CcToolchainProvider) getConfiguredTarget("//a:a").get(ToolchainInfo.PROVIDER);
    ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
    ccToolchainProvider.addGlobalMakeVariables(builder);
    replacedertThat(builder.build().get("GCOVTOOL")).isNull();
}

16 View Complete Implementation : CcToolchainProviderTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testGcovToolDefined() throws Exception {
    // Crosstool with gcov-tool
    scratch.file("a/BUILD", "load(':cc_toolchain_config.bzl', 'cc_toolchain_config')", "filegroup(", "   name='empty')", "cc_toolchain_suite(", "    name = 'a',", "    toolchains = { 'k8': ':b' },", ")", "cc_toolchain(", "    name = 'b',", "    all_files = ':empty',", "    ar_files = ':empty',", "    as_files = ':empty',", "    compiler_files = ':empty',", "    dwp_files = ':empty',", "    linker_files = ':empty',", "    strip_files = ':empty',", "    objcopy_files = ':empty',", "    toolchain_identifier = 'banana',", "    toolchain_config = ':k8-compiler_config',", ")", CcToolchainConfig.builder().withToolPaths(Pair.of("gcc", "path-to-gcc-tool"), Pair.of("gcov-tool", "path-to-gcov-tool"), Pair.of("ar", "ar"), Pair.of("cpp", "cpp"), Pair.of("gcov", "gcov"), Pair.of("ld", "ld"), Pair.of("nm", "nm"), Pair.of("objdump", "objdump"), Pair.of("strip", "strip")).build().getCcToolchainConfigRule());
    replacedysisMock.ccSupport().setupCcToolchainConfig(mockToolsConfig, CcToolchainConfig.builder());
    mockToolsConfig.create("a/cc_toolchain_config.bzl", ResourceLoader.readFromResources("com/google/devtools/build/lib/replacedysis/mock/cc_toolchain_config.bzl"));
    useConfiguration("--cpu=k8", "--host_cpu=k8");
    CcToolchainProvider ccToolchainProvider = (CcToolchainProvider) getConfiguredTarget("//a:a").get(ToolchainInfo.PROVIDER);
    ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
    ccToolchainProvider.addGlobalMakeVariables(builder);
    replacedertThat(builder.build().get("GCOVTOOL")).isNotNull();
}

16 View Complete Implementation : ArtifactFunctionTest.java
Copyright Apache License 2.0
Author : bazelbuild
@Test
public void testMiddlemanArtifact() throws Throwable {
    Artifact output = createMiddlemanArtifact("output");
    Artifact input1 = createSourceArtifact("input1");
    Artifact input2 = createDerivedArtifact("input2");
    SpecialArtifact tree = createDerivedTreeArtifactWithAction("treeArtifact");
    TreeFileArtifact treeFile1 = createFakeTreeFileArtifact(tree, "child1", "hello1");
    TreeFileArtifact treeFile2 = createFakeTreeFileArtifact(tree, "child2", "hello2");
    file(treeFile1.getPath(), "src1");
    file(treeFile2.getPath(), "src2");
    Action action = new DummyAction(NestedSetBuilder.create(Order.STABLE_ORDER, input1, input2, tree), output, MiddlemanType.AGGREGATING_MIDDLEMAN);
    actions.add(action);
    file(input2.getPath(), "contents");
    file(input1.getPath(), "source contents");
    evaluate(Iterables.toArray(Artifact.keys(ImmutableSet.of(input2, input1, input2, tree)), SkyKey.clreplaced));
    SkyValue value = evaluateArtifactValue(output);
    ArrayList<Pair<Artifact, ?>> inputs = new ArrayList<>();
    inputs.addAll(((AggregatingArtifactValue) value).getFileArtifacts());
    inputs.addAll(((AggregatingArtifactValue) value).getTreeArtifacts());
    replacedertThat(inputs).containsExactly(Pair.of(input1, createForTesting(input1)), Pair.of(input2, createForTesting(input2)), Pair.of(tree, ((TreeArtifactValue) evaluateArtifactValue(tree))));
}

16 View Complete Implementation : EagerInvalidatorTest.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Returns a subset of {@code nodes} that are still valid and so can be invalidated.
 */
private Set<Pair<SkyKey, InvalidationType>> getValuesToInvalidate(SkyKey[] nodes) {
    Set<Pair<SkyKey, InvalidationType>> result = new HashSet<>();
    Random random = new Random(TestUtils.getRandomSeed());
    for (SkyKey node : nodes) {
        if (!isInvalidated(node)) {
            if (result.isEmpty() || random.nextInt(3) == 0) {
                // Add at least one node, if we can.
                result.add(Pair.of(node, defaultInvalidationType()));
            }
        }
    }
    return result;
}

15 View Complete Implementation : BuildView.java
Copyright Apache License 2.0
Author : bazelbuild
private static Pair<ImmutableSet<ConfiguredTarget>, ImmutableSet<ConfiguredTarget>> collectTests(TopLevelArtifactContext topLevelOptions, @Nullable Iterable<ConfiguredTarget> allTestTargets, PackageManager packageManager, ExtendedEventHandler eventHandler) throws InterruptedException {
    Set<String> outputGroups = topLevelOptions.outputGroups();
    if (!outputGroups.contains(OutputGroupInfo.FILES_TO_COMPILE) && !outputGroups.contains(OutputGroupInfo.COMPILATION_PREREQUISITES) && allTestTargets != null) {
        final boolean isExclusive = topLevelOptions.runTestsExclusively();
        ImmutableSet.Builder<ConfiguredTarget> targetsToTest = ImmutableSet.builder();
        ImmutableSet.Builder<ConfiguredTarget> targetsToTestExclusive = ImmutableSet.builder();
        for (ConfiguredTarget configuredTarget : allTestTargets) {
            Target target = null;
            try {
                target = packageManager.getTarget(eventHandler, configuredTarget.getLabel());
            } catch (NoSuchTargetException | NoSuchPackageException e) {
                eventHandler.handle(Event.error("Failed to get target when scheduling tests"));
                continue;
            }
            if (target instanceof Rule) {
                if (isExclusive || TargetUtils.isExclusiveTestRule((Rule) target)) {
                    targetsToTestExclusive.add(configuredTarget);
                } else {
                    targetsToTest.add(configuredTarget);
                }
            }
        }
        return Pair.of(targetsToTest.build(), targetsToTestExclusive.build());
    } else {
        return Pair.of(ImmutableSet.of(), ImmutableSet.of());
    }
}

15 View Complete Implementation : AutoCpuConverter.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Reverses the conversion performed by {@link #convert} to return the matching OS, CPU pair.
 */
public static Pair<CPU, OS> reverse(String input) {
    if (input == null || input.length() == 0 || "unknown".equals(input)) {
        // Use the auto-detected values.
        return Pair.of(CPU.getCurrent(), OS.getCurrent());
    }
    // Handle the easy cases.
    if (input.startsWith("darwin")) {
        return Pair.of(CPU.getCurrent(), OS.DARWIN);
    } else if (input.startsWith("freebsd")) {
        return Pair.of(CPU.getCurrent(), OS.FREEBSD);
    } else if (input.startsWith("openbsd")) {
        return Pair.of(CPU.getCurrent(), OS.OPENBSD);
    } else if (input.startsWith("x64_windows")) {
        return Pair.of(CPU.getCurrent(), OS.WINDOWS);
    }
    // Handle the Linux cases.
    if (input.equals("piii")) {
        return Pair.of(CPU.X86_32, OS.LINUX);
    } else if (input.equals("k8")) {
        return Pair.of(CPU.X86_64, OS.LINUX);
    } else if (input.equals("ppc")) {
        return Pair.of(CPU.PPC, OS.LINUX);
    } else if (input.equals("arm")) {
        return Pair.of(CPU.ARM, OS.LINUX);
    } else if (input.equals("s390x")) {
        return Pair.of(CPU.S390X, OS.LINUX);
    }
    // Use the auto-detected values.
    return Pair.of(CPU.getCurrent(), OS.getCurrent());
}

15 View Complete Implementation : NinjaPipeline.java
Copyright Apache License 2.0
Author : bazelbuild
/**
 * Parses <code>mainFile</code> and all it's children from include and subninja statements.
 *
 * @return {@link Pair} of {@link NinjaScope} with rules and expanded variables (and child
 *     scopes), and list of {@link NinjaTarget}.
 */
public Pair<NinjaScope, List<NinjaTarget>> pipeline(Path mainFile) throws GenericParsingException, InterruptedException, IOException {
    NinjaFileParseResult result = waitForFutureAndGetWithCheckedException(scheduleParsing(mainFile), GenericParsingException.clreplaced, IOException.clreplaced);
    Map<NinjaScope, List<ByteFragmentAtOffset>> rawTargets = Maps.newHashMap();
    NinjaScope scope = new NinjaScope();
    // This will cause additional parsing of included/subninja scopes, and their recursive expand.
    result.expandIntoScope(scope, rawTargets);
    return Pair.of(scope, iterateScopesScheduleTargetsParsing(scope, rawTargets));
}

15 View Complete Implementation : StandaloneTestStrategy.java
Copyright Apache License 2.0
Author : bazelbuild
private static ImmutableList<Pair<String, Path>> renameOutputs(ActionExecutionContext actionExecutionContext, TestRunnerAction action, ImmutableList<Pair<String, Path>> testOutputs, int attemptId) throws IOException {
    // Rename outputs
    String namePrefix = FileSystemUtils.removeExtension(action.getTestLog().getExecPath().getBaseName());
    Path testRoot = actionExecutionContext.getInputPath(action.getTestLog()).getParentDirectory();
    Path attemptsDir = testRoot.getChild(namePrefix + "_attempts");
    attemptsDir.createDirectory();
    String attemptPrefix = "attempt_" + attemptId;
    Path testLog = attemptsDir.getChild(attemptPrefix + ".log");
    // Get the normal test output paths, and then update them to use "attempt_N" names, and
    // attemptDir, before adding them to the outputs.
    ImmutableList.Builder<Pair<String, Path>> testOutputsBuilder = new ImmutableList.Builder<>();
    for (Pair<String, Path> testOutput : testOutputs) {
        // e.g. /testRoot/test.dir/file, an example we follow throughout this loop's comments.
        Path testOutputPath = testOutput.getSecond();
        Path destinationPath;
        if (testOutput.getFirst().equals(TestFileNameConstants.TEST_LOG)) {
            // The rename rules for the test log are different than for all the other files.
            destinationPath = testLog;
        } else {
            // e.g. test.dir/file
            PathFragment relativeToTestDirectory = testOutputPath.relativeTo(testRoot);
            // e.g. attempt_1.dir/file
            String destinationPathFragmentStr = relativeToTestDirectory.getSafePathString().replaceFirst("test", attemptPrefix);
            PathFragment destinationPathFragment = PathFragment.create(destinationPathFragmentStr);
            // e.g. /attemptsDir/attempt_1.dir/file
            destinationPath = attemptsDir.getRelative(destinationPathFragment);
            destinationPath.getParentDirectory().createDirectory();
        }
        // Move to the destination.
        testOutputPath.renameTo(destinationPath);
        testOutputsBuilder.add(Pair.of(testOutput.getFirst(), destinationPath));
    }
    return testOutputsBuilder.build();
}

15 View Complete Implementation : LibrariesToLinkCollector.java
Copyright Apache License 2.0
Author : bazelbuild
private Pair<Boolean, Boolean> addLinkerInputs(NestedSetBuilder<String> librarySearchDirectories, ImmutableSet.Builder<String> rpathEntries, SequenceBuilder librariesToLink, NestedSetBuilder<LinkerInput> expandedLinkerInputsBuilder) {
    boolean includeSolibDir = false;
    boolean includeToolchainLibrariesSolibDir = false;
    for (LinkerInput input : linkerInputs) {
        if (input.getArtifactCategory() == ArtifactCategory.DYNAMIC_LIBRARY || input.getArtifactCategory() == ArtifactCategory.INTERFACE_LIBRARY) {
            PathFragment libDir = input.getArtifact().getExecPath().getParentDirectory();
            // When COPY_DYNAMIC_LIBRARIES_TO_BINARY is enabled, dynamic libraries are not symlinked
            // under solibDir, so don't check it and don't include solibDir.
            if (!featureConfiguration.isEnabled(CppRuleClreplacedes.COPY_DYNAMIC_LIBRARIES_TO_BINARY)) {
                Preconditions.checkState(libDir.startsWith(solibDir) || libDir.startsWith(toolchainLibrariesSolibDir), "Artifact '%s' is not under directory expected '%s'," + " neither it is in directory for toolchain libraries '%'.", input.getArtifact(), solibDir, toolchainLibrariesSolibDir);
                if (libDir.equals(solibDir)) {
                    includeSolibDir = true;
                }
                if (libDir.equals(toolchainLibrariesSolibDir)) {
                    includeToolchainLibrariesSolibDir = true;
                }
            }
            addDynamicInputLinkOptions(input, librariesToLink, expandedLinkerInputsBuilder, librarySearchDirectories, rpathEntries);
        } else {
            addStaticInputLinkOptions(input, librariesToLink, expandedLinkerInputsBuilder);
        }
    }
    return Pair.of(includeSolibDir, includeToolchainLibrariesSolibDir);
}

15 View Complete Implementation : ExternalFilesHelper.java
Copyright Apache License 2.0
Author : bazelbuild
private Pair<FileType, RepositoryName> getFileTypeAndRepository(RootedPath rootedPath) {
    RepositoryName repositoryName = managedDirectoriesKnowledge.getOwnerRepository(rootedPath.getRootRelativePath());
    if (repositoryName != null) {
        anyNonOutputExternalFilesSeen = true;
        return Pair.of(FileType.EXTERNAL_IN_MANAGED_DIRECTORY, repositoryName);
    }
    FileType fileType = detectFileType(rootedPath);
    if (FileType.EXTERNAL == fileType || FileType.EXTERNAL_REPO == fileType) {
        anyNonOutputExternalFilesSeen = true;
    }
    if (FileType.OUTPUT == fileType) {
        anyOutputFilesSeen = true;
    }
    return Pair.of(fileType, null);
}