You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/09/17 17:53:46 UTC

svn commit: r696348 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/selectors: SelectorUtils.java TokenizedPath.java TokenizedPattern.java

Author: bodewig
Date: Wed Sep 17 08:53:45 2008
New Revision: 696348

URL: http://svn.apache.org/viewvc?rev=696348&view=rev
Log:
cleanup

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java?rev=696348&r1=696347&r2=696348&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java Wed Sep 17 08:53:45 2008
@@ -188,7 +188,7 @@
      */
     public static boolean matchPath(String pattern, String str) {
         String[] patDirs = tokenizePathAsArray(pattern);
-        return matchPath(patDirs, str, true);
+        return matchPath(patDirs, tokenizePathAsArray(str), true);
     }
 
     /**
@@ -212,17 +212,7 @@
     public static boolean matchPath(String pattern, String str,
                                     boolean isCaseSensitive) {
         String[] patDirs = tokenizePathAsArray(pattern);
-        return matchPath(patDirs, str, isCaseSensitive);
-    }
-
-    /**
-     * Core implementation of matchPath.  It is isolated so that it
-     * can be called from TokenizedPattern.
-     */
-    static boolean matchPath(String[] tokenizedPattern, String str,
-                             boolean isCaseSensitive) {
-        return matchPath(tokenizedPattern, tokenizePathAsArray(str),
-                         isCaseSensitive);
+        return matchPath(patDirs, tokenizePathAsArray(str), isCaseSensitive);
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java?rev=696348&r1=696347&r2=696348&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java Wed Sep 17 08:53:45 2008
@@ -199,7 +199,11 @@
         return pathElements.length == 0 && !base.isDirectory() ? null : base;
     }
 
+    /**
+     * Creates a TokenizedPattern from the same tokens that make up
+     * this path.
+     */
     public TokenizedPattern toPattern() {
-        return new TokenizedPattern(path, tokenizedPath);
+        return new TokenizedPattern(path, tokenizedPath); 
     }
 }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java?rev=696348&r1=696347&r2=696348&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/TokenizedPattern.java Wed Sep 17 08:53:45 2008
@@ -59,34 +59,6 @@
      *
      * @param str     The path to match, as a String. Must not be
      *                <code>null</code>.
-     *                
-     * @return <code>true</code> if the pattern matches against the string,
-     *         or <code>false</code> otherwise.
-     */
-    public boolean matchPath(String str) {
-        return SelectorUtils.matchPath(tokenizedPattern, str, true);
-    }
-    
-    /**
-     * Tests whether or not a given path matches a given pattern.
-     *
-     * @param str     The path to match, as a String. Must not be
-     *                <code>null</code>.
-     * @param isCaseSensitive Whether or not matching should be performed
-     *                        case sensitively.
-     *
-     * @return <code>true</code> if the pattern matches against the string,
-     *         or <code>false</code> otherwise.
-     */
-    public boolean matchPath(String str, boolean isCaseSensitive) {
-        return SelectorUtils.matchPath(tokenizedPattern, str, isCaseSensitive);
-    }
-    
-    /**
-     * Tests whether or not a given path matches a given pattern.
-     *
-     * @param str     The path to match, as a String. Must not be
-     *                <code>null</code>.
      * @param isCaseSensitive Whether or not matching should be performed
      *                        case sensitively.
      *