From: Matthias Sohn Date: Sat, 11 Apr 2015 22:51:37 +0000 (+0200) Subject: Fix hidden field warnings in bundle org.eclipse.jgit X-Git-Tag: v4.0.0.201506020755-rc3~1^2~6^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F45706%2F7;p=jgit.git Fix hidden field warnings in bundle org.eclipse.jgit Change-Id: I4e79cefe15037df0e1c520956bf2482240e31a7d Signed-off-by: Matthias Sohn --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java index a186b81470..1c076ee099 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java @@ -366,11 +366,10 @@ public class ObjectDirectoryPackParser extends PackParser { @Override protected void onEndThinPack() throws IOException { - final byte[] tailHash = this.tailDigest.digest(); final byte[] buf = buffer(); final MessageDigest origDigest = Constants.newMessageDigest(); - final MessageDigest tailDigest = Constants.newMessageDigest(); + final MessageDigest tailDigest2 = Constants.newMessageDigest(); final MessageDigest packDigest = Constants.newMessageDigest(); long origRemaining = origEnd; @@ -393,15 +392,15 @@ public class ObjectDirectoryPackParser extends PackParser { origDigest.update(buf, 0, origCnt); origRemaining -= origCnt; if (origRemaining == 0) - tailDigest.update(buf, origCnt, n - origCnt); + tailDigest2.update(buf, origCnt, n - origCnt); } else - tailDigest.update(buf, 0, n); + tailDigest2.update(buf, 0, n); packDigest.update(buf, 0, n); } - if (!Arrays.equals(origDigest.digest(), origHash) - || !Arrays.equals(tailDigest.digest(), tailHash)) + if (!Arrays.equals(origDigest.digest(), origHash) || !Arrays + .equals(tailDigest2.digest(), this.tailDigest.digest())) throw new IOException( JGitText.get().packCorruptedWhileWritingToFilesystem); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index c60590dda4..753277dd3f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -810,9 +810,9 @@ public class UploadPack { adv.advertiseCapability(OPTION_ALLOW_TIP_SHA1_IN_WANT); adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); adv.setDerefTags(true); - Map refs = getAdvertisedOrDefaultRefs(); - findSymrefs(adv, refs); - advertised = adv.send(refs); + Map advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs(); + findSymrefs(adv, advertisedOrDefaultRefs); + advertised = adv.send(advertisedOrDefaultRefs); if (adv.isEmpty()) adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); //$NON-NLS-1$ adv.end(); @@ -1467,7 +1467,7 @@ public class UploadPack { pckOut.end(); } - private void findSymrefs( + private static void findSymrefs( final RefAdvertiser adv, final Map refs) { Ref head = refs.get(Constants.HEAD); if (head != null && head.isSymbolic()) {