Browse Source

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 <david.pursehouse@gmail.com>
stable-5.0
David Pursehouse 6 years ago
parent
commit
20d431f79b
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/LargePackedWholeObject.java

2
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 {

Loading…
Cancel
Save