}
/**
+ * {@inheritDoc}
+ * <p>
* Remove the first commit from the queue.
- *
- * @return the first commit of this queue.
*/
@Override
public abstract RevCommit next();
- /** Remove all entries from this queue. */
+ /**
+ * Remove all entries from this queue.
+ */
public abstract void clear();
abstract boolean everbodyHasFlag(int f);
return outputType;
}
+ /**
+ * Describe this queue
+ *
+ * @param s
+ * a StringBuilder
+ * @param c
+ * a {@link org.eclipse.jgit.revwalk.RevCommit}
+ */
protected static void describe(final StringBuilder s, final RevCommit c) {
s.append(c.toString());
s.append('\n');
* Obtain the next object.
*
* @return the object; null if there are no more objects remaining.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the object does not exist. There may be more objects
* remaining in the iteration, the application should call
* {@link #next()} again.
- * @throws IOException
+ * @throws java.io.IOException
* the object store cannot be accessed.
*/
public RevObject next() throws MissingObjectException, IOException;
/**
* Return, as a bitmap, the objects reachable from the objects in start.
*
- * @param start the objects to start the object traversal from.
- * @param seen the objects to skip if encountered during traversal.
- * @param ignoreMissing true to ignore missing objects, false otherwise.
+ * @param start
+ * the objects to start the object traversal from.
+ * @param seen
+ * the objects to skip if encountered during traversal.
+ * @param ignoreMissing
+ * true to ignore missing objects, false otherwise.
* @return as a bitmap, the objects reachable from the objects in start.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the object supplied is not available from the object
* database. This usually indicates the supplied object is
* invalid, but the reference was constructed during an earlier
- * invocation to {@link RevWalk#lookupAny(AnyObjectId, int)}.
- * @throws IncorrectObjectTypeException
+ * invocation to
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}.
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually the type of the instance
* passed in. This usually indicates the caller used the wrong
- * type in a {@link RevWalk#lookupAny(AnyObjectId, int)} call.
- * @throws IOException
+ * type in a
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}
+ * call.
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public BitmapBuilder findObjects(Iterable<? extends ObjectId> start, BitmapBuilder seen,
abstract class BlockRevQueue extends AbstractRevQueue {
protected BlockFreeList free;
- /** Create an empty revision queue. */
+ /**
+ * Create an empty revision queue.
+ */
protected BlockRevQueue() {
free = new BlockFreeList();
}
}
/**
+ * {@inheritDoc}
+ * <p>
* Reconfigure this queue to share the same free list as another.
* <p>
* Multiple revision queues can be connected to the same free list, making
* <p>
* Free lists are not thread-safe. Applications must ensure that all queues
* sharing the same free list are doing so from only a single thread.
- *
- * @param q
- * the other queue we will steal entries from.
*/
@Override
public void shareFreeList(final BlockRevQueue q) {
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
-/** A queue of commits sorted by commit time order. */
+/**
+ * A queue of commits sorted by commit time order.
+ */
public class DateRevQueue extends AbstractRevQueue {
private static final int REBUILD_INDEX_COUNT = 1000;
private int last = -1;
- /** Create an empty date queue. */
+ /**
+ * Create an empty date queue.
+ */
public DateRevQueue() {
super();
}
}
}
+ /** {@inheritDoc} */
@Override
public void add(final RevCommit c) {
sinceLastIndex++;
}
}
+ /** {@inheritDoc} */
@Override
public RevCommit next() {
final Entry q = head;
return head != null ? head.commit : null;
}
+ /** {@inheritDoc} */
@Override
public void clear() {
head = null;
return outputType | SORT_COMMIT_TIME_DESC;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.Repository;
-/** Interface for revision walkers that perform depth filtering. */
+/**
+ * Interface for revision walkers that perform depth filtering.
+ */
public interface DepthWalk {
- /** @return Depth to filter to. */
+ /**
+ * Get depth to filter to.
+ *
+ * @return Depth to filter to.
+ */
public int getDepth();
/** @return flag marking commits that should become unshallow. */
+ /**
+ * Get flag marking commits that should become unshallow.
+ *
+ * @return flag marking commits that should become unshallow.
+ */
public RevFlag getUnshallowFlag();
- /** @return flag marking commits that are interesting again. */
+ /**
+ * Get flag marking commits that are interesting again.
+ *
+ * @return flag marking commits that are interesting again.
+ */
public RevFlag getReinterestingFlag();
/** RevCommit with a depth (in commits) from a root. */
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
-/** A queue of commits in FIFO order. */
+/**
+ * A queue of commits in FIFO order.
+ */
public class FIFORevQueue extends BlockRevQueue {
private Block head;
private Block tail;
- /** Create an empty FIFO queue. */
+ /**
+ * Create an empty FIFO queue.
+ */
public FIFORevQueue() {
super();
}
super(s);
}
+ /** {@inheritDoc} */
@Override
public void add(final RevCommit c) {
Block b = tail;
head = b;
}
+ /** {@inheritDoc} */
@Override
public RevCommit next() {
final Block b = head;
return c;
}
+ /** {@inheritDoc} */
@Override
public void clear() {
head = null;
}
}
+ /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
* triggers rename detection so that the path node is updated to include a prior
* file name as the RevWalk traverses history.
*
- * The renames found will be reported to a {@link RenameCallback} if one is set.
+ * The renames found will be reported to a
+ * {@link org.eclipse.jgit.revwalk.RenameCallback} if one is set.
* <p>
* Results with this filter are unpredictable if the path being followed is a
* subdirectory.
* @param cfg
* diff config specifying rename detection options.
* @return a new filter for the requested path.
- * @throws IllegalArgumentException
+ * @throws java.lang.IllegalArgumentException
* the path supplied was the empty string.
* @since 3.0
*/
}
/** @return the path this filter matches. */
+ /**
+ * Get the path this filter matches.
+ *
+ * @return the path this filter matches.
+ */
public String getPath() {
return path.getPath();
}
+ /** {@inheritDoc} */
@Override
public boolean include(final TreeWalk walker)
throws MissingObjectException, IncorrectObjectTypeException,
return path.include(walker) && ANY_DIFF.include(walker);
}
+ /** {@inheritDoc} */
@Override
public boolean shouldBeRecursive() {
return path.shouldBeRecursive() || ANY_DIFF.shouldBeRecursive();
}
+ /** {@inheritDoc} */
@Override
public TreeFilter clone() {
return new FollowFilter(path.clone(), cfg);
}
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
}
/**
+ * Get the callback to which renames are reported.
+ *
* @return the callback to which renames are reported, or <code>null</code>
* if none
*/
import org.eclipse.jgit.lib.Constants;
-/** Case insensitive key for a {@link FooterLine}. */
+/**
+ * Case insensitive key for a {@link org.eclipse.jgit.revwalk.FooterLine}.
+ */
public final class FooterKey {
/** Standard {@code Signed-off-by} */
public static final FooterKey SIGNED_OFF_BY = new FooterKey("Signed-off-by"); //$NON-NLS-1$
raw = Constants.encode(keyName.toLowerCase(Locale.ROOT));
}
- /** @return name of this footer line. */
+ /**
+ * Get name of this footer line.
+ *
+ * @return name of this footer line.
+ */
public String getName() {
return name;
}
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
}
/**
+ * Whether keys match
+ *
* @param key
* key to test this line's key name against.
* @return true if {@code key.getName().equalsIgnorecase(getKey())}.
}
/**
+ * Get key name of this footer.
+ *
* @return key name of this footer; that is the text before the ":" on the
* line footer's line. The text is decoded according to the commit's
* specified (or assumed) character encoding.
}
/**
+ * Get value of this footer.
+ *
* @return value of this footer; that is the text after the ":" and any
* leading whitespace has been skipped. May be the empty string if
* the footer has no value (line ended with ":"). The text is
return RawParseUtils.decode(enc, buffer, lt, gt - 1);
}
+ /** {@inheritDoc} */
@Override
public String toString() {
return getKey() + ": " + getValue(); //$NON-NLS-1$
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
-/** A queue of commits in LIFO order. */
+/**
+ * A queue of commits in LIFO order.
+ */
public class LIFORevQueue extends BlockRevQueue {
private Block head;
- /** Create an empty LIFO queue. */
+ /**
+ * Create an empty LIFO queue.
+ */
public LIFORevQueue() {
super();
}
super(s);
}
+ /** {@inheritDoc} */
@Override
public void add(final RevCommit c) {
Block b = head;
b.unpop(c);
}
+ /** {@inheritDoc} */
@Override
public RevCommit next() {
final Block b = head;
return c;
}
+ /** {@inheritDoc} */
@Override
public void clear() {
head = null;
return false;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
* scheduled for inclusion in the results of {@link #nextObject()}, returning
* each object exactly once. Objects are sorted and returned according to the
* the commits that reference them and the order they appear within a tree.
- * Ordering can be affected by changing the {@link RevSort} used to order the
- * commits that are returned first.
+ * Ordering can be affected by changing the
+ * {@link org.eclipse.jgit.revwalk.RevSort} used to order the commits that are
+ * returned first.
*/
public class ObjectWalk extends RevWalk {
private static final int ID_SZ = 20;
/**
* Mark an object or commit to start graph traversal from.
* <p>
- * Callers are encouraged to use {@link RevWalk#parseAny(AnyObjectId)}
- * instead of {@link RevWalk#lookupAny(AnyObjectId, int)}, as this method
- * requires the object to be parsed before it can be added as a root for the
- * traversal.
+ * Callers are encouraged to use
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseAny(AnyObjectId)} instead of
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}, as
+ * this method requires the object to be parsed before it can be added as a
+ * root for the traversal.
* <p>
* The method will automatically parse an unparsed object, but error
* handling may be more difficult for the application to explain why a
* RevObject is not actually valid. The object pool of this walker would
* also be 'poisoned' by the invalid RevObject.
* <p>
- * This method will automatically call {@link RevWalk#markStart(RevCommit)}
- * if passed RevCommit instance, or a RevTag that directly (or indirectly)
- * references a RevCommit.
+ * This method will automatically call
+ * {@link org.eclipse.jgit.revwalk.RevWalk#markStart(RevCommit)} if passed
+ * RevCommit instance, or a RevTag that directly (or indirectly) references
+ * a RevCommit.
*
* @param o
* the object to start traversing from. The object passed must be
* from this same revision walker.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the object supplied is not available from the object
* database. This usually indicates the supplied object is
* invalid, but the reference was constructed during an earlier
- * invocation to {@link RevWalk#lookupAny(AnyObjectId, int)}.
- * @throws IncorrectObjectTypeException
+ * invocation to
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}.
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually the type of the instance
* passed in. This usually indicates the caller used the wrong
- * type in a {@link RevWalk#lookupAny(AnyObjectId, int)} call.
- * @throws IOException
+ * type in a
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}
+ * call.
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void markStart(RevObject o) throws MissingObjectException,
* reachable chain, back until the merge base of an uninteresting commit and
* an otherwise interesting commit.
* <p>
- * Callers are encouraged to use {@link RevWalk#parseAny(AnyObjectId)}
- * instead of {@link RevWalk#lookupAny(AnyObjectId, int)}, as this method
- * requires the object to be parsed before it can be added as a root for the
- * traversal.
+ * Callers are encouraged to use
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseAny(AnyObjectId)} instead of
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}, as
+ * this method requires the object to be parsed before it can be added as a
+ * root for the traversal.
* <p>
* The method will automatically parse an unparsed object, but error
* handling may be more difficult for the application to explain why a
* RevObject is not actually valid. The object pool of this walker would
* also be 'poisoned' by the invalid RevObject.
* <p>
- * This method will automatically call {@link RevWalk#markStart(RevCommit)}
- * if passed RevCommit instance, or a RevTag that directly (or indirectly)
- * references a RevCommit.
+ * This method will automatically call
+ * {@link org.eclipse.jgit.revwalk.RevWalk#markStart(RevCommit)} if passed
+ * RevCommit instance, or a RevTag that directly (or indirectly) references
+ * a RevCommit.
*
* @param o
* the object to start traversing from. The object passed must be
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the object supplied is not available from the object
* database. This usually indicates the supplied object is
* invalid, but the reference was constructed during an earlier
- * invocation to {@link RevWalk#lookupAny(AnyObjectId, int)}.
- * @throws IncorrectObjectTypeException
+ * invocation to
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}.
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually the type of the instance
* passed in. This usually indicates the caller used the wrong
- * type in a {@link RevWalk#lookupAny(AnyObjectId, int)} call.
- * @throws IOException
+ * type in a
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}
+ * call.
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void markUninteresting(RevObject o) throws MissingObjectException,
addObject(o);
}
+ /** {@inheritDoc} */
@Override
public void sort(RevSort s) {
super.sort(s);
boundary = hasRevSort(RevSort.BOUNDARY);
}
+ /** {@inheritDoc} */
@Override
public void sort(RevSort s, boolean use) {
super.sort(s, use);
* Get the currently configured object filter.
*
* @return the current filter. Never null as a filter is always needed.
- *
* @since 4.0
*/
public ObjectFilter getObjectFilter() {
}
/**
- * Set the object filter for this walker. This filter affects the objects
- * visited by {@link #nextObject()}. It does not affect the commits
- * listed by {@link #next()}.
+ * Set the object filter for this walker. This filter affects the objects
+ * visited by {@link #nextObject()}. It does not affect the commits listed
+ * by {@link #next()}.
* <p>
* If the filter returns false for an object, then that object is skipped
* and objects reachable from it are not enqueued to be walked recursively.
* are known to be uninteresting.
*
* @param newFilter
- * the new filter. If null the special {@link ObjectFilter#ALL}
+ * the new filter. If null the special
+ * {@link org.eclipse.jgit.revwalk.filter.ObjectFilter#ALL}
* filter will be used instead, as it matches every object.
- *
* @since 4.0
*/
public void setObjectFilter(ObjectFilter newFilter) {
objectFilter = newFilter != null ? newFilter : ObjectFilter.ALL;
}
+ /** {@inheritDoc} */
@Override
public RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
* Pop the next most recent object.
*
* @return next most recent object; null if traversal is over.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* one or or more of the next objects are not available from the
* object database, but were thought to be candidates for
* traversal. This usually indicates a broken link.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* one or or more of the objects in a tree do not match the type
* indicated.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevObject nextObject() throws MissingObjectException,
* exception if there is a connectivity problem. The exception message
* provides some detail about the connectivity failure.
*
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* one or or more of the next objects are not available from the
* object database, but were thought to be candidates for
* traversal. This usually indicates a broken link.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* one or or more of the objects in a tree do not match the type
* indicated.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void checkConnectivity() throws MissingObjectException,
return hash;
}
- /** @return the internal buffer holding the current path. */
+ /**
+ * Get the internal buffer holding the current path.
+ *
+ * @return the internal buffer holding the current path.
+ */
public byte[] getPathBuffer() {
if (pathLen == 0)
pathLen = updatePathBuf(currVisit);
return pathBuf;
}
- /** @return length of the path in {@link #getPathBuffer()}. */
+ /**
+ * Get length of the path in {@link #getPathBuffer()}.
+ *
+ * @return length of the path in {@link #getPathBuffer()}.
+ */
public int getPathLength() {
if (pathLen == 0)
pathLen = updatePathBuf(currVisit);
pathBuf = newBuf;
}
+ /** {@inheritDoc} */
@Override
public void dispose() {
super.dispose();
freeVisit = null;
}
+ /** {@inheritDoc} */
@Override
protected void reset(final int retainFlags) {
super.reset(retainFlags);
/**
* An instance of this class can be used in conjunction with a
- * {@link FollowFilter}. Whenever a rename has been detected during a revision
- * walk, it will be reported here.
+ * {@link org.eclipse.jgit.revwalk.FollowFilter}. Whenever a rename has been
+ * detected during a revision walk, it will be reported here.
+ *
* @see FollowFilter#setRenameCallback(RenameCallback)
*/
public abstract class RenameCallback {
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
-/** A binary file, or a symbolic link. */
+/**
+ * A binary file, or a symbolic link.
+ */
public class RevBlob extends RevObject {
/**
* Create a new blob reference.
super(id);
}
+ /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_BLOB;
import org.eclipse.jgit.util.RawParseUtils;
import org.eclipse.jgit.util.StringUtils;
-/** A commit reference to a commit in the DAG. */
+/**
+ * A commit reference to a commit in the DAG.
+ */
public class RevCommit extends RevObject {
private static final int STACK_DEPTH = 500;
* will not have their headers loaded.
*
* Applications are discouraged from using this API. Callers usually need
- * more than one commit. Use {@link RevWalk#parseCommit(AnyObjectId)} to
+ * more than one commit. Use
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseCommit(AnyObjectId)} to
* obtain a RevCommit from an existing repository.
*
* @param raw
* modified by the caller.
* @return the parsed commit, in an isolated revision pool that is not
* available to the caller.
- * @throws IOException
+ * @throws java.io.IOException
* in case of RevWalk initialization fails
*/
public static RevCommit parse(RevWalk rw, byte[] raw) throws IOException {
flags |= PARSED;
}
+ /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_COMMIT;
/**
* Time from the "committer " line of the buffer.
*
- * @return time, expressed as seconds since the epoch.
+ * @return commit time
*/
public final int getCommitTime() {
return commitTime;
* parent index to obtain. Must be in the range 0 through
* {@link #getParentCount()}-1.
* @return the specified parent.
- * @throws ArrayIndexOutOfBoundsException
+ * @throws java.lang.ArrayIndexOutOfBoundsException
* an invalid parent index was specified.
*/
public final RevCommit getParent(final int nth) {
* should cache the return value for as long as necessary to use all
* information from it.
* <p>
- * RevFilter implementations should try to use {@link RawParseUtils} to scan
- * the {@link #getRawBuffer()} instead, as this will allow faster evaluation
- * of commits.
+ * RevFilter implementations should try to use
+ * {@link org.eclipse.jgit.util.RawParseUtils} to scan the
+ * {@link #getRawBuffer()} instead, as this will allow faster evaluation of
+ * commits.
*
* @return identity of the author (name, email) and the time the commit was
* made by the author; null if no author line was found.
* should cache the return value for as long as necessary to use all
* information from it.
* <p>
- * RevFilter implementations should try to use {@link RawParseUtils} to scan
- * the {@link #getRawBuffer()} instead, as this will allow faster evaluation
- * of commits.
+ * RevFilter implementations should try to use
+ * {@link org.eclipse.jgit.util.RawParseUtils} to scan the
+ * {@link #getRawBuffer()} instead, as this will allow faster evaluation of
+ * commits.
*
* @return identity of the committer (name, email) and the time the commit
* was made by the committer; null if no committer line was found.
* time in {@link #getCommitTime()}. Accessing other properties such as
* {@link #getAuthorIdent()}, {@link #getCommitterIdent()} or either message
* function requires reloading the buffer by invoking
- * {@link RevWalk#parseBody(RevObject)}.
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseBody(RevObject)}.
*
* @since 4.0
*/
buffer = null;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
import org.eclipse.jgit.revwalk.filter.RevFilter;
/**
- * An ordered list of {@link RevCommit} subclasses.
+ * An ordered list of {@link org.eclipse.jgit.revwalk.RevCommit} subclasses.
*
* @param <E>
* type of subclass of RevCommit the list is storing.
public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
private RevWalk walker;
+ /** {@inheritDoc} */
@Override
public void clear() {
super.clear();
* @param flag
* the flag to apply (or remove). Applications are responsible
* for allocating this flag from the source RevWalk.
- * @throws IOException
+ * @throws java.io.IOException
* revision filter needed to read additional objects, but an
* error occurred while reading the pack files or loose objects
* of the repository.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* revision filter needed to read additional objects, but an
* object was not of the correct type. Repository corruption may
* have occurred.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* revision filter needed to read additional objects, but an
* object that should be present was not found. Repository
* corruption may have occurred.
* last commit within the list to end testing at, exclusive. If
* smaller than or equal to <code>rangeBegin</code> then no
* commits will be tested.
- * @throws IOException
+ * @throws java.io.IOException
* revision filter needed to read additional objects, but an
* error occurred while reading the pack files or loose objects
* of the repository.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* revision filter needed to read additional objects, but an
* object was not of the correct type. Repository corruption may
* have occurred.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* revision filter needed to read additional objects, but an
* object that should be present was not found. Repository
* corruption may have occurred.
* @param highMark
* number of commits the caller wants this list to contain when
* the fill operation is complete.
- * @throws IOException
- * see {@link RevWalk#next()}
- * @throws IncorrectObjectTypeException
- * see {@link RevWalk#next()}
- * @throws MissingObjectException
- * see {@link RevWalk#next()}
+ * @throws java.io.IOException
+ * see {@link org.eclipse.jgit.revwalk.RevWalk#next()}
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * see {@link org.eclipse.jgit.revwalk.RevWalk#next()}
+ * @throws org.eclipse.jgit.errors.MissingObjectException
+ * see {@link org.eclipse.jgit.revwalk.RevWalk#next()}
*/
@SuppressWarnings("unchecked")
public void fillTo(final int highMark) throws MissingObjectException,
* contain when the fill operation is complete. If highMark is 0
* the walk is pumped until the specified commit or the end of
* the walk is reached.
- * @throws IOException
- * see {@link RevWalk#next()}
- * @throws IncorrectObjectTypeException
- * see {@link RevWalk#next()}
- * @throws MissingObjectException
- * see {@link RevWalk#next()}
+ * @throws java.io.IOException
+ * see {@link org.eclipse.jgit.revwalk.RevWalk#next()}
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * see {@link org.eclipse.jgit.revwalk.RevWalk#next()}
+ * @throws org.eclipse.jgit.errors.MissingObjectException
+ * see {@link org.eclipse.jgit.revwalk.RevWalk#next()}
*/
@SuppressWarnings("unchecked")
public void fillTo(final RevCommit commitToLoad, int highMark)
import org.eclipse.jgit.internal.JGitText;
/**
- * Application level mark bit for {@link RevObject}s.
+ * Application level mark bit for {@link org.eclipse.jgit.revwalk.RevObject}s.
* <p>
- * To create a flag use {@link RevWalk#newFlag(String)}.
+ * To create a flag use
+ * {@link org.eclipse.jgit.revwalk.RevWalk#newFlag(String)}.
*/
public class RevFlag {
/**
return walker;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
return name;
import java.util.List;
/**
- * Multiple application level mark bits for {@link RevObject}s.
+ * Multiple application level mark bits for
+ * {@link org.eclipse.jgit.revwalk.RevObject}s.
*
* @see RevFlag
*/
private final List<RevFlag> active;
- /** Create an empty set of flags. */
+ /**
+ * Create an empty set of flags.
+ */
public RevFlagSet() {
active = new ArrayList<>();
}
addAll(s);
}
+ /** {@inheritDoc} */
@Override
public boolean contains(final Object o) {
if (o instanceof RevFlag)
return false;
}
+ /** {@inheritDoc} */
@Override
public boolean containsAll(final Collection<?> c) {
if (c instanceof RevFlagSet) {
return super.containsAll(c);
}
+ /** {@inheritDoc} */
@Override
public boolean add(final RevFlag flag) {
if ((mask & flag.mask) != 0)
return true;
}
+ /** {@inheritDoc} */
@Override
public boolean remove(final Object o) {
final RevFlag flag = (RevFlag) o;
return true;
}
+ /** {@inheritDoc} */
@Override
public Iterator<RevFlag> iterator() {
final Iterator<RevFlag> i = active.iterator();
};
}
+ /** {@inheritDoc} */
@Override
public int size() {
return active.size();
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdOwnerMap;
-/** Base object type accessed during revision walking. */
+/**
+ * Base object type accessed during revision walking.
+ */
public abstract class RevObject extends ObjectIdOwnerMap.Entry {
static final int PARSED = 1;
IncorrectObjectTypeException, IOException;
/**
- * Get Git object type. See {@link Constants}.
+ * Get Git object type. See {@link org.eclipse.jgit.lib.Constants}.
*
* @return object type
*/
flags &= ~set.mask;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder s = new StringBuilder();
}
/**
+ * Append a debug description of core RevFlags to a buffer.
+ *
* @param s
* buffer to append a debug description of core RevFlags onto.
*/
import org.eclipse.jgit.internal.JGitText;
/**
- * An ordered list of {@link RevObject} subclasses.
+ * An ordered list of {@link org.eclipse.jgit.revwalk.RevObject} subclasses.
*
* @param <E>
* type of subclass of RevObject the list is storing.
/** Current number of elements in the list. */
protected int size = 0;
- /** Create an empty object list. */
+ /**
+ * Create an empty object list.
+ */
public RevObjectList() {
// Initialized above.
}
+ /** {@inheritDoc} */
@Override
public void add(final int index, final E element) {
if (index != size)
size++;
}
+ /** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public E set(int index, E element) {
return (E) old;
}
+ /** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public E get(int index) {
return s != null ? (E) s.contents[index] : null;
}
+ /** {@inheritDoc} */
@Override
public int size() {
return size;
}
+ /** {@inheritDoc} */
@Override
public void clear() {
contents = new Block(0);
package org.eclipse.jgit.revwalk;
-/** Sorting strategies supported by {@link RevWalk} and {@link ObjectWalk}. */
+/**
+ * Sorting strategies supported by {@link org.eclipse.jgit.revwalk.RevWalk} and
+ * {@link org.eclipse.jgit.revwalk.ObjectWalk}.
+ */
public enum RevSort {
/**
* No specific sorting is requested.
import org.eclipse.jgit.util.RawParseUtils;
import org.eclipse.jgit.util.StringUtils;
-/** An annotated tag. */
+/**
+ * An annotated tag.
+ */
public class RevTag extends RevObject {
/**
* Parse an annotated tag from its canonical format.
* not have its headers loaded.
*
* Applications are discouraged from using this API. Callers usually need
- * more than one object. Use {@link RevWalk#parseTag(AnyObjectId)} to obtain
+ * more than one object. Use
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseTag(AnyObjectId)} to obtain
* a RevTag from an existing repository.
*
* @param raw
* the canonical formatted tag to be parsed.
* @return the parsed tag, in an isolated revision pool that is not
* available to the caller.
- * @throws CorruptObjectException
+ * @throws org.eclipse.jgit.errors.CorruptObjectException
* the tag contains a malformed header that cannot be handled.
*/
public static RevTag parse(byte[] raw) throws CorruptObjectException {
* modified by the caller.
* @return the parsed tag, in an isolated revision pool that is not
* available to the caller.
- * @throws CorruptObjectException
+ * @throws org.eclipse.jgit.errors.CorruptObjectException
* the tag contains a malformed header that cannot be handled.
*/
public static RevTag parse(RevWalk rw, byte[] raw)
flags |= PARSED;
}
+ /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_TAG;
* Get a reference to the object this tag was placed on.
* <p>
* Note that the returned object has only been looked up (see
- * {@link RevWalk#lookupAny(AnyObjectId, int)}. To access the contents it
- * needs to be parsed, see {@link RevWalk#parseHeaders(RevObject)} and
- * {@link RevWalk#parseBody(RevObject)}.
+ * {@link org.eclipse.jgit.revwalk.RevWalk#lookupAny(AnyObjectId, int)}. To
+ * access the contents it needs to be parsed, see
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseHeaders(RevObject)} and
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseBody(RevObject)}.
* <p>
- * As an alternative, use {@link RevWalk#peel(RevObject)} and pass this
- * {@link RevTag} to peel it until the first non-tag object.
+ * As an alternative, use
+ * {@link org.eclipse.jgit.revwalk.RevWalk#peel(RevObject)} and pass this
+ * {@link org.eclipse.jgit.revwalk.RevTag} to peel it until the first
+ * non-tag object.
*
* @return object this tag refers to (only looked up, not parsed)
*/
* only the {@link #getObject()} pointer and {@link #getTagName()}.
* Accessing other properties such as {@link #getTaggerIdent()} or either
* message function requires reloading the buffer by invoking
- * {@link RevWalk#parseBody(RevObject)}.
+ * {@link org.eclipse.jgit.revwalk.RevWalk#parseBody(RevObject)}.
*
* @since 4.0
*/
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
-/** A reference to a tree of subtrees/files. */
+/**
+ * A reference to a tree of subtrees/files.
+ */
public class RevTree extends RevObject {
/**
* Create a new tree reference.
super(id);
}
+ /** {@inheritDoc} */
@Override
public final int getType() {
return Constants.OBJ_TREE;
* usage of a RevWalk instance to a single thread, or implement their own
* synchronization at a higher level.
* <p>
- * Multiple simultaneous RevWalk instances per {@link Repository} are permitted,
- * even from concurrent threads. Equality of {@link RevCommit}s from two
- * different RevWalk instances is never true, even if their {@link ObjectId}s
- * are equal (and thus they describe the same commit).
+ * Multiple simultaneous RevWalk instances per
+ * {@link org.eclipse.jgit.lib.Repository} are permitted, even from concurrent
+ * threads. Equality of {@link org.eclipse.jgit.revwalk.RevCommit}s from two
+ * different RevWalk instances is never true, even if their
+ * {@link org.eclipse.jgit.lib.ObjectId}s are equal (and thus they describe the
+ * same commit).
* <p>
* The offered iterator is over the list of RevCommits described by the
* configuration of this instance. Applications should restrict themselves to
this.closeReader = closeReader;
}
- /** @return the reader this walker is using to load objects. */
+ /**
+ * Get the reader this walker is using to load objects.
+ *
+ * @return the reader this walker is using to load objects.
+ */
public ObjectReader getObjectReader() {
return reader;
}
/**
+ * {@inheritDoc}
+ * <p>
* Release any resources used by this walker's reader.
* <p>
* A walker that has been released can be used again, but may need to be
* @param c
* the commit to start traversing from. The commit passed must be
* from this same revision walker.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the commit supplied is not available from the object
* database. This usually indicates the supplied commit is
* invalid, but the reference was constructed during an earlier
* invocation to {@link #lookupCommit(AnyObjectId)}.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually a commit. This usually
* indicates the caller supplied a non-commit SHA-1 to
* {@link #lookupCommit(AnyObjectId)}.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void markStart(final RevCommit c) throws MissingObjectException,
* @param list
* commits to start traversing from. The commits passed must be
* from this same revision walker.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* one of the commits supplied is not available from the object
* database. This usually indicates the supplied commit is
* invalid, but the reference was constructed during an earlier
* invocation to {@link #lookupCommit(AnyObjectId)}.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually a commit. This usually
* indicates the caller supplied a non-commit SHA-1 to
* {@link #lookupCommit(AnyObjectId)}.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void markStart(final Collection<RevCommit> list)
* @param c
* the commit to start traversing from. The commit passed must be
* from this same revision walker.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the commit supplied is not available from the object
* database. This usually indicates the supplied commit is
* invalid, but the reference was constructed during an earlier
* invocation to {@link #lookupCommit(AnyObjectId)}.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually a commit. This usually
* indicates the caller supplied a non-commit SHA-1 to
* {@link #lookupCommit(AnyObjectId)}.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void markUninteresting(final RevCommit c)
* @return true if there is a path directly from <code>tip</code> to
* <code>base</code> (and thus <code>base</code> is fully merged
* into <code>tip</code>); false otherwise.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* one or or more of the next commit's parents are not available
* from the object database, but were thought to be candidates
* for traversal. This usually indicates a broken link.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* one or or more of the next commit's parents are not actually
* commit objects.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public boolean isMergedInto(final RevCommit base, final RevCommit tip)
* Pop the next most recent commit.
*
* @return next most recent commit; null if traversal is over.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* one or or more of the next commit's parents are not available
* from the object database, but were thought to be candidates
* for traversal. This usually indicates a broken link.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* one or or more of the next commit's parents are not actually
* commit objects.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevCommit next() throws MissingObjectException,
* Obtain the sort types applied to the commits returned.
*
* @return the sorting strategies employed. At least one strategy is always
- * used, but that strategy may be {@link RevSort#NONE}.
+ * used, but that strategy may be
+ * {@link org.eclipse.jgit.revwalk.RevSort#NONE}.
*/
public EnumSet<RevSort> getRevSort() {
return sorting.clone();
* Add or remove a sorting strategy for the returned commits.
* <p>
* Multiple strategies can be applied at once, in which case some strategies
- * may take precedence over others. As an example, {@link RevSort#TOPO} must
- * take precedence over {@link RevSort#COMMIT_TIME_DESC}, otherwise it
+ * may take precedence over others. As an example,
+ * {@link org.eclipse.jgit.revwalk.RevSort#TOPO} must take precedence over
+ * {@link org.eclipse.jgit.revwalk.RevSort#COMMIT_TIME_DESC}, otherwise it
* cannot enforce its ordering.
*
* @param s
* Note that filters are not thread-safe and may not be shared by concurrent
* RevWalk instances. Every RevWalk must be supplied its own unique filter,
* unless the filter implementation specifically states it is (and always
- * will be) thread-safe. Callers may use {@link RevFilter#clone()} to create
- * a unique filter tree for this RevWalk instance.
+ * will be) thread-safe. Callers may use
+ * {@link org.eclipse.jgit.revwalk.filter.RevFilter#clone()} to create a
+ * unique filter tree for this RevWalk instance.
*
* @param newFilter
- * the new filter. If null the special {@link RevFilter#ALL}
- * filter will be used instead, as it matches every commit.
+ * the new filter. If null the special
+ * {@link org.eclipse.jgit.revwalk.filter.RevFilter#ALL} filter
+ * will be used instead, as it matches every commit.
* @see org.eclipse.jgit.revwalk.filter.AndRevFilter
* @see org.eclipse.jgit.revwalk.filter.OrRevFilter
*/
* Get the tree filter used to simplify commits by modified paths.
*
* @return the current filter. Never null as a filter is always needed. If
- * no filter is being applied {@link TreeFilter#ALL} is returned.
+ * no filter is being applied
+ * {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} is
+ * returned.
*/
public TreeFilter getTreeFilter() {
return treeFilter;
/**
* Set the tree filter used to simplify commits by modified paths.
* <p>
- * If null or {@link TreeFilter#ALL} the path limiter is removed. Commits
- * will not be simplified.
+ * If null or {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} the
+ * path limiter is removed. Commits will not be simplified.
* <p>
- * If non-null and not {@link TreeFilter#ALL} then the tree filter will be
- * installed. Commits will have their ancestry simplified to hide commits that
- * do not contain tree entries matched by the filter, unless
- * {@code setRewriteParents(false)} is called.
+ * If non-null and not
+ * {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} then the tree
+ * filter will be installed. Commits will have their ancestry simplified to
+ * hide commits that do not contain tree entries matched by the filter,
+ * unless {@code setRewriteParents(false)} is called.
* <p>
* Usually callers should be inserting a filter graph including
- * {@link TreeFilter#ANY_DIFF} along with one or more
- * {@link org.eclipse.jgit.treewalk.filter.PathFilter} instances.
+ * {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ANY_DIFF} along with
+ * one or more {@link org.eclipse.jgit.treewalk.filter.PathFilter}
+ * instances.
*
* @param newFilter
- * new filter. If null the special {@link TreeFilter#ALL} filter
+ * new filter. If null the special
+ * {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} filter
* will be used instead, as it matches everything.
* @see org.eclipse.jgit.treewalk.filter.PathFilter
*/
* Set whether to rewrite parent pointers when filtering by modified paths.
* <p>
* By default, when {@link #setTreeFilter(TreeFilter)} is called with non-
- * null and non-{@link TreeFilter#ALL} filter, commits will have their
- * ancestry simplified and parents rewritten to hide commits that do not match
- * the filter.
+ * null and non-{@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL}
+ * filter, commits will have their ancestry simplified and parents rewritten
+ * to hide commits that do not match the filter.
* <p>
* This behavior can be bypassed by passing false to this method.
*
* care and would prefer to discard the body of a commit as early as
* possible, to reduce memory usage.
* <p>
- * True by default on {@link RevWalk} and false by default for
- * {@link ObjectWalk}.
+ * True by default on {@link org.eclipse.jgit.revwalk.RevWalk} and false by
+ * default for {@link org.eclipse.jgit.revwalk.ObjectWalk}.
*
* @return true if the body should be retained; false it is discarded.
*/
/**
* Set whether or not the body of a commit or tag is retained.
* <p>
- * If a body of a commit or tag is not retained, the application must
- * call {@link #parseBody(RevObject)} before the body can be safely
- * accessed through the type specific access methods.
+ * If a body of a commit or tag is not retained, the application must call
+ * {@link #parseBody(RevObject)} before the body can be safely accessed
+ * through the type specific access methods.
* <p>
- * True by default on {@link RevWalk} and false by default for
- * {@link ObjectWalk}.
+ * True by default on {@link org.eclipse.jgit.revwalk.RevWalk} and false by
+ * default for {@link org.eclipse.jgit.revwalk.ObjectWalk}.
*
- * @param retain true to retain bodies; false to discard them early.
+ * @param retain
+ * true to retain bodies; false to discard them early.
*/
public void setRetainBody(final boolean retain) {
retainBody = retain;
* @param id
* name of the commit object.
* @return reference to the commit object. Never null.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the supplied commit does not exist.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the supplied id is not a commit or an annotated tag.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevCommit parseCommit(final AnyObjectId id)
* name of the tree object, or a commit or annotated tag that may
* reference a tree.
* @return reference to the tree object. Never null.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the supplied tree does not exist.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the supplied id is not a tree, a commit or an annotated tag.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevTree parseTree(final AnyObjectId id)
* @param id
* name of the tag object.
* @return reference to the tag object. Never null.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the supplied tag does not exist.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the supplied id is not a tag or an annotated tag.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevTag parseTag(final AnyObjectId id) throws MissingObjectException,
* @param id
* name of the object.
* @return reference to the object. Never null.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the supplied does not exist.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevObject parseAny(final AnyObjectId id)
/**
* Asynchronous object parsing.
*
- * @param <T>
- * any ObjectId type.
* @param objectIds
* objects to open from the object store. The supplied collection
* must not be modified until the queue has finished.
*
* @param obj
* the object the caller needs to be parsed.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the supplied does not exist.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void parseHeaders(final RevObject obj)
*
* @param obj
* the object the caller needs to be parsed.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* the supplied does not exist.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public void parseBody(final RevObject obj)
* @return If {@code obj} is not an annotated tag, {@code obj}. Otherwise
* the first non-tag object that {@code obj} references. The
* returned object's headers have been parsed.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* a referenced object cannot be found.
- * @throws IOException
+ * @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public RevObject peel(RevObject obj) throws MissingObjectException,
* @param name
* description of the flag, primarily useful for debugging.
* @return newly constructed flag instance.
- * @throws IllegalArgumentException
+ * @throws java.lang.IllegalArgumentException
* too many flags have been reserved on this revision walker.
*/
public RevFlag newFlag(final String name) {
}
/**
+ * {@inheritDoc}
+ * <p>
* Returns an Iterator over the commits of this walker.
* <p>
* The returned iterator is only useful for one walk. If this RevWalk gets
* Applications must not use both the Iterator and the {@link #next()} API
* at the same time. Pick one API and use that for the entire walk.
* <p>
- * If a checked exception is thrown during the walk (see {@link #next()})
- * it is rethrown from the Iterator as a {@link RevWalkException}.
+ * If a checked exception is thrown during the walk (see {@link #next()}) it
+ * is rethrown from the Iterator as a {@link RevWalkException}.
*
- * @return an iterator over this walker's commits.
* @see RevWalkException
*/
@Override
};
}
- /** Throws an exception if we have started producing output. */
+ /**
+ * Throws an exception if we have started producing output.
+ */
protected void assertNotStarted() {
if (isNotStarted())
return;
}
/**
- * Create and return an {@link ObjectWalk} using the same objects.
+ * Create and return an {@link org.eclipse.jgit.revwalk.ObjectWalk} using
+ * the same objects.
* <p>
* Prior to using this method, the caller must reset this RevWalk to clean
* any flags that were used during the last traversal.
import org.eclipse.jgit.lib.Ref;
/**
- * Utility methods for {@link RevWalk}.
+ * Utility methods for {@link org.eclipse.jgit.revwalk.RevWalk}.
*/
public final class RevWalkUtils {
* other words, count the number of commits that are in <code>start</code>,
* but not in <code>end</code>.
* <p>
- * Note that this method calls {@link RevWalk#reset()} at the beginning.
- * Also note that the existing rev filter on the walk is left as-is, so be
- * sure to set the right rev filter before calling this method.
+ * Note that this method calls
+ * {@link org.eclipse.jgit.revwalk.RevWalk#reset()} at the beginning. Also
+ * note that the existing rev filter on the walk is left as-is, so be sure
+ * to set the right rev filter before calling this method.
*
* @param walk
* the rev walk to use
* @param end
* the commit where counting should end, or null if counting
* should be done until there are no more commits
- *
* @return the number of commits
- * @throws MissingObjectException
- * @throws IncorrectObjectTypeException
- * @throws IOException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * @throws java.io.IOException
*/
public static int count(final RevWalk walk, final RevCommit start,
final RevCommit end) throws MissingObjectException,
* Find of commits that are in <code>start</code>, but not in
* <code>end</code>.
* <p>
- * Note that this method calls {@link RevWalk#reset()} at the beginning.
- * Also note that the existing rev filter on the walk is left as-is, so be
- * sure to set the right rev filter before calling this method.
+ * Note that this method calls
+ * {@link org.eclipse.jgit.revwalk.RevWalk#reset()} at the beginning. Also
+ * note that the existing rev filter on the walk is left as-is, so be sure
+ * to set the right rev filter before calling this method.
*
* @param walk
* the rev walk to use
* the commit where counting should end, or null if counting
* should be done until there are no more commits
* @return the commits found
- * @throws MissingObjectException
- * @throws IncorrectObjectTypeException
- * @throws IOException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * @throws java.io.IOException
*/
public static List<RevCommit> find(final RevWalk walk,
final RevCommit start, final RevCommit end)
* Find the list of branches a given commit is reachable from when following
* parent.s
* <p>
- * Note that this method calls {@link RevWalk#reset()} at the beginning.
+ * Note that this method calls
+ * {@link org.eclipse.jgit.revwalk.RevWalk#reset()} at the beginning.
* <p>
* In order to improve performance this method assumes clock skew among
* committers is never larger than 24 hours.
* @param refs
* the set of branches we want to see reachability from
* @return the list of branches a given commit is reachable from
- * @throws MissingObjectException
- * @throws IncorrectObjectTypeException
- * @throws IOException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
+ * @throws java.io.IOException
*/
public static List<Ref> findBranchesReachableFrom(RevCommit commit,
RevWalk revWalk, Collection<Ref> refs)
import org.eclipse.jgit.treewalk.filter.TreeFilter;
/**
- * Filter applying a {@link TreeFilter} against changed paths in each commit.
+ * Filter applying a {@link org.eclipse.jgit.treewalk.filter.TreeFilter} against
+ * changed paths in each commit.
* <p>
* Each commit is differenced concurrently against all of its parents to look
- * for tree entries that are interesting to the {@link TreeFilter}.
+ * for tree entries that are interesting to the
+ * {@link org.eclipse.jgit.treewalk.filter.TreeFilter}.
*
* @since 3.5
*/
private final TreeWalk pathFilter;
/**
- * Create a {@link RevFilter} from a {@link TreeFilter}.
+ * Create a {@link org.eclipse.jgit.revwalk.filter.RevFilter} from a
+ * {@link org.eclipse.jgit.treewalk.filter.TreeFilter}.
*
* @param walker
* walker used for reading trees.
* @param t
- * filter to compare against any changed paths in each commit. If a
- * {@link FollowFilter}, will be replaced with a new filter
- * following new paths after a rename.
+ * filter to compare against any changed paths in each commit. If
+ * a {@link org.eclipse.jgit.revwalk.FollowFilter}, will be
+ * replaced with a new filter following new paths after a rename.
* @since 3.5
*/
public TreeRevFilter(final RevWalk walker, final TreeFilter t) {
this.rewriteFlag = rewriteFlag;
}
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
throw new UnsupportedOperationException();
}
+ /** {@inheritDoc} */
@Override
public boolean include(final RevWalk walker, final RevCommit c)
throws StopWalkException, MissingObjectException,
return false;
}
+ /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return false;
* Includes a commit only if all subfilters include the same commit.
* <p>
* Classic shortcut behavior is used, so evaluation of the
- * {@link RevFilter#include(RevWalk, RevCommit)} method stops as soon as a false
- * result is obtained. Applications can improve filtering performance by placing
- * faster filters that are more likely to reject a result earlier in the list.
+ * {@link org.eclipse.jgit.revwalk.filter.RevFilter#include(RevWalk, RevCommit)}
+ * method stops as soon as a false result is obtained. Applications can improve
+ * filtering performance by placing faster filters that are more likely to
+ * reject a result earlier in the list.
*/
public abstract class AndRevFilter extends RevFilter {
/**
import org.eclipse.jgit.util.RawCharSequence;
import org.eclipse.jgit.util.RawParseUtils;
-/** Matches only commits whose author name matches the pattern. */
+/**
+ * Matches only commits whose author name matches the pattern.
+ */
public class AuthorRevFilter {
/**
* Create a new author filter.
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
-/** Selects commits based upon the commit time field. */
+/**
+ * Selects commits based upon the commit time field.
+ */
public abstract class CommitTimeRevFilter extends RevFilter {
/**
* Create a new filter to select commits before a given date/time.
when = (int) (ts / 1000);
}
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
return this;
}
+ /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return false;
import org.eclipse.jgit.util.RawCharSequence;
import org.eclipse.jgit.util.RawParseUtils;
-/** Matches only commits whose committer name matches the pattern. */
+/**
+ * Matches only commits whose committer name matches the pattern.
+ */
public class CommitterRevFilter {
/**
* Create a new committer filter.
this.maxCount = maxCount;
}
+ /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
return true;
}
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
return new MaxCountRevFilter(maxCount);
import org.eclipse.jgit.util.RawCharSequence;
import org.eclipse.jgit.util.RawParseUtils;
-/** Matches only commits whose message matches the pattern. */
+/**
+ * Matches only commits whose message matches the pattern.
+ */
public class MessageRevFilter {
/**
* Create a message filter.
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
-/** Includes a commit only if the subfilter does not include the commit. */
+/**
+ * Includes a commit only if the subfilter does not include the commit.
+ */
public class NotRevFilter extends RevFilter {
/**
* Create a filter that negates the result of another filter.
a = one;
}
+ /** {@inheritDoc} */
@Override
public RevFilter negate() {
return a;
}
+ /** {@inheritDoc} */
@Override
public boolean include(final RevWalk walker, final RevCommit c)
throws MissingObjectException, IncorrectObjectTypeException,
return !a.include(walker, c);
}
+ /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return a.requiresCommitBody();
}
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
return new NotRevFilter(a.clone());
}
+ /** {@inheritDoc} */
@Override
public String toString() {
return "NOT " + a.toString(); //$NON-NLS-1$
* Selects interesting objects when walking.
* <p>
* Applications should install the filter on an ObjectWalk by
- * {@link ObjectWalk#setObjectFilter(ObjectFilter)} prior to starting traversal.
+ * {@link org.eclipse.jgit.revwalk.ObjectWalk#setObjectFilter(ObjectFilter)}
+ * prior to starting traversal.
*
* @since 4.0
*/
* @param objid
* the object currently being tested.
* @return {@code true} if the named object should be included in the walk.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* an object the filter needed to consult to determine its
* answer was missing
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* an object the filter needed to consult to determine its
* answer was of the wrong type
- * @throws IOException
+ * @throws java.io.IOException
* an object the filter needed to consult to determine its
* answer could not be read.
*/
* Includes a commit if any subfilters include the same commit.
* <p>
* Classic shortcut behavior is used, so evaluation of the
- * {@link RevFilter#include(RevWalk, RevCommit)} method stops as soon as a true
- * result is obtained. Applications can improve filtering performance by placing
- * faster filters that are more likely to accept a result earlier in the list.
+ * {@link org.eclipse.jgit.revwalk.filter.RevFilter#include(RevWalk, RevCommit)}
+ * method stops as soon as a true result is obtained. Applications can improve
+ * filtering performance by placing faster filters that are more likely to
+ * accept a result earlier in the list.
*/
public abstract class OrRevFilter extends RevFilter {
/**
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.util.RawCharSequence;
-/** Abstract filter that searches text using extended regular expressions. */
+/**
+ * Abstract filter that searches text using extended regular expressions.
+ */
public abstract class PatternMatchRevFilter extends RevFilter {
/**
* Encode a string pattern for faster matching on byte arrays.
* original pattern string supplied by the user or the
* application.
* @return same pattern, but re-encoded to match our funny raw UTF-8
- * character sequence {@link RawCharSequence}.
+ * character sequence {@link org.eclipse.jgit.util.RawCharSequence}.
*/
protected static final String forceToRaw(final String patternText) {
final byte[] b = Constants.encode(patternText);
* should {@link #forceToRaw(String)} be applied to the pattern
* before compiling it?
* @param flags
- * flags from {@link Pattern} to control how matching performs.
+ * flags from {@link java.util.regex.Pattern} to control how
+ * matching performs.
*/
protected PatternMatchRevFilter(String pattern, final boolean innerString,
final boolean rawEncoding, final int flags) {
return patternText;
}
+ /** {@inheritDoc} */
@Override
public boolean include(final RevWalk walker, final RevCommit cmit)
throws MissingObjectException, IncorrectObjectTypeException,
return compiledPattern.reset(text(cmit)).matches();
}
+ /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return true;
*/
protected abstract CharSequence text(RevCommit cmit);
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
* <code>OrRevFilter</code> to create complex boolean expressions.
* <p>
* Applications should install the filter on a RevWalk by
- * {@link RevWalk#setRevFilter(RevFilter)} prior to starting traversal.
+ * {@link org.eclipse.jgit.revwalk.RevWalk#setRevFilter(RevFilter)} prior to
+ * starting traversal.
* <p>
* Unless specifically noted otherwise a RevFilter implementation is not thread
* safe and may not be shared by different RevWalk instances at the same time.
* <p>
* <b>Message filters:</b>
* <ul>
- * <li>Author name/email: {@link AuthorRevFilter}</li>
- * <li>Committer name/email: {@link CommitterRevFilter}</li>
- * <li>Message body: {@link MessageRevFilter}</li>
+ * <li>Author name/email:
+ * {@link org.eclipse.jgit.revwalk.filter.AuthorRevFilter}</li>
+ * <li>Committer name/email:
+ * {@link org.eclipse.jgit.revwalk.filter.CommitterRevFilter}</li>
+ * <li>Message body:
+ * {@link org.eclipse.jgit.revwalk.filter.MessageRevFilter}</li>
* </ul>
*
* <p>
* <p>
* <b>Boolean modifiers:</b>
* <ul>
- * <li>AND: {@link AndRevFilter}</li>
- * <li>OR: {@link OrRevFilter}</li>
- * <li>NOT: {@link NotRevFilter}</li>
+ * <li>AND: {@link org.eclipse.jgit.revwalk.filter.AndRevFilter}</li>
+ * <li>OR: {@link org.eclipse.jgit.revwalk.filter.OrRevFilter}</li>
+ * <li>NOT: {@link org.eclipse.jgit.revwalk.filter.NotRevFilter}</li>
* </ul>
*/
public abstract class RevFilter {
return NotRevFilter.create(this);
}
- /** @return true if the filter needs the commit body to be parsed. */
+ /**
+ * Whether the filter needs the commit body to be parsed.
+ *
+ * @return true if the filter needs the commit body to be parsed.
+ */
public boolean requiresCommitBody() {
// Assume true to be backward compatible with prior behavior.
return true;
* returns true from {@link #requiresCommitBody()}.
* @return true to include this commit in the results; false to have this
* commit be omitted entirely from the results.
- * @throws StopWalkException
+ * @throws org.eclipse.jgit.errors.StopWalkException
* the filter knows for certain that no additional commits can
* ever match, and the current commit doesn't match either. The
* walk is halted and no more results are provided.
- * @throws MissingObjectException
+ * @throws org.eclipse.jgit.errors.MissingObjectException
* an object the filter needs to consult to determine its answer
* does not exist in the Git repository the walker is operating
* on. Filtering this commit is impossible without the object.
- * @throws IncorrectObjectTypeException
+ * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* an object the filter needed to consult was not of the
* expected object type. This usually indicates a corrupt
* repository, as an object link is referencing the wrong type.
- * @throws IOException
+ * @throws java.io.IOException
* a loose object or pack file could not be read to obtain data
* necessary for the filter to make its decision.
*/
IncorrectObjectTypeException, IOException;
/**
+ * {@inheritDoc}
+ * <p>
* Clone this revision filter, including its parameters.
* <p>
* This is a deep clone. If this filter embeds objects or other filters it
* must also clone those, to ensure the instances do not share mutable data.
- *
- * @return another copy of this filter, suitable for another thread.
*/
@Override
public abstract RevFilter clone();
+ /** {@inheritDoc} */
@Override
public String toString() {
String n = getClass().getName();
import org.eclipse.jgit.revwalk.RevFlagSet;
import org.eclipse.jgit.revwalk.RevWalk;
-/** Matches only commits with some/all RevFlags already set. */
+/**
+ * Matches only commits with some/all RevFlags already set.
+ */
public abstract class RevFlagFilter extends RevFilter {
/**
* Create a new filter that tests for a single flag.
flags = m;
}
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
return this;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
return super.toString() + flags;
this.skip = skip;
}
+ /** {@inheritDoc} */
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
return true;
}
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
return new SkipRevFilter(skip);
import org.eclipse.jgit.util.RawCharSequence;
import org.eclipse.jgit.util.RawSubStringPattern;
-/** Abstract filter that searches text using only substring search. */
+/**
+ * Abstract filter that searches text using only substring search.
+ */
public abstract class SubStringRevFilter extends RevFilter {
/**
* Can this string be safely handled by a substring filter?
* @param pattern
* the pattern text proposed by the user.
* @return true if a substring filter can perform this pattern match; false
- * if {@link PatternMatchRevFilter} must be used instead.
+ * if {@link org.eclipse.jgit.revwalk.filter.PatternMatchRevFilter}
+ * must be used instead.
*/
public static boolean safe(final String pattern) {
for (int i = 0; i < pattern.length(); i++) {
pattern = new RawSubStringPattern(patternText);
}
+ /** {@inheritDoc} */
@Override
public boolean include(final RevWalk walker, final RevCommit cmit)
throws MissingObjectException, IncorrectObjectTypeException,
return pattern.match(text(cmit)) >= 0;
}
+ /** {@inheritDoc} */
@Override
public boolean requiresCommitBody() {
return true;
*/
protected abstract RawCharSequence text(RevCommit cmit);
+ /** {@inheritDoc} */
@Override
public RevFilter clone() {
return this; // Typically we are actually thread-safe.
}
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {