aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMarco Miller <marco.miller@ericsson.com>2020-09-02 16:49:41 -0400
committerMarco Miller <marco.miller@ericsson.com>2020-09-02 16:50:05 -0400
commitdf6a1c55fa12a296476848e2b2fa1842abafa46d (patch)
tree12172d591ebfa85b672669325dae3da387f3ae27 /org.eclipse.jgit
parent6ae1a300041b33dc00550f68f6dd417b40c2922d (diff)
parent14d5a7497f2f599d6bc24dbccd90a2a22ccbd599 (diff)
downloadjgit-df6a1c55fa12a296476848e2b2fa1842abafa46d.tar.gz
jgit-df6a1c55fa12a296476848e2b2fa1842abafa46d.zip
Merge branch 'stable-5.9'
* stable-5.9: Upgrade maven-resources-plugin to 3.2.0 Upgrade plexus-compiler version to 2.8.8 [bazel] Add missing dependency to slf4j-api [errorprone] DirCacheEntry: make clear operator precedence [errorprone] PackWriter#parallelDeltaSearch: avoid suppressed exception [errorprone] Declare DirCache#version final Add jgit-4.17-staging target platform for 2020-09 Update target platform to R20200831200620 Signed-off-by: Marco Miller <marco.miller@ericsson.com> Change-Id: I2e2f41cf6ebbcb45b8978b519db3f1c8f7afb5f4
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java10
3 files changed, 11 insertions, 3 deletions
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);
}