Oracle increases the runtime of substring from O(1) to O(n) in a minor point release

cypherpunks comments:

Very funny. Our importer went from a few minutes to parse a couple gigabytes of data to literally centuries. In the context of theoretical computer science that means correctness is preserved. In the real world, however, this means that the program stops progressing until a frustrated user presses the cancel button and calls our hotline.

I fully agree that the new semantic would have been a better choice for substring from the start. The hidden memory consumption was always a trap, but experienced developers knew this, and consequently knew the implementation of substring and that it was a simple way to pass char[], offset, range to a function with only one pointer.

Changing this function, in a bugfix release no less, was totally irresponsible. It broke backwards compatibility for numerous applications with errors that didn’t even produce a message, just freezing and timeouts. It makes the old behavior inaccessible for those who would like to continue to use it. The new behavior was already available via new String(x.substring(a, b)).

Bad mojo over there in the Java world - for at least some people depending on the old, fast behavior of the method.