]> source.dussan.org Git - jgit.git/commitdiff
Fix hidden field warnings in bundle org.eclipse.jgit 06/45706/7
authorMatthias Sohn <matthias.sohn@sap.com>
Sat, 11 Apr 2015 22:51:37 +0000 (00:51 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 28 May 2015 22:15:32 +0000 (00:15 +0200)
Change-Id: I4e79cefe15037df0e1c520956bf2482240e31a7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

index a186b8147088dd7379aa950c0183ea5be8f34f10..1c076ee0998a7d7e0389316eb5e515c412901fd5 100644 (file)
@@ -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);
 
index c60590dda40f75a587457ee8fc156351d33c5f45..753277dd3fd69f6acece941d9bdf481a332bf809 100644 (file)
@@ -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<String, Ref> refs = getAdvertisedOrDefaultRefs();
-               findSymrefs(adv, refs);
-               advertised = adv.send(refs);
+               Map<String, Ref> 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<String, Ref> refs) {
                Ref head = refs.get(Constants.HEAD);
                if (head != null && head.isSymbolic()) {