There is an additional bug in the commit:
The static overload for String size is just wrong, see the recent failure:
expected:<48> but was:<56>
java.lang.AssertionError: expected:<48> but was:<56>
The code uses an internal assumption on how a string is built internally. This assumption may not be correct for all JVMs. There is nothing in the JDK spec that specifies how a String should look like internally. Especially if it is a substring of another string: in that case the array is larger than string.length(). So the code is just wrong (in addition to this failure).
The static overload is just incorrect then, so please remove it or make it use correct sizes, e.g. when the measured string is a substring of another one. Or if the JDK uses another internal String representation. The latter can be checked out before by inspecting string internals on the RUE startup.