Author: kevj Date: Fri Aug 25 01:51:52 2006 New Revision: 436720 URL: http://svn.apache.org/viewvc?rev=436720&view=rev Log: use array version of tokenize path for rtrim
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.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=436720&r1=436719&r2=436720&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 Fri Aug 25 01:51:52 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 The Apache Software Foundation + * Copyright 2002-2006 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -471,7 +471,7 @@ } return true; } - + /** * Breaks a path up into a Vector of path elements, tokenizing on * <code>File.separator</code>. @@ -557,7 +557,6 @@ return l; } - /** * Returns dependency information on these two files. If src has been * modified later than target, it returns true. If target doesn't exist, @@ -666,16 +665,16 @@ * @return the leftmost part of the pattern without wildcards */ public static String rtrimWildcardTokens(String input) { - Vector v = tokenizePath(input, File.separator); + String[] tokens = tokenizePathAsArray(input); StringBuffer sb = new StringBuffer(); - for (int counter = 0; counter < v.size(); counter++) { - if (hasWildcards((String) v.elementAt(counter))) { + for (int i = 0; i < tokens.length; i++) { + if (hasWildcards(tokens[i])) { break; } - if (counter > 0 && sb.charAt(sb.length() - 1) != File.separatorChar) { + if (i > 0 && sb.charAt(sb.length() - 1) != File.separatorChar) { sb.append(File.separator); } - sb.append((String) v.elementAt(counter)); + sb.append(tokens[i]); } return sb.toString(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]