Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 89045 invoked from network); 7 Apr 2011 04:04:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Apr 2011 04:04:21 -0000 Received: (qmail 12864 invoked by uid 500); 7 Apr 2011 04:04:20 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 12813 invoked by uid 500); 7 Apr 2011 04:04:19 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 12802 invoked by uid 99); 7 Apr 2011 04:04:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 04:04:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 04:04:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6CD562388980; Thu, 7 Apr 2011 04:03:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1089724 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Date: Thu, 07 Apr 2011 04:03:55 -0000 To: commits@commons.apache.org From: bayard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110407040355.6CD562388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bayard Date: Thu Apr 7 04:03:55 2011 New Revision: 1089724 URL: http://svn.apache.org/viewvc?rev=1089724&view=rev Log: Implemented the native CharSequence version of toCharArray Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1089724&r1=1089723&r2=1089724&view=diff ============================================================================== --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Thu Apr 7 04:03:55 2011 @@ -6489,8 +6489,12 @@ public class StringUtils { if (cs instanceof String) { return ((String) cs).toCharArray(); } else { - // TODO: Implement rather than convert to String - return cs.toString().toCharArray(); + int sz = cs.length(); + char[] array = new char[cs.length()]; + for (int i=0; i < sz; i++) { + array[i] = cs.charAt(i); + } + return array; } }