[kaffe] CVS kaffe (guilhem): Object serialization fix concerning final fields.

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Thu Mar 25 13:08:52 2004


PatchSet 4582 
Date: 2004/03/25 20:58:27
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Object serialization fix concerning final fields.

        * libraries/javalib/java/lang/reflect/Field.java
        (setChar, setByte, setShort, setInt, setLong, setFloat, setDouble,
        set): Splitted methods in two parts to be able to set final fields
        using a native call.

        * libraries/javalib/java/io/ObjectStreamField.java
        (setCharField, setByteField, setShortField, setLongField,
        setFloatField, setDoubleField, setObjectField): Call native methods.
        (setCharNative, setByteNative, setShortNative, setLongNative,
        setFloatNative, setDoubleNative, setObjectNative): New native calls.
	(ObjectStreamField): Deserialize final fields.

        * libraries/clib/native/ObjectInputStream: Updated copyright
        advertisement.

        * libraries/clib/native/ObjectStreamField.c: New file.

        * include/Makefile.am: Added java_io_ObjectStreamField.h

        * include/Makefile.in: Regenerated.

        * libraries/javalib/Klasses.jar.bootstrap: Regenerated.

Members: 
	ChangeLog:1.2160->1.2161 
	include/Makefile.am:1.53->1.54 
	include/Makefile.in:1.147->1.148 
	libraries/clib/native/Makefile.am:1.28->1.29 
	libraries/clib/native/Makefile.in:1.126->1.127 
	libraries/clib/native/ObjectInputStream.c:1.18->1.19 
	libraries/clib/native/ObjectStreamField.c:INITIAL->1.1 
	libraries/javalib/Klasses.jar.bootstrap:1.48->1.49 
	libraries/javalib/java/io/ObjectStreamField.java:1.9->1.10 
	libraries/javalib/java/lang/reflect/Field.java:1.14->1.15 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2160 kaffe/ChangeLog:1.2161
--- kaffe/ChangeLog:1.2160	Thu Mar 25 17:53:00 2004
+++ kaffe/ChangeLog	Thu Mar 25 20:58:27 2004
@@ -1,3 +1,28 @@
+2004-03-25  Guilhem Lavaux <guilhem@kaffe.org>
+
+	* libraries/javalib/java/lang/reflect/Field.java
+	(setChar, setByte, setShort, setInt, setLong, setFloat, setDouble,
+	set): Splitted methods in two parts to be able to set final fields
+	using a native call.
+
+	* libraries/javalib/java/io/ObjectStreamField.java
+	(setCharField, setByteField, setShortField, setLongField,
+	setFloatField, setDoubleField, setObjectField): Call native methods.
+	(setCharNative, setByteNative, setShortNative, setLongNative,
+	setFloatNative, setDoubleNative, setObjectNative): New native calls.
+	(ObjectStreamField): Deserialize final fields.
+
+	* libraries/clib/native/ObjectInputStream: Updated copyright
+	advertisement.
+
+	* libraries/clib/native/ObjectStreamField.c: New file.
+
+	* include/Makefile.am: Added java_io_ObjectStreamField.h
+
+	* include/Makefile.in: Regenerated.
+
+	* libraries/javalib/Klasses.jar.bootstrap: Regenerated.
+
 2004-03-25  Dalibor Topic <robilad@kaffe.org>
 
         * config/i386/jit3-i386.def,
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.53 kaffe/include/Makefile.am:1.54
--- kaffe/include/Makefile.am:1.53	Mon Feb  2 00:10:56 2004
+++ kaffe/include/Makefile.am	Thu Mar 25 20:58:29 2004
@@ -49,6 +49,7 @@
 	java_io_InputStream.h \
 	java_io_InterruptedIOException.h \
 	java_io_ObjectInputStream.h \
+	java_io_ObjectStreamField.h \
 	java_io_PrintStream.h \
 	java_io_RandomAccessFile.h \
 	java_lang_Boolean.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.147 kaffe/include/Makefile.in:1.148
--- kaffe/include/Makefile.in:1.147	Wed Mar 24 18:07:16 2004
+++ kaffe/include/Makefile.in	Thu Mar 25 20:58:29 2004
@@ -352,6 +352,7 @@
 	java_io_InputStream.h \
 	java_io_InterruptedIOException.h \
 	java_io_ObjectInputStream.h \
+	java_io_ObjectStreamField.h \
 	java_io_PrintStream.h \
 	java_io_RandomAccessFile.h \
 	java_lang_Boolean.h \
Index: kaffe/libraries/clib/native/Makefile.am
diff -u kaffe/libraries/clib/native/Makefile.am:1.28 kaffe/libraries/clib/native/Makefile.am:1.29
--- kaffe/libraries/clib/native/Makefile.am:1.28	Thu Jan 15 02:29:44 2004
+++ kaffe/libraries/clib/native/Makefile.am	Thu Mar 25 20:58:30 2004
@@ -15,7 +15,8 @@
 		ByteToCharIconv.c \
 		CharToByteDefault.c \
 		CharToByteIconv.c \
-		ObjectInputStream.c
+		ObjectInputStream.c \
+		ObjectStreamField.c
 
 LANG_SRCS = \
 		Class.c \
