You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2002/07/01 01:08:48 UTC

cvs commit: jakarta-commons-sandbox/lang/src/java/org/apache/commons/lang Objects.java

scolebourne    2002/06/30 16:08:48

  Modified:    lang/src/java/org/apache/commons/lang Objects.java
  Log:
  Rename isNull method
  Tidy javadoc
  
  Revision  Changes    Path
  1.5       +14 -14    jakarta-commons-sandbox/lang/src/java/org/apache/commons/lang/Objects.java
  
  Index: Objects.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/lang/src/java/org/apache/commons/lang/Objects.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Objects.java	23 Jun 2002 23:04:16 -0000	1.4
  +++ Objects.java	30 Jun 2002 23:08:48 -0000	1.5
  @@ -70,37 +70,37 @@
       /**
        * Returns a default value if the object passed is null.
        *
  -     * @param o The object to test.
  -     * @param dflt The default value to return.
  -     * @return The object o if it is not null, dflt otherwise.
  +     * @param object  the object to test.
  +     * @param defaultValue  the default value to return.
  +     * @return object if it is not null, defaultValue otherwise.
        */
  -    public static Object isNull(Object o, Object dflt)
  +    public static Object defaultIfNull(Object object, Object defaultValue)
       {
  -        return (o != null ? o : dflt);
  +        return (object != null ? object : defaultValue);
       }
   
       /**
        * Compares two objects for equality, where either one or both
        * objects may be <code>null</code>.
        *
  -     * @param o1 The first object.
  -     * @param o2 The second object.
  +     * @param object1  the first object.
  +     * @param object2  the second object.
        * @return True if the values of both objects are the same.
        */
  -    public static boolean equals(Object o1, Object o2)
  +    public static boolean equals(Object object1, Object object2)
       {
  -        if (o1 == null)
  +        if (object1 == null)
           {
  -            return (o2 == null);
  +            return (object2 == null);
           }
  -        else if (o2 == null)
  +        else if (object2 == null)
           {
  -            // o1 is not null
  +            // object1 is not null
               return false;
           }
           else
           {
  -            return o1.equals(o2);
  +            return object1.equals(object2);
           }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>