Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 57637 invoked from network); 26 May 2006 11:05:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 May 2006 11:05:24 -0000 Received: (qmail 62056 invoked by uid 500); 26 May 2006 11:05:24 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 61966 invoked by uid 500); 26 May 2006 11:05:23 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 61955 invoked by uid 99); 26 May 2006 11:05:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 May 2006 04:05:23 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 May 2006 04:05:22 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2E6781A983A; Fri, 26 May 2006 04:05:02 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r409641 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io: BufferedReader.java File.java FilePermission.java LineNumberReader.java RandomAccessFile.java StreamTokenizer.java Date: Fri, 26 May 2006 11:05:01 -0000 To: harmony-commits@incubator.apache.org From: mloenko@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060526110502.2E6781A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mloenko Date: Fri May 26 04:05:00 2006 New Revision: 409641 URL: http://svn.apache.org/viewvc?rev=409641&view=rev Log: fixes for HARMONY-396 [classlib][luni] Convert use of StringBuffer to StringBuilder in java.io package Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberReader.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java?rev=409641&r1=409640&r2=409641&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java Fri May 26 04:05:00 2006 @@ -32,6 +32,7 @@ * will buffer input for the file file.java. * * @see BufferedWriter + * @since 1.1 */ public class BufferedReader extends Reader { @@ -113,7 +114,7 @@ return result; } if (markpos == 0 && marklimit > buf.length) { - /* Increase buffer size to accomodate the readlimit */ + /* Increase buffer size to accommodate the readlimit */ int newLength = buf.length * 2; if (newLength > marklimit) newLength = marklimit; @@ -151,7 +152,7 @@ * * @param readlimit * an int representing how many characters must be read - * beforeinvalidating the mark. + * before invalidating the mark. * * @throws IOException * If an error occurs attempting mark this BufferedReader. @@ -310,7 +311,7 @@ synchronized (lock) { if (isOpen()) { char eol = '\0'; - StringBuffer result = new StringBuffer(80); + StringBuilder result = new StringBuilder(80); /* Typical Line Length */ while (true) { @@ -381,7 +382,7 @@ * this new location. If this Reader was not marked, throw IOException. * * @throws IOException - * If a problem occured, the receiver does not support + * If a problem occurred, the receiver does not support * mark()/reset(), or no mark has been set. */ Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?rev=409641&r1=409640&r2=409641&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Fri May 26 04:05:00 2006 @@ -1085,7 +1085,7 @@ int newInt = new java.util.Random().nextInt(); counter = ((newInt / 65535) & 0xFFFF) + 0x2710; } - StringBuffer newName = new StringBuffer(); + StringBuilder newName = new StringBuilder(); newName.append(prefix); newName.append(counter++); newName.append(suffix); @@ -1186,7 +1186,7 @@ if (!name.startsWith("/")) // On Windows, absolute paths might not //$NON-NLS-1$ // start with sep. return new URI("file", null, //$NON-NLS-1$ - new StringBuffer(name.length() + 1).append('/').append( + new StringBuilder(name.length() + 1).append('/').append( name).toString(), null, null); else if (name.startsWith("//")) //$NON-NLS-1$ return new URI("file", name, null); // UNC path //$NON-NLS-1$ @@ -1211,7 +1211,7 @@ String name = getAbsoluteName(); if (!name.startsWith("/")) // On Windows, absolute paths might not //$NON-NLS-1$ // start with sep. - return new URL("file", "", -1, new StringBuffer(name.length() + 1) //$NON-NLS-1$ //$NON-NLS-2$ + return new URL("file", "", -1, new StringBuilder(name.length() + 1) //$NON-NLS-1$ //$NON-NLS-2$ .append('/').append(name).toString(), null); else if (name.startsWith("//")) //$NON-NLS-1$ return new URL("file:" + name); // UNC path //$NON-NLS-1$ @@ -1226,7 +1226,7 @@ // with // a // slash - name = new StringBuffer(name.length() + 1).append(name).append('/') + name = new StringBuilder(name.length() + 1).append(name).append('/') .toString(); if (separatorChar != '/') // Must convert slashes. name = name.replace(separatorChar, '/'); Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java?rev=409641&r1=409640&r2=409641&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java Fri May 26 04:05:00 2006 @@ -125,7 +125,7 @@ int highestBitMask = 1 << (len - 1); // if a bit of mask is set, append the corresponding action to result - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); boolean addedItem = false; for (int i = 0; i < len; i++) { if ((highestBitMask & mask) != 0) { Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberReader.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberReader.java?rev=409641&r1=409640&r2=409641&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberReader.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberReader.java Fri May 26 04:05:00 2006 @@ -185,7 +185,7 @@ public String readLine() throws IOException { synchronized (lock) { /* Typical Line Length */ - StringBuffer result = new StringBuffer(80); + StringBuilder result = new StringBuilder(80); while (true) { int character = read(); if (character == -1) Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java?rev=409641&r1=409640&r2=409641&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java Fri May 26 04:05:00 2006 @@ -476,7 +476,7 @@ * error occurs. */ public final String readLine() throws IOException { - StringBuffer line = new StringBuffer(80); // Typical line length + StringBuilder line = new StringBuilder(80); // Typical line length boolean foundTerminator = false; long unreadPosition = 0; while (true) { Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java?rev=409641&r1=409640&r2=409641&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java Fri May 26 04:05:00 2006 @@ -301,7 +301,7 @@ * contained within words. */ if ((currentType & TOKEN_DIGIT) != 0) { - StringBuffer digits = new StringBuffer(20); + StringBuilder digits = new StringBuilder(20); boolean haveDecimal = false, checkJustNegative = currentChar == '-'; while (true) { if (currentChar == '.') @@ -567,7 +567,7 @@ */ public String toString() { // Values determined through experimentation - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); result.append("Token["); //$NON-NLS-1$ switch (ttype) { case TT_EOF: