Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java48
1 files changed, 23 insertions, 25 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
index a0efbe30bd..b4d669807a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
@@ -133,12 +133,18 @@ public final class DfsPackFile extends BlockBasedFile {
length = sz > 0 ? sz : -1;
}
- /** @return description that was originally used to configure this pack file. */
+ /**
+ * Get description that was originally used to configure this pack file.
+ *
+ * @return description that was originally used to configure this pack file.
+ */
public DfsPackDescription getPackDescription() {
return desc;
}
/**
+ * Whether the pack index file is loaded and cached in memory.
+ *
* @return whether the pack index file is loaded and cached in memory.
*/
public boolean isIndexLoaded() {
@@ -160,7 +166,7 @@ public final class DfsPackFile extends BlockBasedFile {
* reader context to support reading from the backing store if
* the index is not already loaded in memory.
* @return the PackIndex.
- * @throws IOException
+ * @throws java.io.IOException
* the pack index is not available, or is corrupt.
*/
public PackIndex getPackIndex(DfsReader ctx) throws IOException {
@@ -353,7 +359,7 @@ public final class DfsPackFile extends BlockBasedFile {
* @param id
* object to be located.
* @return true if the object exists in this pack; false if it does not.
- * @throws IOException
+ * @throws java.io.IOException
* the pack index is not available, or is corrupt.
*/
public boolean hasObject(DfsReader ctx, AnyObjectId id) throws IOException {
@@ -536,10 +542,8 @@ public final class DfsPackFile extends BlockBasedFile {
try {
readFully(src.offset, buf, 0, 20, ctx);
} catch (IOException ioError) {
- StoredObjectRepresentationNotAvailableException gone;
- gone = new StoredObjectRepresentationNotAvailableException(src);
- gone.initCause(ioError);
- throw gone;
+ throw new StoredObjectRepresentationNotAvailableException(src,
+ ioError);
}
int c = buf[0] & 0xff;
final int typeCode = (c >> 4) & 7;
@@ -656,19 +660,15 @@ public final class DfsPackFile extends BlockBasedFile {
CorruptObjectException corruptObject = new CorruptObjectException(
MessageFormat.format(
JGitText.get().objectAtHasBadZlibStream,
- Long.valueOf(src.offset), getFileName()));
- corruptObject.initCause(dataFormat);
+ Long.valueOf(src.offset), getFileName()),
+ dataFormat);
- StoredObjectRepresentationNotAvailableException gone;
- gone = new StoredObjectRepresentationNotAvailableException(src);
- gone.initCause(corruptObject);
- throw gone;
+ throw new StoredObjectRepresentationNotAvailableException(src,
+ corruptObject);
} catch (IOException ioError) {
- StoredObjectRepresentationNotAvailableException gone;
- gone = new StoredObjectRepresentationNotAvailableException(src);
- gone.initCause(ioError);
- throw gone;
+ throw new StoredObjectRepresentationNotAvailableException(src,
+ ioError);
}
if (quickCopy != null) {
@@ -871,12 +871,11 @@ public final class DfsPackFile extends BlockBasedFile {
return new ObjectLoader.SmallObject(type, data);
} catch (DataFormatException dfe) {
- CorruptObjectException coe = new CorruptObjectException(
+ throw new CorruptObjectException(
MessageFormat.format(
JGitText.get().objectAtHasBadZlibStream, Long.valueOf(pos),
- getFileName()));
- coe.initCause(dfe);
- throw coe;
+ getFileName()),
+ dfe);
}
}
@@ -1019,12 +1018,11 @@ public final class DfsPackFile extends BlockBasedFile {
try {
return BinaryDelta.getResultSize(getDeltaHeader(ctx, deltaAt));
} catch (DataFormatException dfe) {
- CorruptObjectException coe = new CorruptObjectException(
+ throw new CorruptObjectException(
MessageFormat.format(
JGitText.get().objectAtHasBadZlibStream, Long.valueOf(pos),
- getFileName()));
- coe.initCause(dfe);
- throw coe;
+ getFileName()),
+ dfe);
}
}

Back to the top