Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoSuchMethodError: java.lang.String.isEmpty

I am using an external library called superCSV and this library apparently makes use of isEmpty. After a search on SO, I found that this method was introduced in 2.3 and indeed the crash I am getting is from 2.2

Is there anyway I can fix it that while still using the library? Perhaps provide an implementation of isEmpty? or somehow get it not to crash? Thank you

like image 269
Snake Avatar asked Sep 05 '26 21:09

Snake


1 Answers

Are you using the latest version of SuperCSV?
This has been fixed with SuperCSV 2.0.1 (and higher) by restoring Java 5 compatibility.

You can see the related commit here: http://sourceforge.net/p/supercsv/code/264/

Instead of calling java.lang.String.isEmpty() the library is now doing a simple check for String.length() == 0. That should fix your problem.

like image 189
jenzz Avatar answered Sep 07 '26 14:09

jenzz