summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-20 11:43:15 +0900
committerMatthias Sohn <matthias.sohn@sap.com>2018-03-24 22:32:59 +0100
commit84a6318eae2a291377807df6e93386b3407eccd3 (patch)
tree6afbc158f579edc3ec689b084201a851d972c450 /org.eclipse.jgit
parentb3a4ace695328945fcebb85be102733c97c498ac (diff)
downloadjgit-84a6318eae2a291377807df6e93386b3407eccd3.tar.gz
jgit-84a6318eae2a291377807df6e93386b3407eccd3.zip
DfsInserter#openStream: Suppress resource warning about DfsReader
DfsReader is not opened in a try-with-resource because in the case where the method returns an ObjectStream.Filter, the DfsReader should only be closed from within the Filter's close() method. Suppress the resource warning. Change-Id: Ifcaf5e4a326bd1d03c6331b476c645ca43943b34 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
index 2723fd1923..1220b122b8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
@@ -669,6 +669,7 @@ public class DfsInserter extends ObjectInserter {
@Override
public ObjectStream openStream() throws IOException {
+ @SuppressWarnings("resource") // Explicitly closed below
final DfsReader ctx = db.newReader();
if (srcPack != packKey) {
try {