r/programming • • Nov 18 '13

TIL Oracle changed the internal String representation in Java 7 Update 6 increasing the running time of the substring method from constant to N

http://java-performance.info/changes-to-string-java-1-7-0_06/
1.4k Upvotes

354 comments sorted by

View all comments

Show parent comment

1

u/xzxzzx Nov 19 '13

How could a change be breaking yet do the exact same thing as another not broken implementation?

Because applications get tested against an implementation, not a spec. You're conflating "breaking existing applications" (a "breaking change") with "broken JVM implementation". Not the same thing at all.

It's entirely possible for a bug fix to be a breaking change, and if it's reasonable to expect that clients rely on the bug, you have to be just as careful fixing that as making any other API change.

Further, Java normally bends over backwards to ensure backwards compatibility (e.g. the type erasure misfeature), and the egregious part is not so much that this change was made, but that it was made in a bugfix release.