--- old/src/share/classes/java/lang/System.java 2013-04-29 21:12:09.630988789 -0700 +++ new/src/share/classes/java/lang/System.java 2013-04-29 21:12:09.430988779 -0700 @@ -1246,6 +1246,9 @@ public StackTraceElement getStackTraceElement(Throwable t, int i) { return t.getStackTraceElement(i); } + public String newStringUnsafe(char[] chars) { + return new String(chars, true); + } }); } } --- old/src/share/classes/sun/misc/JavaLangAccess.java 2013-04-29 21:12:10.318988822 -0700 +++ new/src/share/classes/sun/misc/JavaLangAccess.java 2013-04-29 21:12:10.114988812 -0700 @@ -97,4 +97,14 @@ * Returns the ith StackTraceElement for the given throwable. */ StackTraceElement getStackTraceElement(Throwable t, int i); + + /** + * Returns a new string backed by the provided character array. The + * character array is not copied and must never be modified after the + * String is created in order to fulfill String's contract. + * + * @param chars the character array to back the string + * @return a newly created string whose content is the character array + */ + String newStringUnsafe(char[] chars); }