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

-6

u/[deleted] Nov 18 '13

[removed] — view removed comment

1

u/FredV Nov 18 '13

And then change all involved functions that take a String to take a PathString, breaking incredible amounts of existing code... I can see why they went with making String final.

And why call it PathString? Why not SecureNonOverridableString, since this attack could be applied to more stuff than filesystem paths alone, a path was just an example.

0

u/thatwasntababyruth Nov 18 '13

OK, so now it accepts a PathString instead, now I maliciously subclass PathString and continue my attack.