Makefile.am: Removed java/io/Replaceable.java and java/io/Resolvable.java.

* Makefile.am: Removed java/io/Replaceable.java and
	java/io/Resolvable.java.
	* Makefile.in: Rebuilt.
	* gcj/javaprims.h: Removed Replaceable and Resolvable from java.io
	namespace.
	* java/io/ObjectInputStream.java (processResolution): Fixed typo
	in method name.
	(processResolution): Handle readResolve method via reflection with
	removal of Resolvable interface.
	* java/io/ObjectOutputStream.java (writeObject): Handle writeReplace
	method via reflection with removal of Replaceable interface.
	* java/io/Replaceable.java: Removed.
	* java/io/Resolvable.java: Removed.
	* java/security/Key.java (serialVersionUID): New field.
	* java/security/Provider.java (serialVersionUID): New field.
	* java/security/interfaces/DSAPrivateKey.java (serialVersionUID):
	New field.
	* java/security/interfaces/DSAPublicKey.java (serialVersionUID):
        New field.
	* java/sql/DataTruncation.java (serialVersionUID): New field.
	* java/sql/SQLException.java (serialVersionUID): New field.
	* java/sql/SQLWarning.java (serialVersionUID): New field.
	* java/util/Date.java (serialVersionUID): New field.
	(millis): Made transient.
	(readObject): New method.
	(writeObject): New method.

Serialization mods.
Note:  The interfaces java.io.Replaceable and java.io.Resolvable were only
temporary additions to JDK 1.2 beta versions and were not included
in the JDK 1.2 final.  The Serialization spec instructs how to deal
with their methods (via reflection).

From-SVN: r36736
This commit is contained in:
Warren Levy 2000-10-05 23:57:16 +00:00 committed by Warren Levy
parent cc0cbae17e
commit bf3478059d
16 changed files with 194 additions and 204 deletions

View File

@ -1,3 +1,32 @@
2000-10-05 Warren Levy <warrenl@cygnus.com>
* Makefile.am: Removed java/io/Replaceable.java and
java/io/Resolvable.java.
* Makefile.in: Rebuilt.
* gcj/javaprims.h: Removed Replaceable and Resolvable from java.io
namespace.
* java/io/ObjectInputStream.java (processResolution): Fixed typo
in method name.
(processResolution): Handle readResolve method via reflection with
removal of Resolvable interface.
* java/io/ObjectOutputStream.java (writeObject): Handle writeReplace
method via reflection with removal of Replaceable interface.
* java/io/Replaceable.java: Removed.
* java/io/Resolvable.java: Removed.
* java/security/Key.java (serialVersionUID): New field.
* java/security/Provider.java (serialVersionUID): New field.
* java/security/interfaces/DSAPrivateKey.java (serialVersionUID):
New field.
* java/security/interfaces/DSAPublicKey.java (serialVersionUID):
New field.
* java/sql/DataTruncation.java (serialVersionUID): New field.
* java/sql/SQLException.java (serialVersionUID): New field.
* java/sql/SQLWarning.java (serialVersionUID): New field.
* java/util/Date.java (serialVersionUID): New field.
(millis): Made transient.
(readObject): New method.
(writeObject): New method.
2000-10-05 Tom Tromey <tromey@cygnus.com>
* gnu/gcj/convert/natIconv.cc (init): Terminate buffer.

View File

@ -813,8 +813,6 @@ java/io/PushbackInputStream.java \
java/io/PushbackReader.java \
java/io/RandomAccessFile.java \
java/io/Reader.java \
java/io/Replaceable.java \
java/io/Resolvable.java \
java/io/SequenceInputStream.java \
java/io/Serializable.java \
java/io/SerializablePermission.java \

View File

