From 6c83cc16605f6aec9b5e712b3e559927c0823696 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 18 Dec 2017 11:45:55 +0100 Subject: [PATCH] Fix javadoc in org.eclipse.jgit fnmatch package Change-Id: I14384c3bf3c41f8e1c62ec117837c2fc782a832f Signed-off-by: Matthias Sohn --- .../eclipse/jgit/fnmatch/AbstractHead.java | 12 +++++++- .../eclipse/jgit/fnmatch/CharacterHead.java | 8 +++++ .../eclipse/jgit/fnmatch/FileNameMatcher.java | 29 ++++++++++++------- .../org/eclipse/jgit/fnmatch/GroupHead.java | 1 + .../src/org/eclipse/jgit/fnmatch/Head.java | 1 + .../org/eclipse/jgit/fnmatch/LastHead.java | 1 + .../jgit/fnmatch/RestrictedWildCardHead.java | 2 ++ .../eclipse/jgit/fnmatch/WildCardHead.java | 1 + 8 files changed, 44 insertions(+), 11 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java index 10c84c4ec..60669bb95 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java @@ -53,6 +53,13 @@ abstract class AbstractHead implements Head { private final boolean star; + /** + * Whether the char matches + * + * @param c + * a char. + * @return whether the char matches + */ protected abstract boolean matches(char c); AbstractHead(boolean star) { @@ -60,9 +67,11 @@ abstract class AbstractHead implements Head { } /** + * Set {@link org.eclipse.jgit.fnmatch.Head}s which will not be modified. * * @param newHeads - * a list of {@link Head}s which will not be modified. + * a list of {@link org.eclipse.jgit.fnmatch.Head}s which will + * not be modified. */ public final void setNewHeads(List newHeads) { if (this.newHeads != null) @@ -70,6 +79,7 @@ abstract class AbstractHead implements Head { this.newHeads = newHeads; } + /** {@inheritDoc} */ @Override public List getNextHeads(char c) { if (matches(c)) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java index 6211b246f..98aee0eef 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java @@ -47,16 +47,24 @@ package org.eclipse.jgit.fnmatch; final class CharacterHead extends AbstractHead { private final char expectedCharacter; + /** + * Constructor for CharacterHead + * + * @param expectedCharacter + * expected {@code char} + */ protected CharacterHead(final char expectedCharacter) { super(false); this.expectedCharacter = expectedCharacter; } + /** {@inheritDoc} */ @Override protected final boolean matches(final char c) { return c == expectedCharacter; } + /** {@inheritDoc} */ @Override public String toString() { return String.valueOf(expectedCharacter); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java index 856d74e99..56630395b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java @@ -126,12 +126,14 @@ public class FileNameMatcher { } /** + * Constructor for FileNameMatcher + * * @param patternString * must contain a pattern which fnmatch would accept. * @param invalidWildgetCharacter * if this parameter isn't null then this character will not * match at wildcards(* and ? are wildcards). - * @throws InvalidPatternException + * @throws org.eclipse.jgit.errors.InvalidPatternException * if the patternString contains a invalid fnmatch pattern. */ public FileNameMatcher(final String patternString, @@ -141,11 +143,13 @@ public class FileNameMatcher { } /** - * A Copy Constructor which creates a new {@link FileNameMatcher} with the - * same state and reset point like other. + * A Copy Constructor which creates a new + * {@link org.eclipse.jgit.fnmatch.FileNameMatcher} with the same state and + * reset point like other. * * @param other - * another {@link FileNameMatcher} instance. + * another {@link org.eclipse.jgit.fnmatch.FileNameMatcher} + * instance. */ public FileNameMatcher(FileNameMatcher other) { this(other.headsStartValue, other.heads); @@ -347,6 +351,7 @@ public class FileNameMatcher { } /** + * Append to the string which is matched against the patterns of this class * * @param stringToMatch * extends the string which is matched against the patterns of @@ -369,10 +374,13 @@ public class FileNameMatcher { } /** + * Create a {@link org.eclipse.jgit.fnmatch.FileNameMatcher} instance which + * uses the same pattern like this matcher, but has the current state of + * this matcher as reset and start point * - * @return a {@link FileNameMatcher} instance which uses the same pattern - * like this matcher, but has the current state of this matcher as - * reset and start point. + * @return a {@link org.eclipse.jgit.fnmatch.FileNameMatcher} instance which + * uses the same pattern like this matcher, but has the current + * state of this matcher as reset and start point. */ public FileNameMatcher createMatcherForSuffix() { final List copyOfHeads = new ArrayList<>(heads.size()); @@ -381,8 +389,9 @@ public class FileNameMatcher { } /** + * Whether the matcher matches * - * @return true, if the string currently being matched does match. + * @return whether the matcher matches */ public boolean isMatch() { if (heads.isEmpty()) @@ -400,9 +409,9 @@ public class FileNameMatcher { } /** + * Whether a match can be appended * - * @return false, if the string being matched will not match when the string - * gets extended. + * @return a boolean. */ public boolean canAppendMatch() { for (int i = 0; i < heads.size(); i++) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java index 5c1875678..965d90085 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java @@ -130,6 +130,7 @@ final class GroupHead extends AbstractHead { } } + /** {@inheritDoc} */ @Override protected final boolean matches(final char c) { for (CharacterPattern pattern : characterClasses) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java index 3de18a735..49839f8e6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java @@ -48,6 +48,7 @@ import java.util.List; interface Head { /** + * Get the character which decides which heads are returned * * @param c * the character which decides which heads are returned. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java index f9ddd9e65..726d1f2f8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java @@ -56,6 +56,7 @@ final class LastHead implements Head { // defined because of javadoc and visibility modifier. } + /** {@inheritDoc} */ @Override public List getNextHeads(char c) { return FileNameMatcher.EMPTY_HEAD_LIST; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java index 4a0a03df2..c132e2815 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java @@ -52,11 +52,13 @@ final class RestrictedWildCardHead extends AbstractHead { this.excludedCharacter = excludedCharacter; } + /** {@inheritDoc} */ @Override protected final boolean matches(final char c) { return c != excludedCharacter; } + /** {@inheritDoc} */ @Override public String toString() { return isStar() ? "*" : "?"; //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java index b5173d97d..c806e2313 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java @@ -49,6 +49,7 @@ final class WildCardHead extends AbstractHead { super(star); } + /** {@inheritDoc} */ @Override protected final boolean matches(final char c) { return true;