Input parameter checking in Java API

Michael Su shuoshuo at gmail.com
Sat May 14 04:21:20 PDT 2005


Hi all,

I found that the following methods may need some NULL checks to avoid
java.lang.NullPointerException ...

* public Object get(String key, Integer hashCode)
   - check if (key == NULL)
* private boolean set(String cmdname, String key, Object value, Date
expiry, Integer hashCode, boolean asString)
   - check if (key == NULL || value == NULL)
* public boolean delete(String key, Integer hashCode, Date expiry)
   - check if (key == NULL)
* private long incrdecr(String cmdname, String key, long inc, Integer hashCode)
   - check if (key == NULL)

Please correct me if I'm wrong ~~ :)

BR
Shuo


More information about the memcached mailing list