Analyzing my Android app crashes, I found a weird one that happens only on Samsung Galaxy Note 3 devices. Here is the top of crash stack:
-------
java.lang.ArrayIndexOutOfBoundsException
java.lang.String.trim(String.java:1416)
-------
Does anyone know how it can be possible?
It looks like manufacturer slightly updated original version of String class.
Comment: The problem is that String object is immutable - I can not modify internal chars array or string length in any way. That's why trim() method in theory should never throw such type of exceptions: trim() method must check array bounds by itself (that it really does in default implementation).