From bfbe52754b3f39587ee5b06ecb918eb40bee1eba Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 7 Mar 2018 22:10:35 +1100 Subject: [PATCH] completed some javadoc on compile and constructor methods Signed-off-by: Lachlan Roberts --- .../org/eclipse/jetty/util/SearchPattern.java | 18 +++++++++++++++--- .../eclipse/jetty/util/SearchPatternTest.java | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/SearchPattern.java b/jetty-util/src/main/java/org/eclipse/jetty/util/SearchPattern.java index 1455e617c0e..f429e48ad52 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/SearchPattern.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/SearchPattern.java @@ -41,19 +41,31 @@ public class SearchPattern private int[] table; private byte[] pattern; - + /** + * Produces a SearchPattern instance which can be used + * to find matches of the pattern in data + * @param pattern byte array containing the pattern + * @return a new SearchPattern instance using the given pattern + */ public static SearchPattern compile(byte[] pattern) { return new SearchPattern(Arrays.copyOf(pattern, pattern.length)); } - + /** + * Produces a SearchPattern instance which can be used + * to find matches of the pattern in data + * @param pattern string containing the pattern + * @return a new SearchPattern instance using the given pattern + */ public static SearchPattern compile(String pattern) { return new SearchPattern(pattern.getBytes(StandardCharsets.UTF_8)); } - + /** + * @param pattern byte array containing the pattern used for matching + */ private SearchPattern(byte[] pattern) { this.pattern = pattern; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/SearchPatternTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/SearchPatternTest.java index 90554df8536..42d21597afc 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/SearchPatternTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/SearchPatternTest.java @@ -25,7 +25,8 @@ import java.nio.charset.StandardCharsets; import org.junit.Assert; import org.junit.Test; -public class SearchPatternTest +public class + {