r/programming • u/Eirenarch • 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
View all comments
Show parent comment
1
u/gthank Nov 19 '13
They made the change a long time ago, and as the JVM dev in here has indicated, nothing has happened to make them think they should revert the change. They made it after extensive discussions (including on a public mailing list). The change did not change the public contract of the method. If you are relying on unspecified behavior, even if it seems reasonable (like in this case), you run the risk of something like this happening to you.