Is the following worth keeping in Lang? public Foo someJdkMethod(Object input) { if(input == null) { handleAccordingly(); } return input.jdkMethod(); }
I feel that we've bloated up with these methods, and is it really worth it? I still have lots of if(x != null && x.callFoo()) type invocations, having a small handful of methods available in Lang to let me say if(FooUtils.callFoo(x)) isn't enough to hide all of the other times when I might have to worry about it. Personally I'd like to see these methods removed from Lang [especially given Stephen's blogging about null protected setting in some future JVM]. An example: public static String trim(String str) { return str == null ? null : str.trim(); } Given that I'm likely to do N things to the string, chances are I'll check for null up front and then invoke methods rather than repeatedly writing ugly code by using StringUtils. Any thoughts in favour of these methods? Hen --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org