Request for Review : CR#6924259: Remove String.count/String.offset (original) (raw)

Mike Duigou mike.duigou at oracle.com
Tue May 29 18:55:12 UTC 2012


I have posted a new webrev to:

<http://cr.openjdk.java.net/~mduigou/6924259/1/webrev/

Removing String(int offset, int count, char value[]) will create trouble, I've seen several libraries that use it by reflection to avoid to create a copy of the array. I think this method should not disappear but use Arrays.copyOfRange if the offset is not 0. This method should be marked deprecated, and removed in Java 9. Restored but deprecated.

On further discussion I would like to deprecate this method in the Java 7 implementation and remove this method for Java 8. It is not part of the public API and developers have at least a year to remove it from their applications. Having it be absent from Java 8 pre-release builds will also hopefully provide them a non-ignorable heads-up to replace their usage with the public (char[], int, int) variant.

Mike



More information about the core-libs-dev mailing list