]> source.dussan.org Git - jgit.git/commit
FS: Extract GobblerThread into a private static class 08/48808/2
authorDave Borowitz <dborowitz@google.com>
Wed, 27 May 2015 16:40:32 +0000 (09:40 -0700)
committerDave Borowitz <dborowitz@google.com>
Wed, 27 May 2015 17:04:35 +0000 (10:04 -0700)
commitb8c8008115e0c48d3d844af1dc858c700a9428e4
treeda07051ae0f19f2411b7cdf8ef1774dbc7d3ff13
parent0e8ac496cd9bbfa3fa306ac45706f501fc24ac38
FS: Extract GobblerThread into a private static class

The primary goal is to improve exception readability. Since this is a
standalone thread, just logging the stack trace of the caught
exception is not very useful:

java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162)
at java.io.BufferedInputStream.read(BufferedInputStream.java:258)
at org.eclipse.jgit.util.FS$2.run(FS.java:451)

Providing a named class eliminates the "FS$2", and including the
command name provides a little more context in the error message.
A future improvement might include the stack trace that created the
GobblerThread as well.

Change-Id: Ibf16d15b47a85b6f41844a177e398c2fc94f27b0
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java