Browse Source

Fix javadoc in org.eclipse.jgit internal and fsck packages

Change-Id: Ib12da10aacda9389d594bf4f521e9a58d1935701
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
6dca3cc024
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
  2. 28
      org.eclipse.jgit/src/org/eclipse/jgit/internal/fsck/FsckError.java
  3. 33
      org.eclipse.jgit/src/org/eclipse/jgit/internal/fsck/FsckPackParser.java

2
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java

@ -53,6 +53,8 @@ import org.eclipse.jgit.nls.TranslationBundle;
public class JGitText extends TranslationBundle { public class JGitText extends TranslationBundle {
/** /**
* Get an instance of this translation bundle
*
* @return an instance of this translation bundle * @return an instance of this translation bundle
*/ */
public static JGitText get() { public static JGitText get() {

28
org.eclipse.jgit/src/org/eclipse/jgit/internal/fsck/FsckError.java

@ -51,7 +51,9 @@ import org.eclipse.jgit.errors.CorruptPackIndexException.ErrorType;
import org.eclipse.jgit.lib.ObjectChecker; import org.eclipse.jgit.lib.ObjectChecker;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
/** Holds all fsck errors of a git repository. */ /**
* Holds all fsck errors of a git repository.
*/
public class FsckError { public class FsckError {
/** Represents a corrupt object. */ /** Represents a corrupt object. */
public static class CorruptObject { public static class CorruptObject {
@ -130,22 +132,38 @@ public class FsckError {
private final Set<String> nonCommitHeads = new HashSet<>(); private final Set<String> nonCommitHeads = new HashSet<>();
/** @return corrupt objects from all pack files. */ /**
* Get corrupt objects from all pack files
*
* @return corrupt objects from all pack files
*/
public Set<CorruptObject> getCorruptObjects() { public Set<CorruptObject> getCorruptObjects() {
return corruptObjects; return corruptObjects;
} }
/** @return missing objects that should present in pack files. */ /**
* Get missing objects that should present in pack files
*
* @return missing objects that should present in pack files
*/
public Set<ObjectId> getMissingObjects() { public Set<ObjectId> getMissingObjects() {
return missingObjects; return missingObjects;
} }
/** @return corrupt index files associated with the packs. */ /**
* Get corrupt index files associated with the packs
*
* @return corrupt index files associated with the packs
*/
public Set<CorruptIndex> getCorruptIndices() { public Set<CorruptIndex> getCorruptIndices() {
return corruptIndices; return corruptIndices;
} }
/** @return refs/heads/* point to non-commit object. */ /**
* Get refs/heads/* which point to non-commit object
*
* @return refs/heads/* which point to non-commit object
*/
public Set<String> getNonCommitHeads() { public Set<String> getNonCommitHeads() {
return nonCommitHeads; return nonCommitHeads;
} }

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

@ -62,13 +62,14 @@ import org.eclipse.jgit.internal.storage.dfs.ReadableChannel;
import org.eclipse.jgit.internal.storage.file.PackIndex; import org.eclipse.jgit.internal.storage.file.PackIndex;
import org.eclipse.jgit.internal.storage.file.PackIndex.MutableEntry; import org.eclipse.jgit.internal.storage.file.PackIndex.MutableEntry;
import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.ObjectChecker;
import org.eclipse.jgit.lib.ObjectDatabase; import org.eclipse.jgit.lib.ObjectDatabase;
import org.eclipse.jgit.lib.ObjectIdOwnerMap; import org.eclipse.jgit.lib.ObjectIdOwnerMap;
import org.eclipse.jgit.transport.PackParser; import org.eclipse.jgit.transport.PackParser;
import org.eclipse.jgit.transport.PackedObjectInfo; import org.eclipse.jgit.transport.PackedObjectInfo;
/** A read-only pack parser for object validity checking. */ /**
* A read-only pack parser for object validity checking.
*/
public class FsckPackParser extends PackParser { public class FsckPackParser extends PackParser {
private final CRC32 crc; private final CRC32 crc;
@ -83,6 +84,8 @@ public class FsckPackParser extends PackParser {
private int blockSize; private int blockSize;
/** /**
* Constructor for FsckPackParser
*
* @param db * @param db
* the object database which stores repository's data. * the object database which stores repository's data.
* @param channel * @param channel
@ -96,6 +99,7 @@ public class FsckPackParser extends PackParser {
this.blockSize = channel.blockSize() > 0 ? channel.blockSize() : 65536; this.blockSize = channel.blockSize() > 0 ? channel.blockSize() : 65536;
} }
/** {@inheritDoc} */
@Override @Override
protected void onPackHeader(long objCnt) throws IOException { protected void onPackHeader(long objCnt) throws IOException {
if (expectedObjectCount >= 0) { if (expectedObjectCount >= 0) {
@ -107,41 +111,48 @@ public class FsckPackParser extends PackParser {
} }
} }
/** {@inheritDoc} */
@Override @Override
protected void onBeginWholeObject(long streamPosition, int type, protected void onBeginWholeObject(long streamPosition, int type,
long inflatedSize) throws IOException { long inflatedSize) throws IOException {
crc.reset(); crc.reset();
} }
/** {@inheritDoc} */
@Override @Override
protected void onObjectHeader(Source src, byte[] raw, int pos, int len) protected void onObjectHeader(Source src, byte[] raw, int pos, int len)
throws IOException { throws IOException {
crc.update(raw, pos, len); crc.update(raw, pos, len);
} }
/** {@inheritDoc} */
@Override @Override
protected void onObjectData(Source src, byte[] raw, int pos, int len) protected void onObjectData(Source src, byte[] raw, int pos, int len)
throws IOException { throws IOException {
crc.update(raw, pos, len); crc.update(raw, pos, len);
} }
/** {@inheritDoc} */
@Override @Override
protected void onEndWholeObject(PackedObjectInfo info) throws IOException { protected void onEndWholeObject(PackedObjectInfo info) throws IOException {
info.setCRC((int) crc.getValue()); info.setCRC((int) crc.getValue());
} }
/** {@inheritDoc} */
@Override @Override
protected void onBeginOfsDelta(long deltaStreamPosition, protected void onBeginOfsDelta(long deltaStreamPosition,
long baseStreamPosition, long inflatedSize) throws IOException { long baseStreamPosition, long inflatedSize) throws IOException {
crc.reset(); crc.reset();
} }
/** {@inheritDoc} */
@Override @Override
protected void onBeginRefDelta(long deltaStreamPosition, AnyObjectId baseId, protected void onBeginRefDelta(long deltaStreamPosition, AnyObjectId baseId,
long inflatedSize) throws IOException { long inflatedSize) throws IOException {
crc.reset(); crc.reset();
} }
/** {@inheritDoc} */
@Override @Override
protected UnresolvedDelta onEndDelta() throws IOException { protected UnresolvedDelta onEndDelta() throws IOException {
UnresolvedDelta delta = new UnresolvedDelta(); UnresolvedDelta delta = new UnresolvedDelta();
@ -149,12 +160,14 @@ public class FsckPackParser extends PackParser {
return delta; return delta;
} }
/** {@inheritDoc} */
@Override @Override
protected void onInflatedObjectData(PackedObjectInfo obj, int typeCode, protected void onInflatedObjectData(PackedObjectInfo obj, int typeCode,
byte[] data) throws IOException { byte[] data) throws IOException {
// FsckPackParser ignores this event. // FsckPackParser ignores this event.
} }
/** {@inheritDoc} */
@Override @Override
protected void verifySafeObject(final AnyObjectId id, final int type, protected void verifySafeObject(final AnyObjectId id, final int type,
final byte[] data) { final byte[] data) {
@ -170,11 +183,13 @@ public class FsckPackParser extends PackParser {
} }
} }
/** {@inheritDoc} */
@Override @Override
protected void onPackFooter(byte[] hash) throws IOException { protected void onPackFooter(byte[] hash) throws IOException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
protected boolean onAppendBase(int typeCode, byte[] data, protected boolean onAppendBase(int typeCode, byte[] data,
PackedObjectInfo info) throws IOException { PackedObjectInfo info) throws IOException {
@ -182,11 +197,13 @@ public class FsckPackParser extends PackParser {
return false; return false;
} }
/** {@inheritDoc} */
@Override @Override
protected void onEndThinPack() throws IOException { protected void onEndThinPack() throws IOException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
protected ObjectTypeAndSize seekDatabase(PackedObjectInfo obj, protected ObjectTypeAndSize seekDatabase(PackedObjectInfo obj,
ObjectTypeAndSize info) throws IOException { ObjectTypeAndSize info) throws IOException {
@ -195,6 +212,7 @@ public class FsckPackParser extends PackParser {
return readObjectHeader(info); return readObjectHeader(info);
} }
/** {@inheritDoc} */
@Override @Override
protected ObjectTypeAndSize seekDatabase(UnresolvedDelta delta, protected ObjectTypeAndSize seekDatabase(UnresolvedDelta delta,
ObjectTypeAndSize info) throws IOException { ObjectTypeAndSize info) throws IOException {
@ -203,6 +221,7 @@ public class FsckPackParser extends PackParser {
return readObjectHeader(info); return readObjectHeader(info);
} }
/** {@inheritDoc} */
@Override @Override
protected int readDatabase(byte[] dst, int pos, int cnt) protected int readDatabase(byte[] dst, int pos, int cnt)
throws IOException { throws IOException {
@ -247,11 +266,13 @@ public class FsckPackParser extends PackParser {
return buf.array(); return buf.array();
} }
/** {@inheritDoc} */
@Override @Override
protected boolean checkCRC(int oldCRC) { protected boolean checkCRC(int oldCRC) {
return oldCRC == (int) crc.getValue(); return oldCRC == (int) crc.getValue();
} }
/** {@inheritDoc} */
@Override @Override
protected void onStoreStream(byte[] raw, int pos, int len) protected void onStoreStream(byte[] raw, int pos, int len)
throws IOException { throws IOException {
@ -259,7 +280,11 @@ public class FsckPackParser extends PackParser {
} }
/** /**
* @return corrupt objects that reported by {@link ObjectChecker}. * Get corrupt objects reported by
* {@link org.eclipse.jgit.lib.ObjectChecker}
*
* @return corrupt objects that are reported by
* {@link org.eclipse.jgit.lib.ObjectChecker}.
*/ */
public Set<CorruptObject> getCorruptObjects() { public Set<CorruptObject> getCorruptObjects() {
return corruptObjects; return corruptObjects;
@ -270,7 +295,7 @@ public class FsckPackParser extends PackParser {
* *
* @param idx * @param idx
* index file associate with the pack * index file associate with the pack
* @throws CorruptPackIndexException * @throws org.eclipse.jgit.errors.CorruptPackIndexException
* when the index file is corrupt. * when the index file is corrupt.
*/ */
public void verifyIndex(PackIndex idx) public void verifyIndex(PackIndex idx)

Loading…
Cancel
Save