@ -68,6 +68,7 @@ AR = @AR@
AS = @AS@
CC = @CC@
COMPPATH = @COMPPATH@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DIRLTDL = @DIRLTDL@
@ -78,8 +79,6 @@ EXEEXT = @EXEEXT@
FORCELIBGCCSPEC = @FORCELIBGCCSPEC@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
@ -96,11 +95,9 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PERL = @PERL@
RANLIB = @RANLIB@
STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
THREADDEPS = @THREADDEPS@
@ -118,40 +115,27 @@ here = @here@
libgcj_basedir = @libgcj_basedir@
AUTOMAKE_OPTIONS = foreign no-installinfo
@TESTSUBDIR_TRUE@SUBDIRS = \
@TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
@TESTSUBDIR_FALSE@SUBDIRS = \
@TESTSUBDIR_FALSE@$(DIRLTDL) gcj include
@USE_LIBDIR_TRUE@toolexeclibdir = \
@USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
@USE_LIBDIR_FALSE@toolexeclibdir = \
@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
@USE_LIBDIR_FALSE@toolexecdir = \
@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
@TESTSUBDIR_TRUE@SUBDIRS = @TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
@TESTSUBDIR_FALSE@SUBDIRS = @TESTSUBDIR_FALSE@$(DIRLTDL) gcj include
@USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
@USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
toolexeclib_LTLIBRARIES = libgcj.la
toolexeclib_DATA = libgcj.spec
data_DATA = libgcj.zip
@NEEDS_DATA_START_TRUE@toolexeclib_LIBRARIES = \
@NEEDS_DATA_START_TRUE@libgcjdata.a
@NEEDS_DATA_START_TRUE@libgcjdata_a_SOURCES = \
@NEEDS_DATA_START_TRUE@libgcjdata.c
@NEEDS_DATA_START_TRUE@toolexeclib_LIBRARIES = @NEEDS_DATA_START_TRUE@libgcjdata.a
@NEEDS_DATA_START_TRUE@libgcjdata_a_SOURCES = @NEEDS_DATA_START_TRUE@libgcjdata.c
@NATIVE_TRUE@bin_PROGRAMS = \
@NATIVE_TRUE@jv-convert gij
@NATIVE_TRUE@bin_PROGRAMS = @NATIVE_TRUE@jv-convert gij
bin_SCRIPTS = addr2name.awk
@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = \
@CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = \
@CANADIAN_TRUE@@NULL_TARGET_FALSE@zip
@CANADIAN_FALSE@ZIP = \
@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
@CANADIAN_TRUE@GCJH = \
@CANADIAN_TRUE@gcjh
@CANADIAN_FALSE@GCJH = \
@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_FALSE@zip
@CANADIAN_FALSE@ZIP = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
@CANADIAN_TRUE@GCJH = @CANADIAN_TRUE@gcjh
@CANADIAN_FALSE@GCJH = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
GCJCOMPILE = $(LIBTOOL) --mode=compile $(GCJ) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -c
GCJLINK = $(LIBTOOL) --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
@ -166,10 +150,8 @@ AM_CXXFLAGS = -fno-rtti -fvtable-thunks -fasynchronous-exceptions \
-fdollars-in-identifiers \
@LIBGCJ_CXXFLAGS@ @EXCEPTIONSPEC@ $(WARNINGS) -D_GNU_SOURCE
@USING_GCC_TRUE@AM_CFLAGS = \
@USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
@USING_GCC_FALSE@AM_CFLAGS = \
@USING_GCC_FALSE@@LIBGCJ_CFLAGS@
@USING_GCC_TRUE@AM_CFLAGS = @USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
@USING_GCC_FALSE@AM_CFLAGS = @USING_GCC_FALSE@@LIBGCJ_CFLAGS@
JCFLAGS = -g
JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
@ -221,8 +203,7 @@ extra_headers = java/lang/Object.h java/lang/Class.h
NM = nm
@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = \
@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@gen-from-JIS
@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = @NATIVE_TRUE@@MAINTAINER_MODE_TRUE@gen-from-JIS
CONVERT_DIR = gnu/gcj/convert
@ -596,8 +577,6 @@ java/io/PushbackInputStream.java \
java/io/PushbackReader.java \
java/io/RandomAccessFile.java \
java/io/Reader.java \
java/io/Replaceable.java \
java/io/Resolvable.java \
java/io/SequenceInputStream.java \
java/io/Serializable.java \
java/io/SerializablePermission.java \
@ -1015,7 +994,7 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libgcjdata_a_LIBADD =
@NEEDS_DATA_START_TRUE@libgcjdata_a_OBJECTS = libgcjdata.$(OBJEXT)
@NEEDS_DATA_START_TRUE@libgcjdata_a_OBJECTS = libgcjdata.o
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
libgcj_la_OBJECTS = prims.lo posix.lo jni.lo exception.lo resolve.lo \
@ -1026,7 +1005,7 @@ defineclass.lo interpret.lo name-finder.lo
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
jv_convert_OBJECTS =
gij_OBJECTS = gij.$(OBJEXT)
gij_OBJECTS = gij.o
gen_from_JIS_OBJECTS =
gen_from_JIS_LDFLAGS =
SCRIPTS = $(bin_SCRIPTS)
@ -1044,13 +1023,14 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DATA = $(data_DATA) $(toolexeclib_DATA)
DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
THANKS acinclude.m4 aclocal.m4 configure configure.in \
libgcj-test.spec.in libgcj.spec.in
THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \
include/config.h.in include/stamp-h.in libgcj-test.spec.in \
libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
@ -1282,8 +1262,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/io/PipedWriter.P .deps/java/io/PrintStream.P \
.deps/java/io/PrintWriter.P .deps/java/io/PushbackInputStream.P \
.deps/java/io/PushbackReader.P .deps/java/io/RandomAccessFile.P \
.deps/java/io/Reader.P .deps/java/io/Replaceable.P \
.deps/java/io/Resolvable.P .deps/java/io/SequenceInputStream.P \
.deps/java/io/Reader.P .deps/java/io/SequenceInputStream.P \
.deps/java/io/Serializable.P .deps/java/io/SerializablePermission.P \
.deps/java/io/StreamCorruptedException.P \
.deps/java/io/StreamTokenizer.P .deps/java/io/StringBufferInputStream.P \
@ -1504,7 +1483,7 @@ OBJECTS = $(libgcjdata_a_OBJECTS) $(libgcj_la_OBJECTS) $(jv_convert_OBJECTS) $(g
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .cc .class .h .java .lo .o .obj .s
.SUFFIXES: .S .c .cc .class .h .java .lo .o .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
@ -1519,6 +1498,34 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
include/config.h: include/stamp-h
@if test ! -f $@; then \
rm -f include/stamp-h; \
$(MAKE) include/stamp-h; \
else :; fi
include/stamp-h: $(srcdir)/include/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=include/config.h \
$(SHELL) ./config.status
@echo timestamp > include/stamp-h 2> /dev/null
$(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/include/stamp-h.in; \
$(MAKE) $(srcdir)/include/stamp-h.in; \
else :; fi
$(srcdir)/include/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/include/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f include/config.h
maintainer-clean-hdr:
libgcj.spec: $(top_builddir)/config.status libgcj.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
libgcj-test.spec: $(top_builddir)/config.status libgcj-test.spec.in
@ -1556,11 +1563,6 @@ uninstall-toolexeclibLIBRARIES:
rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
done
# FIXME: We should only use cygpath when building on Windows,
# and only if it is available.
.c.obj:
$(COMPILE) -c `cygpath -w $<`
.s.o:
$(COMPILE) -c $<
@ -1569,7 +1571,6 @@ uninstall-toolexeclibLIBRARIES:
mostlyclean-compile:
-rm -f *.o core *.core
-rm -f *.$(OBJEXT)
clean-compile:
@ -1693,8 +1694,6 @@ uninstall-binSCRIPTS:
done
.cc.o:
$(CXXCOMPILE) -c $<
.cc.obj:
$(CXXCOMPILE) -c `cygpath -w $<`
.cc.lo:
$(LTCXXCOMPILE) -c $<
@ -1871,7 +1870,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@ -1989,31 +1988,33 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-toolexeclibLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-toolexeclibLTLIBRARIES \
mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLIBRARIES \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-toolexeclibLTLIBRARIES \
mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-toolexeclibLIBRARIES clean-compile clean-libtool \
clean-toolexeclibLTLIBRARIES clean-binPROGRAMS \
clean-noinstPROGRAMS clean-tags clean-depend \
clean-generic mostlyclean-am clean-local
clean-am: clean-hdr clean-toolexeclibLIBRARIES clean-compile \
clean-libtool clean-toolexeclibLTLIBRARIES \
clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \
clean-depend clean-generic mostlyclean-am clean-local
clean: clean-recursive
distclean-am: distclean-toolexeclibLIBRARIES distclean-compile \
distclean-libtool distclean-toolexeclibLTLIBRARIES \
distclean-binPROGRAMS distclean-noinstPROGRAMS \
distclean-tags distclean-depend distclean-generic \
clean-am
distclean-am: distclean-hdr distclean-toolexeclibLIBRARIES \
distclean-compile distclean-libtool \
distclean-toolexeclibLTLIBRARIES distclean-binPROGRAMS \
distclean-noinstPROGRAMS distclean-tags \
distclean-depend distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-toolexeclibLIBRARIES \
maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean-toolexeclibLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-binPROGRAMS \
@ -2026,7 +2027,8 @@ maintainer-clean-am: maintainer-clean-toolexeclibLIBRARIES \
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-toolexeclibLIBRARIES distclean-toolexeclibLIBRARIES \
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
mostlyclean-toolexeclibLIBRARIES distclean-toolexeclibLIBRARIES \
clean-toolexeclibLIBRARIES maintainer-clean-toolexeclibLIBRARIES \
uninstall-toolexeclibLIBRARIES install-toolexeclibLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \

View File

@ -103,8 +103,6 @@ extern "Java"
class PushbackReader;
class RandomAccessFile;
class Reader;
class Replaceable;
class Resolvable;
class SequenceInputStream;
class Serializable;
class SerializablePermission;

View File

@ -1,5 +1,5 @@
/* ObjectInputStream.java -- Class used to read serialized objects
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -37,6 +37,7 @@ import gnu.java.io.ObjectIdentityWrapper;
import gnu.java.lang.reflect.TypeSignature;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
@ -189,7 +190,7 @@ public class ObjectInputStream extends InputStream
{
// DEBUG ("STRING ");
String s = this.realInputStream.readUTF ();
ret_val = processResoultion (s, assignNewHandle (s));
ret_val = processResolution (s, assignNewHandle (s));
break;
}
@ -202,7 +203,7 @@ public class ObjectInputStream extends InputStream
Object array = Array.newInstance (componenetType, length);
int handle = assignNewHandle (array);
readArrayElements (array, componenetType);
ret_val = processResoultion (array, handle);
ret_val = processResolution (array, handle);
break;
}
@ -250,7 +251,7 @@ public class ObjectInputStream extends InputStream
if (read_from_blocks)
setBlockDataMode (false);
ret_val = processResoultion (obj, handle);
ret_val = processResolution (obj, handle);
break;
} // end if (Externalizable.class.isAssignableFrom (clazz))
@ -315,7 +316,7 @@ public class ObjectInputStream extends InputStream
this.currentObject = null;
this.currentObjectStreamClass = null;
ret_val = processResoultion (obj, handle);
ret_val = processResolution (obj, handle);
break;
}
@ -937,11 +938,30 @@ public class ObjectInputStream extends InputStream
}
private Object processResoultion (Object obj, int handle)
private Object processResolution (Object obj, int handle)
throws IOException
{
if (obj instanceof Resolvable)
obj = ((Resolvable)obj).readResolve ();
if (obj instanceof Serializable)
{
Method m = null;
try
{
Class classArgs[] = {};
m = obj.getClass ().getDeclaredMethod ("readResolve", classArgs);
// m can't be null by definition since an exception would
// have been thrown so a check for null is not needed.
obj = m.invoke (obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
{
}
catch (IllegalAccessException ignore)
{
}
catch (InvocationTargetException ignore)
{
}
}
if (this.resolveEnabled)
obj = resolveObject (obj);

View File

@ -30,6 +30,7 @@ package java.io;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.util.Hashtable;
import gnu.java.io.ObjectIdentityWrapper;
@ -241,13 +242,33 @@ public class ObjectOutputStream extends OutputStream
Object replacedObject = null;
if ((replacementEnabled || obj instanceof Replaceable)
if ((replacementEnabled || obj instanceof Serializable)
&& ! replaceDone)
{
replacedObject = obj;
if (obj instanceof Replaceable)
obj = ((Replaceable)obj).writeReplace ();
if (obj instanceof Serializable)
{
Method m = null;
try
{
Class classArgs[] = {};
m = obj.getClass ().getDeclaredMethod ("writeReplace",
classArgs);
// m can't be null by definition since an exception would
// have been thrown so a check for null is not needed.
obj = m.invoke (obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
{
}
catch (IllegalAccessException ignore)
{
}
catch (InvocationTargetException ignore)
{
}
}
if (replacementEnabled)
obj = replaceObject (obj);

View File

@ -1,54 +0,0 @@
/* Replaceable.java -- Replace an object with another object
Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.io;
/**
* This interface is used to indicate that an object may want to have
* another object serialized instead of itself. It contains one method
* that is to be called when an object is to be serialized. That method
* is reponsible for returning the real object that should be serialized
* instead of object being queried.
*
* @version 0.0
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface Replaceable extends Serializable
{
/**
* This method returns the object that should be serialized instead of
* this object
*
* @return The real object that should be serialized
*/
public abstract Object
writeReplace();
} // interface Replaceable

View File

@ -1,52 +0,0 @@
/* Resolvable.java -- Returns an object to replace the one being de-serialized
Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.io;
/**
* This interface is implemented when an object wishes to return another
* object to replace it during de-serialization. It has one method that
* returns the object that should be used to replace the original object.
*
* @version 0.0
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface Resolvable extends Serializable
{
/**
* This method returns the object that should be used to replace the
* original object during de-serialization.
*
* @return The replacement object
*/
public abstract Object
readResolve();
} // interface Resolvable

