diff options
5 files changed, 13 insertions, 3 deletions
diff --git a/org.eclipse.jgit.junit.ssh/BUILD b/org.eclipse.jgit.junit.ssh/BUILD index 50142fe5a9..f7856b5273 100644 --- a/org.eclipse.jgit.junit.ssh/BUILD +++ b/org.eclipse.jgit.junit.ssh/BUILD @@ -14,6 +14,7 @@ java_library( ], deps = [ "//lib:junit", + "//lib:slf4j-api", "//lib:sshd-osgi", "//lib:sshd-sftp", # We want these deps to be provided_deps diff --git a/org.eclipse.jgit.lfs.test/BUILD b/org.eclipse.jgit.lfs.test/BUILD index 061ecd71f7..4665f675b1 100644 --- a/org.eclipse.jgit.lfs.test/BUILD +++ b/org.eclipse.jgit.lfs.test/BUILD @@ -13,6 +13,7 @@ junit_tests( deps = [ ":helpers", "//lib:junit", + "//lib:slf4j-api", "//org.eclipse.jgit:jgit", "//org.eclipse.jgit.junit:junit", "//org.eclipse.jgit.lfs:jgit-lfs", diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java index bb725b7a35..03da61583d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java @@ -1033,7 +1033,7 @@ public class DirCache { */ DIRC_VERSION_PATHCOMPRESS(4); - private int version; + private final int version; private DirCacheVersion(int versionCode) { this.version = versionCode; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java index e7d62c7e9d..dcb84825fe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java @@ -149,7 +149,7 @@ public class DirCacheEntry { toRemove = (toRemove << 7) | (b & 0x7F); } if (toRemove < 0 - || previous != null && toRemove > previous.path.length) { + || (previous != null && toRemove > previous.path.length)) { if (previous == null) { throw new IOException(MessageFormat.format( JGitText.get().DIRCCorruptLengthFirst, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index 2d574887b3..9e409490fa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java @@ -1548,6 +1548,7 @@ public class PackWriter implements AutoCloseable { endPhase(monitor); } + @SuppressWarnings("Finally") private void parallelDeltaSearch(ProgressMonitor monitor, ObjectToPack[] list, int cnt, int threads) throws IOException { DeltaCache dc = new ThreadSafeDeltaCache(config); @@ -1569,15 +1570,22 @@ public class PackWriter implements AutoCloseable { // Caller didn't give us a way to run the tasks, spawn up a // temporary thread pool and make sure it tears down cleanly. ExecutorService pool = Executors.newFixedThreadPool(threads); + Throwable e1 = null; try { runTasks(pool, pm, taskBlock, errors); + } catch (Exception e) { + e1 = e; } finally { pool.shutdown(); for (;;) { try { - if (pool.awaitTermination(60, TimeUnit.SECONDS)) + if (pool.awaitTermination(60, TimeUnit.SECONDS)) { break; + } } catch (InterruptedException e) { + if (e1 != null) { + e.addSuppressed(e1); + } throw new IOException(JGitText .get().packingCancelledDuringObjectsWriting, e); } |