From 107c71a6e6937c0a2d2fe604960eb9d7f1de33c3 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 18 Dec 2017 13:17:49 +0100 Subject: [PATCH] Fix javadoc in org.eclipse.jgit ignore package Change-Id: I1a81d371420cd4cf90ab9e048026c0ab8a763018 Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/ignore/FastIgnoreRule.java | 16 +++++++++++++--- .../src/org/eclipse/jgit/ignore/IgnoreNode.java | 15 +++++++++++---- .../jgit/ignore/internal/AbstractMatcher.java | 3 +++ .../eclipse/jgit/ignore/internal/IMatcher.java | 7 ++++--- .../ignore/internal/LeadingAsteriskMatcher.java | 1 + .../jgit/ignore/internal/NameMatcher.java | 2 ++ .../jgit/ignore/internal/PathMatcher.java | 7 ++++++- .../eclipse/jgit/ignore/internal/Strings.java | 14 ++++++++++---- .../ignore/internal/TrailingAsteriskMatcher.java | 1 + .../jgit/ignore/internal/WildCardMatcher.java | 3 ++- .../jgit/ignore/internal/WildMatcher.java | 2 ++ 11 files changed, 55 insertions(+), 16 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java index 7298a082c7..8abd7fa920 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java @@ -77,6 +77,7 @@ public class FastIgnoreRule { private final boolean dirOnly; /** + * Constructor for FastIgnoreRule * * @param pattern * ignore pattern as described in rules; - /** Create an empty ignore node with no rules. */ + /** + * Create an empty ignore node with no rules. + */ public IgnoreNode() { rules = new ArrayList<>(); } @@ -91,7 +93,7 @@ public class IgnoreNode { * * @param rules * list of rules. - **/ + */ public IgnoreNode(List rules) { this.rules = rules; } @@ -102,7 +104,7 @@ public class IgnoreNode { * @param in * input stream holding the standard ignore format. The caller is * responsible for closing the stream. - * @throws IOException + * @throws java.io.IOException * Error thrown when reading an ignore file. */ public void parse(InputStream in) throws IOException { @@ -122,7 +124,11 @@ public class IgnoreNode { return new BufferedReader(new InputStreamReader(in, Constants.CHARSET)); } - /** @return list of all ignore rules held by this node. */ + /** + * Get list of all ignore rules held by this node + * + * @return list of all ignore rules held by this node + */ public List getRules() { return Collections.unmodifiableList(rules); } @@ -194,6 +200,7 @@ public class IgnoreNode { return MatchResult.CHECK_PARENT; } + /** {@inheritDoc} */ @Override public String toString() { return rules.toString(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java index 64c2a74554..8e8e5717a3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java @@ -64,16 +64,19 @@ public abstract class AbstractMatcher implements IMatcher { this.dirOnly = dirOnly; } + /** {@inheritDoc} */ @Override public String toString() { return pattern; } + /** {@inheritDoc} */ @Override public int hashCode() { return pattern.hashCode(); } + /** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (this == obj) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java index 5b184cb19f..dbf06385c5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java @@ -74,9 +74,10 @@ public interface IMatcher { * with a slash) * @param pathMatch * {@code true} if the match is for the full path: prefix-only - * matches are not allowed, and {@link NameMatcher}s must match - * only the last component (if they can -- they may not, if they - * are anchored at the beginning) + * matches are not allowed, and + * {@link org.eclipse.jgit.ignore.internal.NameMatcher}s must + * match only the last component (if they can -- they may not, if + * they are anchored at the beginning) * @return true if this matcher pattern matches given string */ boolean matches(String path, boolean assumeDirectory, boolean pathMatch); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java index cc0fe937b4..2bae8f229f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java @@ -55,6 +55,7 @@ public class LeadingAsteriskMatcher extends NameMatcher { "Pattern must have leading asterisk: " + pattern); //$NON-NLS-1$ } + /** {@inheritDoc} */ @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java index 9667837a41..6a4b2b8677 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java @@ -71,6 +71,7 @@ public class NameMatcher extends AbstractMatcher { } } + /** {@inheritDoc} */ @Override public boolean matches(String path, boolean assumeDirectory, boolean pathMatch) { @@ -120,6 +121,7 @@ public class NameMatcher extends AbstractMatcher { return false; } + /** {@inheritDoc} */ @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java index 9b3a2aac78..50e78ae751 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java @@ -105,14 +105,17 @@ public class PathMatcher extends AbstractMatcher { } /** + * Create path matcher * * @param pattern + * a pattern * @param pathSeparator * if this parameter isn't null then this character will not * match at wildcards(* and ? are wildcards). * @param dirOnly + * a boolean. * @return never null - * @throws InvalidPatternException + * @throws org.eclipse.jgit.errors.InvalidPatternException */ public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) @@ -170,6 +173,7 @@ public class PathMatcher extends AbstractMatcher { } } + /** {@inheritDoc} */ @Override public boolean matches(String path, boolean assumeDirectory, boolean pathMatch) { @@ -212,6 +216,7 @@ public class PathMatcher extends AbstractMatcher { return false; } + /** {@inheritDoc} */ @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java index 79df1511d1..8828931eef 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java @@ -56,8 +56,8 @@ import org.eclipse.jgit.ignore.FastIgnoreRule; import org.eclipse.jgit.internal.JGitText; /** - * Various {@link String} related utility methods, written mostly to avoid - * generation of new String objects (e.g. via splitting Strings etc). + * Various {@link java.lang.String} related utility methods, written mostly to + * avoid generation of new String objects (e.g. via splitting Strings etc). */ public class Strings { @@ -67,6 +67,8 @@ public class Strings { } /** + * Strip trailing characters + * * @param pattern * non null * @param c @@ -87,6 +89,8 @@ public class Strings { } /** + * Strip trailing whitespace characters + * * @param pattern * non null * @return new string with all trailing whitespace removed @@ -105,10 +109,12 @@ public class Strings { } /** + * Check if pattern is a directory pattern ending with a path separator + * * @param pattern * non null - * @return true if the last character, which is not whitespace, is a path - * separator + * @return {@code true} if the last character, which is not whitespace, is a + * path separator */ public static boolean isDirectoryPattern(String pattern) { for (int i = pattern.length() - 1; i >= 0; i--) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java index 2e148f4a6f..7df42b76cf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java @@ -55,6 +55,7 @@ public class TrailingAsteriskMatcher extends NameMatcher { "Pattern must have trailing asterisk: " + pattern); //$NON-NLS-1$ } + /** {@inheritDoc} */ @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java index f64050f83c..ca8c581d4b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java @@ -50,7 +50,7 @@ import org.eclipse.jgit.errors.InvalidPatternException; /** * Matcher built from path segments containing wildcards. This matcher converts - * glob wildcards to Java {@link Pattern}'s. + * glob wildcards to Java {@link java.util.regex.Pattern}'s. *

* This class is immutable and thread safe. */ @@ -64,6 +64,7 @@ public class WildCardMatcher extends NameMatcher { p = convertGlob(subPattern); } + /** {@inheritDoc} */ @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java index 363b3cee84..ba8015cc09 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java @@ -61,12 +61,14 @@ public final class WildMatcher extends AbstractMatcher { super(WILDMATCH, false); } + /** {@inheritDoc} */ @Override public final boolean matches(String path, boolean assumeDirectory, boolean pathMatch) { return true; } + /** {@inheritDoc} */ @Override public final boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { -- 2.39.5