]> source.dussan.org Git - jgit.git/commit
Suppress resource warnings with Java 7 90/7790/3
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 10 Oct 2012 06:02:30 +0000 (08:02 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 25 Oct 2012 22:17:23 +0000 (15:17 -0700)
commit81fa5662953c54ba07e141284d3d9a717361b17b
tree958ada4e4c6b7b385d50fac305333c3646988dde
parentbc8794eb21319c3251cd778133541d60856eb626
Suppress resource warnings with Java 7

For streams that should not be closed, i.e. don't own an underlying
stream, and in-memory streams that do not need to be closed we just
suppress the warning. This mostly apply to test cases. GC is enough.

For streams with external resources (i.e. files) we add the necessary
call to close().

Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
13 files changed:
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileRepositoryBuilderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/TemporaryBufferTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/EolCanonicalizingInputStreamTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectoryInserter.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java