I was fixing a networking-related bug in Koloniigo. I did something like this:
String fields = data.split(";"); //data contains something like "a;b;;" foo(fields);
Then the program gave IndexOutOfBoundsException
I wonder what's wrong. After a few hours of debugging, I found this thingie in the documentation of split()
Trailing empty strings are therefore not included in the resulting array.
Oh well, wtf? A few hours wasted.
You may think that I'm an idiot that I didn't notice such an obvious mistake. Actually, the real code is way more complicated and there was very many possible causes of the issue. That's why it took me so long to figure out that it's the issue of the split(). :(