harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
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 GMT
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 <code>file.java</code>.
  * 
  * @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
 	 *             <code>mark()/reset()</code>, 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:



Mime
View raw message