This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FYI: Patch: java.io.ObjectInputStream


>>>>> "Michael" == Michael Koch <konqueror@gmx.de> writes:

Michael> 2004-02-06  Michael Koch  <konqueror@gmx.de>
Michael> 	* java/io/ObjectInputStream.java
Michael> 	(currentClassLoader): Reverted to old version of this method.

Could you try the appended?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/io/natObjectInputStream.cc (currentClassLoader): New
	method.
	* java/io/ObjectInputStream.java (currentClassLoader): Now native
	again.

Index: java/io/ObjectInputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/ObjectInputStream.java,v
retrieving revision 1.27
diff -u -r1.27 ObjectInputStream.java
--- java/io/ObjectInputStream.java 6 Feb 2004 14:05:37 -0000 1.27
+++ java/io/ObjectInputStream.java 10 Feb 2004 19:10:06 -0000
@@ -1,5 +1,5 @@
 /* ObjectInputStream.java -- Class used to read serialized objects
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -1737,11 +1737,7 @@
    * @param sm SecurityManager instance which should be called.
    * @return The current class loader in the calling stack.
    */
-  private static ClassLoader currentClassLoader (SecurityManager sm)
-  {
-    // FIXME: This is too simple.
-    return ClassLoader.getSystemClassLoader ();
-  }
+  private static native ClassLoader currentClassLoader (SecurityManager sm);
 
   private void callReadMethod (Method readObject, Class klass, Object obj) throws IOException
   {
Index: java/io/natObjectInputStream.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natObjectInputStream.cc,v
retrieving revision 1.6
diff -u -r1.6 natObjectInputStream.cc
--- java/io/natObjectInputStream.cc 28 Feb 2003 11:38:56 -0000 1.6
+++ java/io/natObjectInputStream.cc 10 Feb 2004 19:10:06 -0000
@@ -1,6 +1,6 @@
 // natObjectInputStream.cc - Native part of ObjectInputStream class.
 
-/* Copyright (C) 1998, 1999, 2000, 2001  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2004  Free Software Foundation
 
    This ObjectInputStream is part of libgcj.
 
@@ -19,11 +19,19 @@
 #include <java/lang/Class.h>
 #include <java/lang/reflect/Modifier.h>
 #include <java/lang/reflect/Method.h>
+#include <java/lang/ClassLoader.h>
+#include <java/lang/SecurityManager.h>
 
 #ifdef DEBUG
 #include <java/lang/System.h>
 #include <java/io/PrintStream.h>
 #endif
+
+java::lang::ClassLoader *
+java::io::ObjectInputStream::currentClassLoader (java::lang::SecurityManager *sm)
+{
+  return sm->currentClassLoader();
+}
 
 jobject
 java::io::ObjectInputStream::allocateObject (jclass klass)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]