Imported GNU Classpath 0.90

Imported GNU Classpath 0.90
       * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
       * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
       * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
       * java/lang/Math.java: New override file.
       * java/lang/Character.java: Merged from Classpath.
       (start, end): Now 'int's.
       (canonicalName): New field.
       (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
       (UnicodeBlock): Added argument.
       (of): New overload.
       (forName): New method.
       Updated unicode blocks.
       (sets): Updated.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r111942
This commit is contained in:
Mark Wielaard
2006-03-10 21:46:48 +00:00
parent 27079765d0
commit 8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions
+1 -3
View File
@@ -193,10 +193,8 @@ public abstract class InputStream
*/
public int read(byte[] b, int off, int len) throws IOException
{
if (off < 0 || len < 0 || off + len > b.length)
if (off < 0 || len < 0 || b.length - off < len)
throw new IndexOutOfBoundsException();
if (b.length == 0)
return 0;
int i, ch;
@@ -1,5 +1,6 @@
/* InputStreamReader.java -- Reader than transforms bytes to chars
Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +39,7 @@ exception statement from your version. */
package java.io;
import gnu.classpath.SystemProperties;
import gnu.java.nio.charset.EncodingHelper;
import java.nio.ByteBuffer;
@@ -145,7 +147,7 @@ public class InputStreamReader extends Reader
this.in = in;
try
{
encoding = System.getProperty("file.encoding");
encoding = SystemProperties.getProperty("file.encoding");
// Don't use NIO if avoidable
if(EncodingHelper.isISOLatin1(encoding))
{
@@ -231,12 +233,20 @@ public class InputStreamReader extends Reader
* charset to decode the bytes in the InputStream into
* characters.
*
* @since 1.5
* @since 1.4
*/
public InputStreamReader(InputStream in, Charset charset) {
if (in == null)
throw new NullPointerException();
this.in = in;
decoder = charset.newDecoder();
try {
maxBytesPerChar = charset.newEncoder().maxBytesPerChar();
} catch(UnsupportedOperationException _){
maxBytesPerChar = 1f;
}
decoder.onMalformedInput(CodingErrorAction.REPLACE);
decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
decoder.reset();
@@ -247,9 +257,11 @@ public class InputStreamReader extends Reader
* Creates an InputStreamReader that uses the given charset decoder
* to decode the bytes in the InputStream into characters.
*
* @since 1.5
* @since 1.4
*/
public InputStreamReader(InputStream in, CharsetDecoder decoder) {
if (in == null)
throw new NullPointerException();
this.in = in;
this.decoder = decoder;
@@ -1,5 +1,5 @@
/* ObjectInputStream.java -- Class used to read serialized objects
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -555,8 +555,7 @@ public class ObjectInputStream extends InputStream
classLookupTable.put(clazz, osc);
setBlockDataMode(oldmode);
// find the first non-serializable, non-abstract
// class in clazz's inheritance hierarchy
// find the first non-serializable class in clazz's inheritance hierarchy
Class first_nonserial = clazz.getSuperclass();
// Maybe it is a primitive class, those don't have a super class,
// or Object itself. Otherwise we can keep getting the superclass
@@ -565,9 +564,8 @@ public class ObjectInputStream extends InputStream
if (first_nonserial == null)
first_nonserial = clazz;
else
while (Serializable.class.isAssignableFrom(first_nonserial)
|| Modifier.isAbstract(first_nonserial.getModifiers()))
first_nonserial = first_nonserial.getSuperclass();
while (Serializable.class.isAssignableFrom(first_nonserial))
first_nonserial = first_nonserial.getSuperclass();
final Class local_constructor_class = first_nonserial;
@@ -1596,7 +1594,14 @@ public class ObjectInputStream extends InputStream
private void readNextBlock() throws IOException
{
readNextBlock(this.realInputStream.readByte());
byte marker = this.realInputStream.readByte();
while (marker == TC_RESET)
{
if(dump) dumpElementln("RESET");
clearHandles();
marker = this.realInputStream.readByte();
}
readNextBlock(marker);
}
private void readNextBlock(byte marker) throws IOException
@@ -1,5 +1,5 @@
/* ObjectOutputStream.java -- Class used to write serialized objects
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -421,6 +421,8 @@ public class ObjectOutputStream extends OutputStream
for (int i = 0; i < intfs.length; i++)
realOutput.writeUTF(intfs[i].getName());
assignNewHandle(osc);
boolean oldmode = setBlockDataMode(true);
annotateProxyClass(osc.forClass());
setBlockDataMode(oldmode);