Browse Source

FsckPackParser: Fix warnings about variable hiding

Change-Id: Id1ada1cedfad5671e79df303c6dbcb6017b777ce
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.9
David Pursehouse 7 years ago
parent
commit
9c1fcf6ad7
  1. 18
      org.eclipse.jgit/src/org/eclipse/jgit/internal/fsck/FsckPackParser.java

18
org.eclipse.jgit/src/org/eclipse/jgit/internal/fsck/FsckPackParser.java

@ -219,12 +219,12 @@ public class FsckPackParser extends PackParser {
if (bytes == null) { if (bytes == null) {
return -1; return -1;
} }
int offset = (int) (channelPosition - block * blockSize); int offs = (int) (channelPosition - block * blockSize);
int bytesToCopy = Math.min(cnt, bytes.length - offset); int bytesToCopy = Math.min(cnt, bytes.length - offs);
if (bytesToCopy < 1) { if (bytesToCopy < 1) {
return -1; return -1;
} }
System.arraycopy(bytes, offset, dst, pos, bytesToCopy); System.arraycopy(bytes, offs, dst, pos, bytesToCopy);
return bytesToCopy; return bytesToCopy;
} }
@ -277,13 +277,13 @@ public class FsckPackParser extends PackParser {
PackedObjectInfo entry = getObject(i); PackedObjectInfo entry = getObject(i);
inPack.add(new ObjFromPack(entry)); inPack.add(new ObjFromPack(entry));
long offset = idx.findOffset(entry); long offs = idx.findOffset(entry);
if (offset == -1) { if (offs == -1) {
throw new CorruptPackIndexException( throw new CorruptPackIndexException(
MessageFormat.format(JGitText.get().missingObject, MessageFormat.format(JGitText.get().missingObject,
entry.getType(), entry.getName()), entry.getType(), entry.getName()),
ErrorType.MISSING_OBJ); ErrorType.MISSING_OBJ);
} else if (offset != entry.getOffset()) { } else if (offs != entry.getOffset()) {
throw new CorruptPackIndexException(MessageFormat throw new CorruptPackIndexException(MessageFormat
.format(JGitText.get().mismatchOffset, entry.getName()), .format(JGitText.get().mismatchOffset, entry.getName()),
ErrorType.MISMATCH_OFFSET); ErrorType.MISMATCH_OFFSET);
@ -317,11 +317,11 @@ public class FsckPackParser extends PackParser {
* Set the object count for overwriting the expected object count from pack * Set the object count for overwriting the expected object count from pack
* header. * header.
* *
* @param expectedObjectCount * @param objectCount
* the actual expected object count. * the actual expected object count.
*/ */
public void overwriteObjectCount(long expectedObjectCount) { public void overwriteObjectCount(long objectCount) {
this.expectedObjectCount = expectedObjectCount; this.expectedObjectCount = objectCount;
} }
static class ObjFromPack extends ObjectIdOwnerMap.Entry { static class ObjFromPack extends ObjectIdOwnerMap.Entry {

Loading…
Cancel
Save