diff options
Diffstat (limited to 'java/com/google/devtools/build/android/desugar/LambdaClassMaker.java')
-rw-r--r-- | java/com/google/devtools/build/android/desugar/LambdaClassMaker.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/java/com/google/devtools/build/android/desugar/LambdaClassMaker.java b/java/com/google/devtools/build/android/desugar/LambdaClassMaker.java index d8f2e28..2a9f9be 100644 --- a/java/com/google/devtools/build/android/desugar/LambdaClassMaker.java +++ b/java/com/google/devtools/build/android/desugar/LambdaClassMaker.java @@ -54,7 +54,7 @@ class LambdaClassMaker { } /** - * Returns relative paths to .class files generated since the last call to this method together + * Returns absolute paths to .class files generated since the last call to this method together * with a string descriptor of the factory method. */ public Map<Path, LambdaInfo> drain() { @@ -68,12 +68,12 @@ class LambdaClassMaker { // will not contain '/' and searches will fail. So, construct an absolute path from the given // string and use its string representation to find the file we need regardless of host // system's file system - final String rootPathPrefixStr = rootDirectory.resolve(pathPrefix).toString(); + Path rootPathPrefix = rootDirectory.resolve(pathPrefix); + final String rootPathPrefixStr = rootPathPrefix.toString(); - // TODO(kmb): Investigate making this faster in the case of many lambdas // TODO(bazel-team): This could be much nicer with lambdas - try (Stream<Path> results = - Files.walk(rootDirectory) + try (Stream<Path> paths = + Files.list(rootPathPrefix.getParent()) .filter( new Predicate<Path>() { @Override @@ -82,7 +82,7 @@ class LambdaClassMaker { && !generatedClasses.containsKey(path); } })) { - return Iterators.getOnlyElement(results.iterator()); + return Iterators.getOnlyElement(paths.iterator()); } } } |