Author: kkolinko
Date: Tue Aug 12 13:29:52 2014
New Revision: 1617470

URL: http://svn.apache.org/r1617470
Log:
Review of fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=56801
Revert public API changes from r1615876

I think match(String, char[], boolean) is a bad signature to expose such method 
as public.

My concerns:
a) Maybe there is a way to cache String->char[] conversions for the pattern set 
as well.
In that case the method signature will become (char[],char[],..).
As of now the current improvement is an incomplete one.

b) I am not sure that using String vs char[] array has much difference.
Is it worth to stick to char[] in the API?

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/file/Matcher.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/file/Matcher.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/file/Matcher.java?rev=1617470&r1=1617469&r2=1617470&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/file/Matcher.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/file/Matcher.java Tue Aug 12 
13:29:52 2014
@@ -56,10 +56,22 @@ public final class Matcher {
 
 
     /**
-     * @deprecated Use {@link #match(String, char[], boolean)}. This method 
will
-     *             be removed in Tomcat 9.0.x onwards.
+     * Tests whether or not a string matches against a pattern.
+     * The pattern may contain two special characters:<br>
+     * '*' means zero or more characters<br>
+     * '?' means one and only one character
+     *
+     * @param pattern The pattern to match against.
+     *                Must not be <code>null</code>.
+     * @param str     The string which must be matched against the
+     *                pattern. Must not be <code>null</code>.
+     * @param caseSensitive Whether or not matching should be performed
+     *                        case sensitively.
+     *
+     *
+     * @return <code>true</code> if the string matches against the pattern,
+     *         or <code>false</code> otherwise.
      */
-    @Deprecated
     public static boolean match(String pattern, String str,
             boolean caseSensitive) {
 
@@ -84,7 +96,7 @@ public final class Matcher {
      * @return <code>true</code> if the string matches against the pattern,
      *         or <code>false</code> otherwise.
      */
-    public static boolean match(String pattern, char[] strArr,
+    private static boolean match(String pattern, char[] strArr,
                                 boolean caseSensitive) {
         char[] patArr = pattern.toCharArray();
         int patIdxStart = 0;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to