SiteLibraryLoaderUtil: catch NoSuchFileException when scanning for JARs
Without this, a stack trace is emitted to the console log. This causes
a lot of noise particularly when running acceptance tests in Eclipse
because it is emitted on every test.
See [1] for an example of the stack trace.
[1] http://paste.openstack.org/show/182219/
Change-Id: I1624f6a6aa42ae73ae1e97d1cb53d593184567ab
diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java b/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java
index 24451a4..2511a51 100644
--- a/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java
+++ b/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java
@@ -17,6 +17,7 @@
import static com.google.gerrit.common.FileUtil.lastModified;
import com.google.common.collect.ComparisonChain;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Ordering;
import org.slf4j.Logger;
@@ -25,6 +26,7 @@
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.List;
@@ -60,6 +62,8 @@
.result();
}
}.sortedCopy(jars);
+ } catch (NoSuchFileException nsfe) {
+ return ImmutableList.of();
}
}