public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* classpath-098-merge-branch: Add a new String constructor
@ 2008-09-23 17:52 Andrew Haley
  0 siblings, 0 replies; only message in thread
From: Andrew Haley @ 2008-09-23 17:52 UTC (permalink / raw)
  To: Java Patch List

This is for the new CPStringBuilder.

Andrew.


2008-09-22  Andrew Haley  <aph@redhat.com>

        * java/lang/String.java (toString(char[], int, int)): New method.

Index: java/lang/String.java
===================================================================
--- java/lang/String.java       (revision 140485)
+++ java/lang/String.java       (working copy)
@@ -1440,6 +1440,14 @@
     return count == 0;
   }

+  // Generate a String that shares the value array: subsequent changes
+  // to this array will affect the String.  A private internal method
+  // that is called from CPStringBuilder by compiler-generated code.
+  private static String toString(char[] value, int startIndex, int count)
+  {
+    return new String(value, startIndex, count, true);
+  }
+
   private native void init(char[] chars, int offset, int count,
                           boolean dont_copy);
   private native void init(byte[] chars, int hibyte, int offset, int count);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-22 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-23 17:52 classpath-098-merge-branch: Add a new String constructor Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).