martin-g commented on a change in pull request #497:
URL: https://github.com/apache/wicket/pull/497#discussion_r796930980



##########
File path: wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java
##########
@@ -531,8 +531,24 @@ else if (aChar == 'f')
         */
        public static boolean isEmpty(final CharSequence string)
        {
-               return (string == null) || (string.length() == 0) ||
-                       (string.toString().trim().length() == 0);
+               return string == null || string.length() == 0 ||
+                       (string.charAt(0) <= ' ' && 
string.toString().trim().isEmpty());
+       }
+
+       /**
+        * Checks whether the <code>string</code> is considered empty. Empty 
means that the string may
+        * contain whitespace, but no visible characters.
+        *
+        * "\n\t " is considered empty, while " a" is not.
+        *
+        * @param string
+        *            The string
+        * @return True if the string is null or ""
+        */

Review comment:
       Same - please add a comment

##########
File path: wicket-util/src/main/java/org/apache/wicket/util/lang/Args.java
##########
@@ -66,6 +66,26 @@
                return argument;
        }
 
+       /**
+        * Checks argument is not empty (not null and has a non-whitespace 
character)
+        *
+        * @param argument
+        *            the argument to check for emptiness
+        * @param name
+        *            the name to use in the error message
+        * @return The {@code argument} parameter if not empty
+        * @throws IllegalArgumentException
+        *             when the passed {@code argument} is empty
+        */

Review comment:
       please add a comment why there are two "identical" methods.
   in few months/years someone will wonder what is going on




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@wicket.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to