* java/io/PipedInputStream.java
(read): Make sure a positive byte value is returned. Revised javadoc.
Thanks to Olafur Bragason for reporting these bugs.
From-SVN: r97416
2005-03-09 David Daney <ddaney@avtrex.com>
PR libgcj/20389
Merge BufferedInputStream from GNU Classpath.
* java/io/BufferedInputStream.java (marktarget): Field removed.
(CHUNKSIZE): Field removed.
(bufferSize): New field.
(BufferedInputStream): Initialize fields.
(close): Invalidate mark and buffer indexes.
(mark): Rewritten.
(read()): Move mark handling code to refill.
(read(byte[], int, int)): Ditto.
(skip): Ditto and simplify EOF testing.
(refill): Rewritten.
* java/io/InputStreamReader.java (refill): Removed mark and reset
of internal BufferedInputStream.
From-SVN: r96217
2005-02-21 Bryce McKinlay <mckinlay@redhat.com>
Merge serialization from GNU Classpath.
* gcj/method.h: Add missing #includes.
* java/io/ObjectInputStream.java (readClassDescriptor): Check for
primitive class IDs on the stream here...
(resolveClass): ...not here.
* java/io/ObjectStreamField.java: Use VMObjectStream class calls to set
fields.
* java/io/VMObjectStreamClass.java (setDoubleNative, setFloatNative,
setLongNative, setIntNative, setShortNative, setCharNative,
setByteNative, setBooleanNative, setObjectNative): New native methods.
* java/io/natVMObjectStreamClass.java (setDoubleNative, setFloatNative,
setLongNative, setIntNative, setShortNative, setCharNative,
setByteNative, setBooleanNative, setObjectNative): Implement them.
* java/io/natObjectInputStream.cc (allocateObject): Add new parameters
from Classpath's version. Use _Jv_FromReflectedConstructor(). Call
the constructor here.
(callConstructor): Removed.
(getCallersClassLoader): Removed.
* java/lang/reflect/Field.java (setByte, setShort, setInt, setLong,
setFloat, setDouble, setChar, setBoolean): Add 'checkFinal' parameter
to control whether setting final field values is permitted. Call
getAddr() with checkFinal parameter instead of setAddr().
* java/lang/reflect/natField.cc (getType): Lookup and resolve field
only if not done already.
(getAddr): Add checkFinal parameter. Do the final field check only if
checkFinal is set.
(setAddr): Removed.
2005-02-21 Mark Wielaard <mark@klomp.org>
# Fixes bug #11957
* java/io/ObjectInputStream.java (resolveClass): Don't check "void"
twice.
2005-02-21 Mark Wielaard <mark@klomp.org>
Fixes bug #11618.
* java/io/ObjectInputStream.java (readClassDescriptor): Handle classes
without a super class and us ObjectStreamClass.lookupForClassObject().
(resolveClass): Check for primitive types.
(lookupClass): Return null when argument is null.
2005-02-21 Jeroen Frijters <jeroen@frijters.net>
* java/io/ObjectInputStream.java
(readObject): Fix to consume TC_ENDBLOCKDATA after readExternal.
2005-02-21 Jeroen Frijters <jeroen@frijters.net>
* java/io/ObjectOutputStream.java
(writeObject, callWriteMethod): Replaced reflection with accessing
cached info in ObjectStreamClass.
(getMethod): Removed.
* java/io/ObjectStreamClass.java
(findMethod): Added check to make sure the method found has the
right modifiers.
(cacheMethods): Added writeReplace and writeObject methods.
(setFlags): Look at new writeObjectMethod field instead of doing
reflection again.
(writeReplaceMethod): New field.
(writeObjectMethod): New field.
2005-02-21 Guilhem Lavaux <guilhem@kaffe.org>
Jeroen Frijters <jeroen@frijters.net>
* java/io/ObjectInputStream.java
(newObject): Changed prototype. Get a constructor reflect object
directly.
(callConstructor): Removed.
(allocateObject): Changed prototype.
(readClassDescriptor): Build the constructor reflection directly.
(readObject): Invoke newObject using the new prototype.
* java/io/ObjectStreamClass.java
(firstNonSerializableParent): Removed.
(firstNonSerializableParentConstructor): Added.
From-SVN: r95378
2005-02-20 Dalibor Topic <robilad@kaffe.org>
* libraries/javalib/gnu/regexp/RE.java,
libraries/javalib/java/io/ObjectInputStream.java,
libraries/javalib/java/security/AllPermission.java,
libraries/javalib/java/security/BasicPermission.java,
libraries/javalib/java/security/Permissions.java,
libraries/javalib/java/text/MessageFormat.java:
Made 'inner' classes real public static inner classes,
and made them final where possible, or removed them
where unused.
From-SVN: r95310
PR libgcj/18840:
* java/io/BufferedInputStream.java (read): Repeatedly read to
fill buffer.
(refill): Change test to see if buffer must be grown.
From-SVN: r93192
* java/io/Vector.java
(writeObject): New function to serialized output thread safe.
* java/io/ObjectOutputStream.java
(writeObject): Move the assignment of the class handle to after
the assignment of class descriptor handle.
From-SVN: r90175
2004-09-24 Jeroen Frijters <jeroen@frijters.net>
* java/io/ObjectInputStream.java (readObject): Delegate instantation
of Externalizable classes to ObjectStreamClass.
* java/io/ObjectStreamClass.java (newInstance): New method to
instantiate Externalizable (while ignoring the accessibility of
the constructor). (constructor): New field to cache the constructor.
From-SVN: r88019
2004-09-09 Jeroen Frijters <jeroen@frijters.net>
(normalizePath): Added special case for windows systems.
2004-09-09 Michael Koch <konqueror@gmx.de>
* java/io/File.java
(dupSeparator): Made private.
(File(URI)): New constructor.
(getParentFile): Fixed javadoc.
(createTempFile): Reformated.
(setReadOnly): Added comment.
(deleteOnExit): Merged javadoc with classpath version.
From-SVN: r87225
2004-07-23 Bryce McKinlay <mckinlay@redhat.com>
* gnu/java/net/protocol/http/Connection.java: Use GetPropertyAction
for privileged getProperty calls.
* java/io/ObjectOutputStream.java (getField): No longer static. Use
SetAccessibleAction instead of anonymous class for doPrivileged
call.
(getMethod): Likewise.
(setAccessible): New field. PrivilegedAction object to use when
calling setAccessible.
* java/io/ObjectStreamClass.java (calculateOffsets): Use
SetAccessibleAction instead of anonymous class for diPrivileged
call.
(setFields): Likewise.
(getClassUID): Likewise.
(findMethod): Likewise.
* gnu/java/security/action/GetPropertyAction.java: New class.
* gnu/java/security/action/SetAccessibleAction.java: New class.
From-SVN: r85097
2004-07-17 Mark Wielaard <mark@klomp.org>
* gnu/java/nio/channels/FileChannelImpl.java (truncate): Only truncate
when size is smaller.
* java/io/RandomAccessFile.java (setLength): Use truncate for
shrinking the file and seek plus write for expanding the file.
2004-07-17 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/channels/natFileChannelPosix.cc
(implTruncate): Always save current position. Only reposition file
pointer to where we started if not beyond new lenght. Reposition file
pointer to file length if it points beyond the end of file.
From-SVN: r84868
2004-07-09 Michael Koch <konqueror@gmx.de>
* java/io/ObjectInputStream.java (readFields): Use long datatype
when shifting byte values more then 24 bits left.
From-SVN: r84382
2004-06-21 Andrew Haley <aph@redhat.com>
* java/io/ObjectOutputStream.java: Add DEBUG statements
everywhere.
(dumpElementln): New method.
(depth): New field.
* java/io/ObjectInputStream.java
(currentClassLoader): Make native.
(callersClassLoader): New field.
(depth): New field.
(readObject): ENDBLOCKDATA is generated if the class has a write
method, not if it has a read method.
(readObject): Save and restore this.currentObject and
this.currentObjectStreamClass around calls to callReadMethod().
* java/io/natObjectInputStream.cc (getCallersClassLoader): New
method.
From-SVN: r83440
2004-05-31 Michael Koch <konqueror@gmx.de>
* java/io/SequenceInputStream.java:
Rename enum to e because enum is a keyword in Java 1.5.
From-SVN: r82479