summaryrefslogtreecommitdiffstats
authorRobin Stocker2010-10-29 08:52:52 (EDT)
committer Robin Stocker2010-10-29 08:52:52 (EDT)
commit96bea14c7bad229a65cd6f9dac0c33fd81306724 (patch) (side-by-side diff)
treed580fcd6de43cbff7d52192657174d93f118da1b
parent7f939ba86e4c4ce379b4dc62045109a91e97dd72 (diff)
downloadjgit-96bea14c7bad229a65cd6f9dac0c33fd81306724.zip
jgit-96bea14c7bad229a65cd6f9dac0c33fd81306724.tar.gz
jgit-96bea14c7bad229a65cd6f9dac0c33fd81306724.tar.bz2
Use readFully() instead of read()refs/changes/20/1820/1
Fixes the "Method ignores results of InputStream.read()" warning. This is the only place where read() was used instead of readFully() and the return value was not checked. So it was either an oversight or should be documented. This change assumes it was an oversight. Change-Id: I859404a7d80449c538a552427787f3e57d7c92b4
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
index 2bf0b96..fef38cc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
@@ -599,7 +599,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
JGitText.get().packObjectCountMismatch, packCnt, idx.getObjectCount(), getPackFile()));
fd.seek(length - 20);
- fd.read(buf, 0, 20);
+ fd.readFully(buf, 0, 20);
if (!Arrays.equals(buf, packChecksum))
throw new PackMismatchException(MessageFormat.format(
JGitText.get().packObjectCountMismatch