Remove apache commons StringUtils dependency
Brought to you by:
aruckerjones,
sconway
apache commons depencency is >400KB. The dependency is only needed for checking for whitespace strings. I suggest removing the dependency and instead use the following three lines:
protected boolean isAllWhiteSpace(CharSequence sb) {
for( int i=0; i<sb.length(); i++ ){
if( !Character.isWhitespace(sb.charAt(i)) )return false;
}
return true;
}
I see both sides on this issue so I will need to think on this. Eventually I would be expanding my use of the apache commons as I don't want to reinvent the wheel and it give me less code to maintain. But this project's final deliverable is less than 40k and has an dependency that is ten times its size.
opencsv 3.8 (including my pending patch, if it is accepted) uses:
ArrayUtils.indexOf()
FieldUtils.writeField()
ObjectUtils.toString()
StrBuilder
StringUtils.isBlank()
StringUtils.isEmpty()
StringUtils.isNotBlank()
StringUtils.isNotEmpty()
StringUtils.isWhitespace()
I would much rather spend my time finding further ways to use Apache Commons Lang to simplify our code, rather than remove the dependency.
For the reasons given, the dependency to Apache Commons Lang will remain.