GNU Classpath merge.

2002-10-31  Stephen Crawley  <crawley@dstc.edu.au>

	* java/lang/Double.java (valueOf): Return new Double(parseDouble(s)).

2002-10-31  Wu Gansha <gansha.wu@intel.com>:

        * java/util/ArrayList.java (readObject, writeObject): Only read/write
        size items.

2002-10-31  Wu Gansha <gansha.wu@intel.com>:

        * java/io/DataInputStream.java (convertFromUTF): Give StringBuffer an
        initial estimated size to avoid enlarge buffer frequently.

2002-10-31  Wu Gansha <gansha.wu@intel.com>:

	* java/lang/reflect/Proxy.java (ProxyType): Set loader to System
	ClassLoader when null.
	(ProxyType.hashCode): Loader null check no longer needed.
	(ProxyType.sameTypes): New method.
	(ProxyType.equals): Use new method.

2002-10-31  Mark Wielaard  <mark@klomp.org>

        * java/net/URLDecoder.java (decode): Initialize Stringbuffer size to
	length of String.
	* java/net/URLEncoder.java (encode): Likewise.

2002-10-31  Mark Wielaard  <mark@klomp.org>

	* java/util/zip/ZipInputStream.java (getNextEntry): Throw IOException
	when stream is closed.
	(closeEntry): Likewise.
	(read): Likewise.
	* java/util/zip/ZipOutputStream.java (putNextEntry): Throw
	ZipException when no entry active.
	(closeEntry): Likewise.
	(write): Likewise.

From-SVN: r58772
This commit is contained in:
Mark Wielaard 2002-11-03 20:27:31 +00:00
parent c33c471beb
commit de36f65dd1
9 changed files with 109 additions and 32 deletions

View file

@ -558,7 +558,9 @@ public class ArrayList extends AbstractList
// We serialize unused list entries to preserve capacity.
int len = data.length;
s.writeInt(len);
for (int i = 0; i < len; i++)
// it would be more efficient to just write "size" items,
// this need readObject read "size" items too.
for (int i = 0; i < size; i++)
s.writeObject(data[i]);
}
@ -578,7 +580,7 @@ public class ArrayList extends AbstractList
s.defaultReadObject();
int capacity = s.readInt();
data = new Object[capacity];
for (int i = 0; i < capacity; i++)
for (int i = 0; i < size; i++)
data[i] = s.readObject();
}
}