From 20d431f79b18457d274999a7b1cfab659080c753 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 27 Apr 2018 08:27:30 +0900 Subject: [PATCH] LargePackedWholeObject#openStream: Suppress resource warning Eclipse warns that DfsReader should be managed by try-with-resource. As described in 1484d6e (LargePackedWholeObject: Do not reuse released inflater, 2018-04-26), the DfsReader is owned and closed by the PackInputStream or explicitly closed in the try block's finally. Suppress the warning with a brief explanatory comment. Change-Id: I4187c935742072f3ee7f2d3551a6a98d40fc2702 Signed-off-by: David Pursehouse --- .../jgit/internal/storage/dfs/LargePackedWholeObject.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/LargePackedWholeObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/LargePackedWholeObject.java index 343dc11ae..37d8d1c01 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/LargePackedWholeObject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/LargePackedWholeObject.java @@ -105,6 +105,8 @@ final class LargePackedWholeObject extends ObjectLoader { @Override public ObjectStream openStream() throws MissingObjectException, IOException { PackInputStream packIn; + // ctx is closed by PackInputStream, or explicitly in the finally block + @SuppressWarnings("resource") DfsReader ctx = db.newReader(); try { try {