View File

@ -20,8 +20,7 @@ import java.io.Serializable;
public interface Key extends Serializable
{
// FIXME: need to set this at some point when serialization is implemented.
// public static final long serialVersionUID = 0L;
public static final long serialVersionUID = 6603384152749567654L;
public String getAlgorithm();
public String getFormat();

View File

@ -1,5 +1,5 @@
/* Provider.java -- Security provider information
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -68,6 +68,8 @@ private String name;
*/
private double version;
private static final long serialVersionUID = -4298000515446427739L;
/*************************************************************************/
/*

View File

@ -21,8 +21,7 @@ import java.math.BigInteger;
public interface DSAPrivateKey extends DSAKey, PrivateKey
{
// FIXME: need to set this at some point when serialization is implemented.
// public static final long serialVersionUID = 0L;
public static final long serialVersionUID = 7776497482533790279L;
public BigInteger getX();
}

View File

@ -21,8 +21,7 @@ import java.math.BigInteger;
public interface DSAPublicKey extends DSAKey, PublicKey
{
// FIXME: need to set this at some point when serialization is implemented.
// public static final long serialVersionUID = 0L;
public static final long serialVersionUID = 1234526332779022332L;
public BigInteger getY();
}

View File

@ -1,5 +1,5 @@
/* DataTruncation.java -- Warning when data has been truncated.
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -72,6 +72,8 @@ private boolean read;
*/
private int transferSize;
private static final long serialVersionUID = 6464298989504059473L;
/*************************************************************************/
/*

View File

@ -1,5 +1,5 @@
/* SQLException.java -- General SQL exception
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -59,6 +59,8 @@ private String SQLState;
*/
private int vendorCode;
private static final long serialVersionUID = 2135244094396331484L;
/*************************************************************************/
/*

View File

@ -1,5 +1,5 @@
/* SQLWarning.java -- Database access warnings.
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -132,5 +132,7 @@ setNextWarning(SQLWarning e)
super.setNextException(e);
}
private static final long serialVersionUID = 3917336774604784856L;
} // class SQLWarning

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999 Free Software Foundation
/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
@ -18,13 +18,13 @@ import java.text.*;
* "The Java Language Specification", ISBN 0-201-63451-1,
* and O'Reilly's "Java in a Nutshell".
* Status: Need to re-write toString().
* Missing: ToGMTString and toLocaleString.
* Serialization spec: Specifies readObject/writeObject.
* Missing: ToGMTString.
*/
public class Date implements java.io.Serializable, Cloneable
{
private long millis;
private static final long serialVersionUID = 7523967970034938905L;
transient private long millis;
public Date() { millis = System.currentTimeMillis(); }
@ -480,4 +480,27 @@ public class Date implements java.io.Serializable, Cloneable
cal.set(year+1900, month, date, hours, minutes, seconds);
return cal.getTimeInMillis();
}
/**
* Reads an Object from the stream.
*/
private void readObject (java.io.ObjectInputStream input)
throws java.io.IOException, ClassNotFoundException
{
input.defaultReadObject ();
millis = input.readLong ();
}
/**
* Writes an Object to the stream.
* @serialdata A long value representing the offset from the epoch
* in milliseconds. This is the same value that is returned by the
* method getTime().
*/
private void writeObject (java.io.ObjectOutputStream output)
throws java.io.IOException
{
output.defaultWriteObject ();
output.writeLong (millis);
}
}