From d1804d3f747fab4c0ead337e8b3749f13f284734 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 18 Dec 2017 11:55:56 +0100 Subject: [PATCH] Fix javadoc in org.eclipse.jgit hooks package Change-Id: I3b644048eb0fc19f94ba8f9799b5a2310481103f Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/hooks/CommitMsgHook.java | 6 ++++++ .../src/org/eclipse/jgit/hooks/GitHook.java | 19 ++++++++++++------- .../src/org/eclipse/jgit/hooks/Hooks.java | 12 ++++++++++++ .../eclipse/jgit/hooks/PostCommitHook.java | 4 ++++ .../org/eclipse/jgit/hooks/PreCommitHook.java | 4 ++++ .../org/eclipse/jgit/hooks/PrePushHook.java | 16 ++++++++++++++++ 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java index fa1707575..f33168d81 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java @@ -71,6 +71,8 @@ public class CommitMsgHook extends GitHook { private String commitMessage; /** + * Constructor for CommitMsgHook + * * @param repo * The repository * @param outputStream @@ -81,6 +83,7 @@ protected CommitMsgHook(Repository repo, PrintStream outputStream) { super(repo, outputStream); } + /** {@inheritDoc} */ @Override public String call() throws IOException, AbortedByHookException { if (commitMessage == null) { @@ -103,12 +106,15 @@ private boolean canRun() { return getCommitEditMessageFilePath() != null && commitMessage != null; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; } /** + * {@inheritDoc} + * * This hook receives one parameter, which is the path to the file holding * the current commit-msg, relative to the repository's work tree. */ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java index b684dd623..fb015c916 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java @@ -79,7 +79,10 @@ abstract class GitHook implements Callable { protected final PrintStream outputStream; /** + * Constructor for GitHook + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream the hook must use. {@code null} is allowed, * in which case the hook will use {@code System.out}. @@ -90,23 +93,23 @@ protected GitHook(Repository repo, PrintStream outputStream) { } /** + * {@inheritDoc} + *

* Run the hook. - * - * @throws IOException - * if IO goes wrong. - * @throws AbortedByHookException - * If the hook has been run and a returned an exit code - * different from zero. */ @Override public abstract T call() throws IOException, AbortedByHookException; /** + * Get name of the hook + * * @return The name of the hook, which must not be {@code null}. */ public abstract String getHookName(); /** + * Get the repository + * * @return The repository. */ protected Repository getRepository() { @@ -135,6 +138,8 @@ protected String getStdinArgs() { } /** + * Get output stream + * * @return The output stream the hook must use. Never {@code null}, * {@code System.out} is returned by default. */ @@ -145,7 +150,7 @@ protected PrintStream getOutputStream() { /** * Runs the hook, without performing any validity checks. * - * @throws AbortedByHookException + * @throws org.eclipse.jgit.api.errors.AbortedByHookException * If the underlying hook script exited with non-zero. */ protected void doRun() throws AbortedByHookException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java index 46e884057..87db36b25 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java @@ -54,7 +54,10 @@ public class Hooks { /** + * Create pre-commit hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The pre-commit hook for the given repository. @@ -65,7 +68,10 @@ public static PreCommitHook preCommit(Repository repo, } /** + * Create post-commit hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The post-commit hook for the given repository. @@ -77,7 +83,10 @@ public static PostCommitHook postCommit(Repository repo, } /** + * Create commit-msg hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The commit-msg hook for the given repository. @@ -88,7 +97,10 @@ public static CommitMsgHook commitMsg(Repository repo, } /** + * Create pre-push hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The pre-push hook for the given repository. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java index 70679e009..24bad16ec 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java @@ -60,6 +60,8 @@ public class PostCommitHook extends GitHook { public static final String NAME = "post-commit"; //$NON-NLS-1$ /** + * Constructor for PostCommitHook + * * @param repo * The repository * @param outputStream @@ -70,12 +72,14 @@ protected PostCommitHook(Repository repo, PrintStream outputStream) { super(repo, outputStream); } + /** {@inheritDoc} */ @Override public Void call() throws IOException, AbortedByHookException { doRun(); return null; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java index 1ab32e0c2..0d9290da3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java @@ -60,6 +60,8 @@ public class PreCommitHook extends GitHook { public static final String NAME = "pre-commit"; //$NON-NLS-1$ /** + * Constructor for PreCommitHook + * * @param repo * The repository * @param outputStream @@ -70,12 +72,14 @@ protected PreCommitHook(Repository repo, PrintStream outputStream) { super(repo, outputStream); } + /** {@inheritDoc} */ @Override public Void call() throws IOException, AbortedByHookException { doRun(); return null; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java index a501fee90..f974eb792 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java @@ -72,6 +72,8 @@ public class PrePushHook extends GitHook { private String refs; /** + * Constructor for PrePushHook + * * @param repo * The repository * @param outputStream @@ -82,11 +84,13 @@ protected PrePushHook(Repository repo, PrintStream outputStream) { super(repo, outputStream); } + /** {@inheritDoc} */ @Override protected String getStdinArgs() { return refs; } + /** {@inheritDoc} */ @Override public String call() throws IOException, AbortedByHookException { if (canRun()) { @@ -102,12 +106,15 @@ private boolean canRun() { return true; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; } /** + * {@inheritDoc} + *

* This hook receives two parameters, which is the name and the location of * the remote repository. */ @@ -120,21 +127,30 @@ protected String[] getParameters() { } /** + * Set remote name + * * @param name + * remote name */ public void setRemoteName(String name) { remoteName = name; } /** + * Set remote location + * * @param location + * a remote location */ public void setRemoteLocation(String location) { remoteLocation = location; } /** + * Set Refs + * * @param toRefs + * a collection of {@code RemoteRefUpdate}s */ public void setRefs(Collection toRefs) { StringBuilder b = new StringBuilder();