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

Loading…
Cancel
Save