commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/lang STATUS.html
Date Sun, 27 Oct 2002 19:42:04 GMT
bayard      2002/10/27 11:42:04

  Modified:    lang/src/java/org/apache/commons/lang StringUtils.java
               lang     STATUS.html
  Log:
  Changed the signature of StringUtils.defaultString(String,String) and (String) to (Object,
String) and (Object).
  A note needs to be made in the next release that code using defaultString
  needs to be recompiled else it will grumble.
  
  Revision  Changes    Path
  1.20      +11 -11    jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- StringUtils.java	19 Oct 2002 17:18:49 -0000	1.19
  +++ StringUtils.java	27 Oct 2002 19:42:04 -0000	1.20
  @@ -1453,26 +1453,26 @@
       //--------------------------------------------------------------------------
       
       /**
  -     * Return either the passed in String, or if it is <code>null</code>,
  +     * Return either the passed in Object, or if it is <code>null</code>,
        * then an empty String.
        * 
  -     * @param str the String to check
  -     * @return the passed in String, or blank if it was null
  +     * @param str the Object to check
  +     * @return the passed in Object's toString, or blank if it was null
        */
  -    public static String defaultString(String str) {
  -        return defaultString(str, "");
  +    public static String defaultString(Object obj) {
  +        return defaultString(obj, "");
       }
   
       /**
  -     * Return either the passed in String, or if it is <code>null</code>,
  +     * Return either the passed in Object, or if it is <code>null</code>,
        * then a passed in default String.
        * 
  -     * @param str the String to check
  -     * @param defaultString  the default String to return is str is null
  +     * @param obj the Object to check
  +     * @param defaultString  the default String to return if str is null
        * @return the passed in string, or the default if it was null
        */
  -    public static String defaultString(String str, String defaultString) {
  -        return (str == null) ? defaultString : str;
  +    public static String defaultString(Object obj, String defaultString) {
  +        return (obj == null) ? defaultString : obj.toString();
       }
   
       // Reversing
  
  
  
  1.23      +1 -3      jakarta-commons/lang/STATUS.html
  
  Index: STATUS.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/STATUS.html,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- STATUS.html	4 Oct 2002 03:22:47 -0000	1.22
  +++ STATUS.html	27 Oct 2002 19:42:04 -0000	1.23
  @@ -91,8 +91,6 @@
   <li>StringUtils parseBoolean method - This method is in OSCore's TextUtils and seems
very reusable. It could go in a BooleanUtils if such a need was seen. [CODED]</li>
   <li>StringUtils uncapitaliseAllWords method - String Taglib has shown that this method
is missing from StringUtils. [CODED]</li>
   <li>StringUtils unescape method - String Taglib has shown that this method is missing
from StringUtils. It would take a String with "\n" in and convert it to the Java character.
unescape and escape should be symmetric. </li>
  -<li>StringUtils defaultStirng(Object) method - simliar behavior to defaultString(String),
returns obj.toString() if obj != null, "" otherwise
  -<li>StringUtils defaultString(Object, String) method - similar behavior to defaultString(String,
String), returns obj.toString() if obj != null, specified string otherwise
   <li>ArrayUtils - opinion seems to be that this belongs with [lang] and not [collections]
   <li>GUID and other Identifier generators - these may belong in [util], some code
exists in [pattern] at the moment
   <li>CharUtils - Utilities to work on a char[] in the same way as a String
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message