Index: kaffe/libraries/clib/native/Makefile.in
diff -u kaffe/libraries/clib/native/Makefile.in:1.126 kaffe/libraries/clib/native/Makefile.in:1.127
--- kaffe/libraries/clib/native/Makefile.in:1.126	Wed Mar 24 18:07:30 2004
+++ kaffe/libraries/clib/native/Makefile.in	Thu Mar 25 20:58:30 2004
@@ -73,7 +73,8 @@
 libnative_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1)
 am__objects_1 = ByteToCharDefault.lo ByteToCharIconv.lo \
-	CharToByteDefault.lo CharToByteIconv.lo ObjectInputStream.lo
+	CharToByteDefault.lo CharToByteIconv.lo ObjectInputStream.lo \
+	ObjectStreamField.lo
 am__objects_2 = Class.lo ClassLoader.lo Compiler.lo Double.lo Float.lo \
 	Math.lo MemoryAdvice.lo NativeLibrary.lo Object.lo \
 	PrimordialClassLoader.lo Runtime.lo String.lo System.lo \
@@ -105,6 +106,7 @@
 @AMDEP_TRUE@	./$(DEPDIR)/NativeLibrary.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/Object.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/ObjectInputStream.Plo \
+@AMDEP_TRUE@	./$(DEPDIR)/ObjectStreamField.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/PrimordialClassLoader.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/Runtime.Plo ./$(DEPDIR)/String.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/System.Plo ./$(DEPDIR)/TestNative.Plo \
@@ -362,7 +364,8 @@
 		ByteToCharIconv.c \
 		CharToByteDefault.c \
 		CharToByteIconv.c \
-		ObjectInputStream.c
+		ObjectInputStream.c \
+		ObjectStreamField.c
 
 LANG_SRCS = \
 		Class.c \
@@ -498,6 +501,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NativeLibrary.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Object.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ObjectInputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ObjectStreamField.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PrimordialClassLoader.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Runtime.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/String.Plo@am__quote@
Index: kaffe/libraries/clib/native/ObjectInputStream.c
diff -u kaffe/libraries/clib/native/ObjectInputStream.c:1.18 kaffe/libraries/clib/native/ObjectInputStream.c:1.19
--- kaffe/libraries/clib/native/ObjectInputStream.c:1.18	Tue Feb 10 12:31:15 2004
+++ kaffe/libraries/clib/native/ObjectInputStream.c	Thu Mar 25 20:58:30 2004
@@ -1,5 +1,10 @@
 /*
- * Copyright (C) 2003, 2004 Kaffe Team.
+ * ObjectInputStream.c
+ * 
+ * Copyright (C) 2003, 2004 Kaffe.org's team. 
+ *
+ * See "licence.terms" for information on usage and redistribution 
+ * of this file.
  */
 #include "config.h"
 #include "config-std.h"
===================================================================
Checking out kaffe/libraries/clib/native/ObjectStreamField.c
RCS:  /home/cvs/kaffe/kaffe/libraries/clib/native/ObjectStreamField.c,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/clib/native/ObjectStreamField.c	Thu Mar 25 21:01:35 2004
@@ -0,0 +1,105 @@
+/*
+ * ObjectInputStream.c
+ * 
+ * Copyright (C) 2003, 2004 Kaffe.org's team. 
+ *
+ * See "licence.terms" for information on usage and redistribution 
+ * of this file.
+ */
+#include "config.h"
+#include "config-std.h"
+#include <kaffe/jtypes.h>
+#include <native.h>
+#include "java_io_ObjectStreamField.h"
+#include "../../../kaffe/kaffevm/object.h"
+#include "../../../kaffe/kaffevm/support.h"
+
+void java_io_ObjectStreamField_setBooleanNative
+                (struct Hjava_io_ObjectStreamField* sfield,
+		 struct Hjava_lang_Object* obj, 
+		 jboolean value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setBooleanInternal",
+			 "(Ljava/lang/Object;Z)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setByteNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jbyte value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setByteInternal",
+			 "(Ljava/lang/Object;B)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setCharNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jchar value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setCharInternal",
+			 "(Ljava/lang/Object;B)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setShortNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jshort value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setShortInternal",
+			 "(Ljava/lang/Object;S)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setIntNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jint value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setIntInternal",
+			 "(Ljava/lang/Object;I)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setLongNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jlong value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setLongInternal",
+			 "(Ljava/lang/Object;J)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setFloatNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jfloat value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setFloatInternal",
+			 "(Ljava/lang/Object;F)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setDoubleNative
+                (struct Hjava_io_ObjectStreamField* sfield, 
+		 struct Hjava_lang_Object* obj,
+		 jdouble value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setDoubleInternal",
+			 "(Ljava/lang/Object;D)V",
+			 0, false, obj, value);
+}
+
+void java_io_ObjectStreamField_setObjectNative
+                (struct Hjava_io_ObjectStreamField* sfield,
+		 struct Hjava_lang_Object* obj, 
+		 struct Hjava_lang_Object* value)
+{
+  do_execute_java_method(unhand(sfield)->field, "setInternal",
+			 "(Ljava/lang/Object;Ljava/lang/Object;)V",
+			 0, false, obj, value);
+}
Index: kaffe/libraries/javalib/Klasses.jar.bootstrap
cvs rdiff: failed to read diff file header /tmp/cvsHOotAA for Klasses.jar.bootstrap,v: end of file
system command returned non-zero exit status: 1: aborting