Rollback of commit
*** Reason for rollback ***
bazelbuild/bazel#2123 is fixed
*** Original change description ***
Fix JavaLibraryBuildRequest for java 7
Bazel still supports java 7. This cl fixes a java 8-only construct introduced by commit
Liam, feel free to fix it to your liking afterwards.
MOS_MIGRATED_REVID=144511670
@@ -27,7 +27,6 @@ import com.google.devtools.build.buildjar.javac.plugins.processing.AnnotationPro
import java.io.File;
import java.io.IOError;
import java.io.IOException;
-import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -310,9 +309,7 @@ public final class JavaLibraryBuildRequest {
try {
Path path = Paths.get(file);
if (Files.isDirectory(path)) {
- try (DirectoryStream<Path> directoryContents = Files.newDirectoryStream(path)) {
- jars.addAll(directoryContents);
- }
+ Files.list(path).forEach(jars::add);
} else {
jars.add(path);
}
