Browse Source

Fix hidden field warnings in bundle org.eclipse.jgit

Change-Id: I4e79cefe15037df0e1c520956bf2482240e31a7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.1
Matthias Sohn 10 years ago
parent
commit
faae5cdb5b
  1. 11
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java
  2. 8
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

11
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);

8
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<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()) {

Loading…
Cancel
Save