portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/util ArgUtil.java
Date Tue, 20 Jul 2004 18:48:34 GMT
weaver      2004/07/20 11:48:34

  Modified:    commons/src/java/org/apache/jetspeed/util ArgUtil.java
  Log:
  - Added an additional to be able to supply a methodName.
  - Made most of ArgUtil final.
  
  Revision  Changes    Path
  1.4       +11 -3     jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/util/ArgUtil.java
  
  Index: ArgUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/util/ArgUtil.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ArgUtil.java	2 Jul 2004 13:25:02 -0000	1.3
  +++ ArgUtil.java	20 Jul 2004 18:48:34 -0000	1.4
  @@ -26,7 +26,7 @@
    * @version $Id$
    *
    */
  -public class ArgUtil
  +public final class ArgUtil
   {
       private static final String MSG_1 = "Argument \"";
       private static final String MSG_2 = "\" cannot be null for method ";
  @@ -72,11 +72,19 @@
        * @param thisObject
        * @throws IllegalArgumentException
        */
  -    public static void assertNotNull(Class nonNullClass, Object nonNullObject, Object thisObject)
throws IllegalArgumentException
  +    public static final void assertNotNull(Class nonNullClass, Object nonNullObject, Object
thisObject) throws IllegalArgumentException
       {
           if(nonNullObject == null)
           {
               throw new IllegalArgumentException(thisObject.getClass().getName()+" requires
a non-null "+nonNullClass.getName()+" as an argument.");
  +        }
  +    }
  +    
  +    public static final void assertNotNull(Class nonNullClass, Object nonNullObject, Object
thisObject, String methodName) throws IllegalArgumentException
  +    {
  +        if(nonNullObject == null)
  +        {
  +            throw new IllegalArgumentException(thisObject.getClass().getName()+"."+methodName+"
requires a non-null "+nonNullClass.getName()+" as an argument.");
           }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message