Merge changes I343cc3cf,I9dedf61b
* changes:
Avoid error-prone warning
Fix unused exception error-prone warning
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcCommitGraphTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcCommitGraphTest.java
index 358e19e..dbc9dba 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcCommitGraphTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcCommitGraphTest.java
@@ -90,7 +90,7 @@
bb.update(tip);
assertTrue(gc.shouldWriteCommitGraphWhenGc());
- gc.gc();
+ gc.gc().get();
File graphFile = new File(repo.getObjectsDirectory(),
Constants.INFO_COMMIT_GRAPH);
assertGraphFile(graphFile);
@@ -103,7 +103,7 @@
bb.update(tip);
assertFalse(gc.shouldWriteCommitGraphWhenGc());
- gc.gc();
+ gc.gc().get();
File graphFile = new File(repo.getObjectsDirectory(),
Constants.INFO_COMMIT_GRAPH);
assertFalse(graphFile.exists());
@@ -123,21 +123,21 @@
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, true);
- gc.gc();
+ gc.gc().get();
assertFalse(graphFile.exists());
config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
ConfigConstants.CONFIG_COMMIT_GRAPH, true);
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, false);
- gc.gc();
+ gc.gc().get();
assertFalse(graphFile.exists());
config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
ConfigConstants.CONFIG_COMMIT_GRAPH, false);
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, false);
- gc.gc();
+ gc.gc().get();
assertFalse(graphFile.exists());
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java
index ddc4a9d..d74766d 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java
@@ -247,7 +247,7 @@
assertTrue(curs.getCommitGraph().isEmpty());
commitFile("file.txt", "content", "master");
GC gc = new GC(db);
- gc.gc();
+ gc.gc().get();
assertTrue(curs.getCommitGraph().isPresent());
db.getConfig().setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
@@ -286,7 +286,7 @@
// add commit-graph
commitFile("file.txt", "content", "master");
GC gc = new GC(db);
- gc.gc();
+ gc.gc().get();
File file = new File(db.getObjectsDirectory(),
Constants.INFO_COMMIT_GRAPH);
assertTrue(file.exists());
@@ -296,7 +296,7 @@
// update commit-graph
commitFile("file2.txt", "content", "master");
- gc.gc();
+ gc.gc().get();
assertEquals(2, dir.getCommitGraph().get().getCommitCnt());
// delete commit-graph
@@ -311,7 +311,7 @@
assertTrue(dir.getCommitGraph().isEmpty());
// add commit-graph again
- gc.gc();
+ gc.gc().get();
assertTrue(dir.getCommitGraph().isPresent());
assertEquals(2, dir.getCommitGraph().get().getCommitCnt());
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java
index 05e023b..6c80145 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java
@@ -309,7 +309,7 @@
db.getConfig().setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, true);
GC gc = new GC(db);
- gc.gc();
+ gc.gc().get();
}
private void reinitializeRevWalk() {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LooseObjects.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LooseObjects.java
index b9af83d..326c5f6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LooseObjects.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LooseObjects.java
@@ -254,7 +254,7 @@
// refresh directory to work around NFS caching issue
}
return getSizeWithoutRefresh(curs, id);
- } catch (FileNotFoundException e) {
+ } catch (FileNotFoundException unused) {
if (fileFor(id).exists()) {
throw noFile;
}