ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r703493 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
Date Fri, 10 Oct 2008 15:04:46 GMT
Author: bodewig
Date: Fri Oct 10 08:04:46 2008
New Revision: 703493

URL: http://svn.apache.org/viewvc?rev=703493&view=rev
Log:
space is not the only whitespace that could show up.  bottom/head are free-form HTML with
line breaks, tabs and all that.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java?rev=703493&r1=703492&r2=703493&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java Fri Oct 10 08:04:46
2008
@@ -2220,8 +2220,8 @@
      * @return the quoted string, if there is no need to quote the string,
      *         return the original string.
      */
-    private String quoteString(String str) {
-        if (str.indexOf(' ') == -1
+    private String quoteString(final String str) {
+        if (!containsWhitespace(str)
             && str.indexOf('\'') == -1
             && str.indexOf('"') == -1) {
             return str;
@@ -2233,7 +2233,17 @@
         }
     }
 
-    private String quoteString(String str, char delim) {
+    private boolean containsWhitespace(final String s) {
+        final int len = s.length();
+        for (int i = 0; i < len; i++) {
+            if (Character.isWhitespace(s.charAt(i))) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private String quoteString(String str, final char delim) {
         StringBuffer buf = new StringBuffer(str.length() * 2);
         buf.append(delim);
         if (str.indexOf('\\') != -1) {



Mime
View raw message