Browse Source

Fix javadoc in org.eclipse.jgit blame package

Change-Id: I116dacc7f4ace341ec6ffae2ab96b53496d89f64
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago committed by David Pursehouse
parent
commit
4e27a16081
  1. 96
      org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java
  2. 31
      org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java
  3. 1
      org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java
  4. 1
      org.eclipse.jgit/src/org/eclipse/jgit/blame/Region.java
  5. 2
      org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java

96
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java

@ -88,8 +88,10 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter;
* <p> * <p>
* Applications that want more incremental update behavior may use either the * Applications that want more incremental update behavior may use either the
* raw {@link #next()} streaming approach supported by this class, or construct * raw {@link #next()} streaming approach supported by this class, or construct
* a {@link BlameResult} using {@link BlameResult#create(BlameGenerator)} and * a {@link org.eclipse.jgit.blame.BlameResult} using
* incrementally construct the result with {@link BlameResult#computeNext()}. * {@link org.eclipse.jgit.blame.BlameResult#create(BlameGenerator)} and
* incrementally construct the result with
* {@link org.eclipse.jgit.blame.BlameResult#computeNext()}.
* <p> * <p>
* This class is not thread-safe. * This class is not thread-safe.
* <p> * <p>
@ -186,12 +188,20 @@ public class BlameGenerator implements AutoCloseable {
treeWalk.setRecursive(true); treeWalk.setRecursive(true);
} }
/** @return repository being scanned for revision history. */ /**
* Get repository
*
* @return repository being scanned for revision history
*/
public Repository getRepository() { public Repository getRepository() {
return repository; return repository;
} }
/** @return path file path being processed. */ /**
* Get result path
*
* @return path file path being processed
*/
public String getResultPath() { public String getResultPath() {
return resultPath.getPath(); return resultPath.getPath();
} }
@ -200,6 +210,7 @@ public class BlameGenerator implements AutoCloseable {
* Difference algorithm to use when comparing revisions. * Difference algorithm to use when comparing revisions.
* *
* @param algorithm * @param algorithm
* a {@link org.eclipse.jgit.diff.DiffAlgorithm}
* @return {@code this} * @return {@code this}
*/ */
public BlameGenerator setDiffAlgorithm(DiffAlgorithm algorithm) { public BlameGenerator setDiffAlgorithm(DiffAlgorithm algorithm) {
@ -211,6 +222,7 @@ public class BlameGenerator implements AutoCloseable {
* Text comparator to use when comparing revisions. * Text comparator to use when comparing revisions.
* *
* @param comparator * @param comparator
* a {@link org.eclipse.jgit.diff.RawTextComparator}
* @return {@code this} * @return {@code this}
*/ */
public BlameGenerator setTextComparator(RawTextComparator comparator) { public BlameGenerator setTextComparator(RawTextComparator comparator) {
@ -255,15 +267,15 @@ public class BlameGenerator implements AutoCloseable {
* <p> * <p>
* Candidates should be pushed in history order from oldest-to-newest. * Candidates should be pushed in history order from oldest-to-newest.
* Applications should push the starting commit first, then the index * Applications should push the starting commit first, then the index
* revision (if the index is interesting), and finally the working tree * revision (if the index is interesting), and finally the working tree copy
* copy (if the working tree is interesting). * (if the working tree is interesting).
* *
* @param description * @param description
* description of the blob revision, such as "Working Tree". * description of the blob revision, such as "Working Tree".
* @param contents * @param contents
* contents of the file. * contents of the file.
* @return {@code this} * @return {@code this}
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public BlameGenerator push(String description, byte[] contents) public BlameGenerator push(String description, byte[] contents)
@ -284,7 +296,7 @@ public class BlameGenerator implements AutoCloseable {
* @param contents * @param contents
* contents of the file. * contents of the file.
* @return {@code this} * @return {@code this}
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public BlameGenerator push(String description, RawText contents) public BlameGenerator push(String description, RawText contents)
@ -312,7 +324,7 @@ public class BlameGenerator implements AutoCloseable {
* @param id * @param id
* may be a commit or a blob. * may be a commit or a blob.
* @return {@code this} * @return {@code this}
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public BlameGenerator push(String description, AnyObjectId id) public BlameGenerator push(String description, AnyObjectId id)
@ -357,8 +369,8 @@ public class BlameGenerator implements AutoCloseable {
* each of these is a descendant commit that removed the line, typically * each of these is a descendant commit that removed the line, typically
* this occurs when the same deletion appears in multiple side branches such * this occurs when the same deletion appears in multiple side branches such
* as due to a cherry-pick. Applications relying on reverse should use * as due to a cherry-pick. Applications relying on reverse should use
* {@link BlameResult} as it filters these duplicate sources and only * {@link org.eclipse.jgit.blame.BlameResult} as it filters these duplicate
* remembers the first (oldest) deletion. * sources and only remembers the first (oldest) deletion.
* *
* @param start * @param start
* oldest commit to traverse from. The result file will be loaded * oldest commit to traverse from. The result file will be loaded
@ -367,7 +379,7 @@ public class BlameGenerator implements AutoCloseable {
* most recent commit to stop traversal at. Usually an active * most recent commit to stop traversal at. Usually an active
* branch tip, tag, or HEAD. * branch tip, tag, or HEAD.
* @return {@code this} * @return {@code this}
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public BlameGenerator reverse(AnyObjectId start, AnyObjectId end) public BlameGenerator reverse(AnyObjectId start, AnyObjectId end)
@ -389,8 +401,8 @@ public class BlameGenerator implements AutoCloseable {
* each of these is a descendant commit that removed the line, typically * each of these is a descendant commit that removed the line, typically
* this occurs when the same deletion appears in multiple side branches such * this occurs when the same deletion appears in multiple side branches such
* as due to a cherry-pick. Applications relying on reverse should use * as due to a cherry-pick. Applications relying on reverse should use
* {@link BlameResult} as it filters these duplicate sources and only * {@link org.eclipse.jgit.blame.BlameResult} as it filters these duplicate
* remembers the first (oldest) deletion. * sources and only remembers the first (oldest) deletion.
* *
* @param start * @param start
* oldest commit to traverse from. The result file will be loaded * oldest commit to traverse from. The result file will be loaded
@ -399,7 +411,7 @@ public class BlameGenerator implements AutoCloseable {
* most recent commits to stop traversal at. Usually an active * most recent commits to stop traversal at. Usually an active
* branch tip, tag, or HEAD. * branch tip, tag, or HEAD.
* @return {@code this} * @return {@code this}
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public BlameGenerator reverse(AnyObjectId start, public BlameGenerator reverse(AnyObjectId start,
@ -443,7 +455,7 @@ public class BlameGenerator implements AutoCloseable {
* Execute the generator in a blocking fashion until all data is ready. * Execute the generator in a blocking fashion until all data is ready.
* *
* @return the complete result. Null if no file exists for the given path. * @return the complete result. Null if no file exists for the given path.
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public BlameResult computeBlameResult() throws IOException { public BlameResult computeBlameResult() throws IOException {
@ -464,7 +476,7 @@ public class BlameGenerator implements AutoCloseable {
* and {@link #getResultStart()}, {@link #getResultEnd()} methods * and {@link #getResultStart()}, {@link #getResultEnd()} methods
* can be used to inspect the region found. False if there are no * can be used to inspect the region found. False if there are no
* more regions to describe. * more regions to describe.
* @throws IOException * @throws java.io.IOException
* repository cannot be read. * repository cannot be read.
*/ */
public boolean next() throws IOException { public boolean next() throws IOException {
@ -842,28 +854,47 @@ public class BlameGenerator implements AutoCloseable {
return outCandidate.sourceCommit; return outCandidate.sourceCommit;
} }
/** @return current author being blamed. */ /**
* Get source author
*
* @return current author being blamed
*/
public PersonIdent getSourceAuthor() { public PersonIdent getSourceAuthor() {
return outCandidate.getAuthor(); return outCandidate.getAuthor();
} }
/** @return current committer being blamed. */ /**
* Get source committer
*
* @return current committer being blamed
*/
public PersonIdent getSourceCommitter() { public PersonIdent getSourceCommitter() {
RevCommit c = getSourceCommit(); RevCommit c = getSourceCommit();
return c != null ? c.getCommitterIdent() : null; return c != null ? c.getCommitterIdent() : null;
} }
/** @return path of the file being blamed. */ /**
* Get source path
*
* @return path of the file being blamed
*/
public String getSourcePath() { public String getSourcePath() {
return outCandidate.sourcePath.getPath(); return outCandidate.sourcePath.getPath();
} }
/** @return rename score if a rename occurred in {@link #getSourceCommit}. */ /**
* Get rename score
*
* @return rename score if a rename occurred in {@link #getSourceCommit}
*/
public int getRenameScore() { public int getRenameScore() {
return outCandidate.renameScore; return outCandidate.renameScore;
} }
/** /**
* Get first line of the source data that has been blamed for the current
* region
*
* @return first line of the source data that has been blamed for the * @return first line of the source data that has been blamed for the
* current region. This is line number of where the region was added * current region. This is line number of where the region was added
* during {@link #getSourceCommit()} in file * during {@link #getSourceCommit()} in file
@ -874,6 +905,9 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* Get one past the range of the source data that has been blamed for the
* current region
*
* @return one past the range of the source data that has been blamed for * @return one past the range of the source data that has been blamed for
* the current region. This is line number of where the region was * the current region. This is line number of where the region was
* added during {@link #getSourceCommit()} in file * added during {@link #getSourceCommit()} in file
@ -885,6 +919,9 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* Get first line of the result that {@link #getSourceCommit()} has been
* blamed for providing
*
* @return first line of the result that {@link #getSourceCommit()} has been * @return first line of the result that {@link #getSourceCommit()} has been
* blamed for providing. Line numbers use 0 based indexing. * blamed for providing. Line numbers use 0 based indexing.
*/ */
@ -893,6 +930,9 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* Get one past the range of the result that {@link #getSourceCommit()} has
* been blamed for providing
*
* @return one past the range of the result that {@link #getSourceCommit()} * @return one past the range of the result that {@link #getSourceCommit()}
* has been blamed for providing. Line numbers use 0 based indexing. * has been blamed for providing. Line numbers use 0 based indexing.
* Because a source cannot be blamed for an empty region of the * Because a source cannot be blamed for an empty region of the
@ -905,6 +945,9 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* Get number of lines in the current region being blamed to
* {@link #getSourceCommit()}
*
* @return number of lines in the current region being blamed to * @return number of lines in the current region being blamed to
* {@link #getSourceCommit()}. This is always the value of the * {@link #getSourceCommit()}. This is always the value of the
* expression {@code getResultEnd() - getResultStart()}, but also * expression {@code getResultEnd() - getResultStart()}, but also
@ -915,6 +958,9 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* Get complete contents of the source file blamed for the current output
* region
*
* @return complete contents of the source file blamed for the current * @return complete contents of the source file blamed for the current
* output region. This is the contents of {@link #getSourcePath()} * output region. This is the contents of {@link #getSourcePath()}
* within {@link #getSourceCommit()}. The source contents is * within {@link #getSourceCommit()}. The source contents is
@ -926,13 +972,15 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* Get complete file contents of the result file blame is annotating
*
* @return complete file contents of the result file blame is annotating. * @return complete file contents of the result file blame is annotating.
* This value is accessible only after being configured and only * This value is accessible only after being configured and only
* immediately before the first call to {@link #next()}. Returns * immediately before the first call to {@link #next()}. Returns
* null if the path does not exist. * null if the path does not exist.
* @throws IOException * @throws java.io.IOException
* repository cannot be read. * repository cannot be read.
* @throws IllegalStateException * @throws java.lang.IllegalStateException
* {@link #next()} has already been invoked. * {@link #next()} has already been invoked.
*/ */
public RawText getResultContents() throws IOException { public RawText getResultContents() throws IOException {
@ -940,6 +988,8 @@ public class BlameGenerator implements AutoCloseable {
} }
/** /**
* {@inheritDoc}
* <p>
* Release the current blame session. * Release the current blame session.
* *
* @since 4.0 * @since 4.0

31
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java

@ -78,7 +78,7 @@ public class BlameResult {
* the generator the result will consume records from. * the generator the result will consume records from.
* @return the new result object. null if the generator cannot find the path * @return the new result object. null if the generator cannot find the path
* it starts from. * it starts from.
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public static BlameResult create(BlameGenerator gen) throws IOException { public static BlameResult create(BlameGenerator gen) throws IOException {
@ -123,17 +123,27 @@ public class BlameResult {
sourcePaths = new String[cnt]; sourcePaths = new String[cnt];
} }
/** @return path of the file this result annotates. */ /**
* Get result path
*
* @return path of the file this result annotates
*/
public String getResultPath() { public String getResultPath() {
return resultPath; return resultPath;
} }
/** @return contents of the result file, available for display. */ /**
* Get result contents
*
* @return contents of the result file, available for display
*/
public RawText getResultContents() { public RawText getResultContents() {
return resultContents; return resultContents;
} }
/** Throw away the {@link #getResultContents()}. */ /**
* Throw away the {@link #getResultContents()}.
*/
public void discardResultContents() { public void discardResultContents() {
resultContents = null; resultContents = null;
} }
@ -227,7 +237,7 @@ public class BlameResult {
/** /**
* Compute all pending information. * Compute all pending information.
* *
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public void computeAll() throws IOException { public void computeAll() throws IOException {
@ -252,7 +262,7 @@ public class BlameResult {
* to determine how many lines of the result were computed. * to determine how many lines of the result were computed.
* *
* @return index that is now available. -1 if no more are available. * @return index that is now available. -1 if no more are available.
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public int computeNext() throws IOException { public int computeNext() throws IOException {
@ -271,7 +281,11 @@ public class BlameResult {
} }
} }
/** @return length of the last segment found by {@link #computeNext()}. */ /**
* Get last length
*
* @return length of the last segment found by {@link #computeNext()}
*/
public int lastLength() { public int lastLength() {
return lastLength; return lastLength;
} }
@ -283,7 +297,7 @@ public class BlameResult {
* first index to examine (inclusive). * first index to examine (inclusive).
* @param end * @param end
* end index (exclusive). * end index (exclusive).
* @throws IOException * @throws java.io.IOException
* the repository cannot be read. * the repository cannot be read.
*/ */
public void computeRange(int start, int end) throws IOException { public void computeRange(int start, int end) throws IOException {
@ -322,6 +336,7 @@ public class BlameResult {
} }
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
StringBuilder r = new StringBuilder(); StringBuilder r = new StringBuilder();

1
org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java

@ -325,6 +325,7 @@ class Candidate {
} }
} }
/** {@inheritDoc} */
@SuppressWarnings("nls") @SuppressWarnings("nls")
@Override @Override
public String toString() { public String toString() {

1
org.eclipse.jgit/src/org/eclipse/jgit/blame/Region.java

@ -116,6 +116,7 @@ class Region {
return head; return head;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();

2
org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java

@ -57,6 +57,7 @@ final class ReverseWalk extends RevWalk {
super(repo); super(repo);
} }
/** {@inheritDoc} */
@Override @Override
public ReverseCommit next() throws MissingObjectException, public ReverseCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException { IncorrectObjectTypeException, IOException {
@ -68,6 +69,7 @@ final class ReverseWalk extends RevWalk {
return c; return c;
} }
/** {@inheritDoc} */
@Override @Override
protected RevCommit createCommit(AnyObjectId id) { protected RevCommit createCommit(AnyObjectId id) {
return new ReverseCommit(id); return new ReverseCommit(id);

Loading…
Cancel
Save