Patch: FYI: Merge in Classpath 0.18
Tom Tromey
tromey@redhat.com
Fri Sep 23 21:28:00 GMT 2005
I'm checking this in.
This finishes the import of GNU Classpath 0.18.
A few changes were needed here and there to get things to compile.
Thanks to Tom Fitzsimmons for writing most of the patches a while
back.
Note that this message doesn't include all the changes in
gcc/libjava/classpath/.
I built and tested this on x86 FC2. Please report any problems and I
will fix them ASAP.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
Imported Classpath 0.18.
* sources.am, Makefile.in: Updated.
* Makefile.am (nat_source_files): Removed natProxy.cc.
* java/lang/reflect/natProxy.cc: Removed.
* gnu/classpath/jdwp/VMFrame.java,
gnu/classpath/jdwp/VMIdManager.java,
gnu/classpath/jdwp/VMVirtualMachine.java,
java/lang/reflect/VMProxy.java: New files.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC
list.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/net/DefaultContentHandlerFactory.java (getContent):
Remove ClasspathToolkit references.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/awt/xlib/XCanvasPeer.java: Add new peer methods.
* gnu/awt/xlib/XFramePeer.java: Likewise.
* gnu/awt/xlib/XGraphicsConfiguration.java: Likewise.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add
classpath/native/jawt/jawt.c.
* Makefile.in: Regenerate.
* jawt.c: Remove file.
* include/Makefile.am (tool_include__HEADERS): Remove jawt.h and
jawt_md.h. Add ../classpath/include/jawt.h and
../classpath/include/jawt_md.h.
* include/Makefile.in: Regenerate.
* include/jawt.h: Regenerate.
* include/jawt_md.h: Regenerate.
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.500
diff -u -r1.500 Makefile.am
--- Makefile.am 23 Aug 2005 16:54:24 -0000 1.500
+++ Makefile.am 23 Sep 2005 21:23:16 -0000
@@ -263,7 +263,7 @@
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK)
-libgcjawt_la_SOURCES = jawt.c
+libgcjawt_la_SOURCES = classpath/native/jawt/jawt.c
libgcjawt_la_CFLAGS = -I$(srcdir)/classpath/native/jni/classpath \
$(PEDANTIC_CFLAGS) $(X_CFLAGS)
## See jv_convert_LDADD.
@@ -809,7 +809,6 @@
java/lang/reflect/natConstructor.cc \
java/lang/reflect/natField.cc \
java/lang/reflect/natMethod.cc \
-java/lang/reflect/natProxy.cc \
java/net/natVMNetworkInterface.cc \
java/net/natInetAddress.cc \
java/nio/channels/natChannels.cc \
Index: jawt.c
===================================================================
RCS file: jawt.c
diff -N jawt.c
--- jawt.c 30 Jun 2005 03:18:31 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,178 +0,0 @@
-/* jawt.c -- X11 implementation of the AWT Native Interface
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
-
-#include <stdlib.h>
-#include <jni.h>
-#include <jawt.h>
-#include <jawt_md.h>
-#include "classpath_jawt.h"
-
-static jint (JNICALL _Jv_Lock) (JAWT_DrawingSurface* surface);
-static void (JNICALL _Jv_Unlock) (JAWT_DrawingSurface* surface);
-static JAWT_DrawingSurfaceInfo* (JNICALL _Jv_GetDrawingSurfaceInfo)
- (JAWT_DrawingSurface* surface);
-static void (JNICALL _Jv_FreeDrawingSurfaceInfo)
- (JAWT_DrawingSurfaceInfo* surface_info);
-static JAWT_DrawingSurface* (JNICALL _Jv_GetDrawingSurface) (JNIEnv* env,
- jobject canvas);
-static void (JNICALL _Jv_FreeDrawingSurface) (JAWT_DrawingSurface* surface);
-static void (JNICALL _Jv_AWTLock) (JNIEnv*);
-static void (JNICALL _Jv_AWTUnlock) (JNIEnv*);
-
-JNIEXPORT jboolean JNICALL
-JAWT_GetAWT (JNIEnv* env, JAWT* awt)
-{
- jint retrieved_version;
-
- retrieved_version = classpath_jawt_get_awt_version ();
-
- if (awt->version > retrieved_version)
- return JNI_FALSE;
-
- awt->GetDrawingSurface = _Jv_GetDrawingSurface;
- awt->FreeDrawingSurface = _Jv_FreeDrawingSurface;
- awt->Lock = _Jv_AWTLock;
- awt->Unlock = _Jv_AWTUnlock;
-
- return JNI_TRUE;
-}
-
-/* JAWT_DrawingSurface functions */
-
-static jint
-(JNICALL _Jv_Lock) (JAWT_DrawingSurface* surface)
-{
- return classpath_jawt_object_lock (surface->lock);
-}
-
-static void
-(JNICALL _Jv_Unlock) (JAWT_DrawingSurface* surface)
-{
- classpath_jawt_object_unlock (surface->lock);
-}
-
-static JAWT_DrawingSurfaceInfo*
-(JNICALL _Jv_GetDrawingSurfaceInfo) (JAWT_DrawingSurface* surface)
-{
- if (surface == NULL)
- return NULL;
-
- return surface->surface_info;
-}
-
-static void
-(JNICALL _Jv_FreeDrawingSurfaceInfo) (JAWT_DrawingSurfaceInfo* surface_info)
-{
- JAWT_X11DrawingSurfaceInfo* surface_info_x11;
-
- if (surface_info == NULL)
- return;
-
- surface_info_x11 = (JAWT_X11DrawingSurfaceInfo*) surface_info->platformInfo;
-
- surface_info_x11->display = NULL;
- surface_info_x11->drawable = 0;
- surface_info_x11->visualID = 0;
-
- free (surface_info->platformInfo);
- free (surface_info);
- surface_info = NULL;
-}
-
-/* JAWT functions */
-
-static JAWT_DrawingSurface*
-(JNICALL _Jv_GetDrawingSurface) (JNIEnv* env, jobject canvas)
-{
- JAWT_DrawingSurface* surface;
- JAWT_X11DrawingSurfaceInfo* surface_info_x11;
-
- surface = (JAWT_DrawingSurface*) malloc (sizeof (JAWT_DrawingSurface));
-
- if (surface == NULL)
- return NULL;
-
- /* initialize function pointers */
- surface->GetDrawingSurfaceInfo = _Jv_GetDrawingSurfaceInfo;
- surface->FreeDrawingSurfaceInfo = _Jv_FreeDrawingSurfaceInfo;
-
- surface->Lock = _Jv_Lock;
- surface->Unlock = _Jv_Unlock;
-
- surface->surface_info = (JAWT_DrawingSurfaceInfo*) malloc (sizeof (JAWT_DrawingSurfaceInfo));
-
- surface->lock = classpath_jawt_create_lock ();
-
- if (surface->surface_info == NULL)
- return NULL;
-
- surface->surface_info->platformInfo = malloc (sizeof (JAWT_X11DrawingSurfaceInfo));
-
- if (surface->surface_info->platformInfo == NULL)
- return NULL;
-
- surface_info_x11 = (JAWT_X11DrawingSurfaceInfo*) surface->surface_info->platformInfo;
-
- surface_info_x11->display = classpath_jawt_get_default_display (env, canvas);
- surface_info_x11->drawable = classpath_jawt_get_drawable (env, canvas);
- surface_info_x11->visualID = classpath_jawt_get_visualID (env, canvas);
-
- /* FIXME: also include bounding rectangle of drawing surface */
- /* FIXME: also include current clipping region */
-
- return surface;
-}
-
-static void
-(JNICALL _Jv_FreeDrawingSurface) (JAWT_DrawingSurface* surface)
-{
- classpath_jawt_destroy_lock (surface->lock);
- free (surface);
-}
-
-static void
-(JNICALL _Jv_AWTLock) (JNIEnv* env)
-{
- classpath_jawt_lock ();
-}
-
-static void
-(JNICALL _Jv_AWTUnlock) (JNIEnv* env)
-{
- classpath_jawt_unlock ();
-}
-
Index: gnu/awt/xlib/XCanvasPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/awt/xlib/XCanvasPeer.java,v
retrieving revision 1.9
diff -u -r1.9 XCanvasPeer.java
--- gnu/awt/xlib/XCanvasPeer.java 15 Jul 2005 16:07:17 -0000 1.9
+++ gnu/awt/xlib/XCanvasPeer.java 23 Sep 2005 21:23:26 -0000
@@ -527,5 +527,63 @@
window.map();
}
}
-}
+ /**
+ * @since 1.5
+ */
+ public boolean isRestackSupported ()
+ {
+ return false;
+ }
+
+ /**
+ * @since 1.5
+ */
+ public void cancelPendingPaint (int x, int y, int width, int height)
+ {
+ }
+
+ /**
+ * @since 1.5
+ */
+ public void restack ()
+ {
+ }
+
+ /**
+ * @since 1.5
+ */
+ public Rectangle getBounds ()
+ {
+ return null;
+ }
+
+ /**
+ * @since 1.5
+ */
+ public void reparent (ContainerPeer parent)
+ {
+ }
+
+ /**
+ * @since 1.5
+ */
+ public void setBounds (int x, int y, int width, int height, int z)
+ {
+ }
+
+ /**
+ * @since 1.5
+ */
+ public boolean isReparentSupported ()
+ {
+ return false;
+ }
+
+ /**
+ * @since 1.5
+ */
+ public void layout ()
+ {
+ }
+}
Index: gnu/awt/xlib/XFramePeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/awt/xlib/XFramePeer.java,v
retrieving revision 1.5
diff -u -r1.5 XFramePeer.java
--- gnu/awt/xlib/XFramePeer.java 15 Jul 2005 16:07:18 -0000 1.5
+++ gnu/awt/xlib/XFramePeer.java 23 Sep 2005 21:23:26 -0000
@@ -190,4 +190,26 @@
public void beginLayout () { }
public void endLayout () { }
public boolean isPaintPending () { return false; }
+
+ /**
+ * @since 1.5
+ */
+ public void setBoundsPrivate (int x, int y, int width, int height)
+ {
+ }
+
+ /**
+ * @since 1.5
+ */
+ public void updateAlwaysOnTop()
+ {
+ }
+
+ /**
+ * @since 1.5
+ */
+ public boolean requestWindowFocus ()
+ {
+ return false;
+ }
}
Index: gnu/awt/xlib/XGraphicsConfiguration.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/awt/xlib/XGraphicsConfiguration.java,v
retrieving revision 1.7
diff -u -r1.7 XGraphicsConfiguration.java
--- gnu/awt/xlib/XGraphicsConfiguration.java 15 Jul 2005 16:07:18 -0000 1.7
+++ gnu/awt/xlib/XGraphicsConfiguration.java 23 Sep 2005 21:23:26 -0000
@@ -538,4 +538,13 @@
}
return cm.getDataElement (unnormalizedComponents, 0);
}
+
+ /**
+ * @since 1.5
+ */
+ public VolatileImage createCompatibleVolatileImage (int width, int height,
+ int transparency)
+ {
+ return null;
+ }
}
Index: gnu/classpath/jdwp/VMFrame.java
===================================================================
RCS file: gnu/classpath/jdwp/VMFrame.java
diff -N gnu/classpath/jdwp/VMFrame.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/classpath/jdwp/VMFrame.java 23 Sep 2005 21:23:26 -0000
@@ -0,0 +1,101 @@
+/* VMFrame.java -- Reference implementation of VM hooks for JDWP Frame access.
+ Copyright (C) 2005 Free Software Foundation
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.jdwp;
+
+import gnu.classpath.jdwp.util.Location;
+
+/**
+ * Reference implementation of VM hooks for JDWP Frame access.
+ *
+ * @author aluchko
+ */
+
+public class VMFrame
+{
+ // The object this frame resides in
+ private Object obj;
+
+ // The current location of this frame
+ private Location loc;
+
+ // id of this frame
+ private long id;
+
+ /**
+ * Gets the current location of the frame.
+ */
+ public Location getLocation()
+ {
+ return loc;
+ }
+
+ /**
+ * Returns the value of the variable in the given slot.
+ *
+ * @param slot the slot containing the variable
+ */
+ public Object getValue(int slot) { return null; }
+
+ /**
+ * Assigns the given variable to the given value.
+ * @param slot The slot which contains the variable
+ * @param value The value to assign the variable to
+ */
+ public void setValue(int slot, Object value) { }
+
+ /**
+ * Get the object which is represented by 'this' in the context of the frame,
+ * returns null if the method is native or static.
+ */
+ public Object getObject()
+ {
+ return obj;
+ }
+
+ /**
+ * Get the frameID
+ * @return an id which is unique within the scope of the VM
+ */
+ public long getId()
+ {
+ return id;
+ }
+
+}
Index: gnu/classpath/jdwp/VMIdManager.java
===================================================================
RCS file: gnu/classpath/jdwp/VMIdManager.java
diff -N gnu/classpath/jdwp/VMIdManager.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/classpath/jdwp/VMIdManager.java 23 Sep 2005 21:23:27 -0000
@@ -0,0 +1,427 @@
+/* VMIdManager.java -- A reference/example implementation of a manager for
+ JDWP object/reference type IDs
+
+ Copyright (C) 2005 Free Software Foundation
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.jdwp;
+
+import gnu.classpath.jdwp.exception.InvalidClassException;
+import gnu.classpath.jdwp.exception.InvalidObjectException;
+import gnu.classpath.jdwp.id.*;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+/**
+ * This class manages objects and referencetypes that are reported
+ * to the debugger. All objects and referencetypes reported to the
+ * debugger should go through this manager.
+ *
+ * A brief summary of what an <code>IdManager</code> must provide:
+ *
+ * <code>
+ * public ObjectId getObjectId (Object theObject);
+ * public ObjectId get (long id);
+ * public ObjectId readObjectId (ByteBuffer bb);
+ * public ReferenceTypeId getReferenceTypeId (Class clazz);
+ * public ReferenceTypeId getReferenceType (long id);
+ * public ReferenceTypeId readReferenceTypeId (ByteBuffer bb);
+ * </code>
+ *
+ * See the javadoc on these methods later in this file for more
+ * information on these functions.
+ *
+ * <b>NOTE:</b> All IDs handled by the ID manager (all object and reference
+ * type IDs) are assumed to be of type <code>long</code>.
+ *
+ * @author Keith Seitz (keiths@redhat.com)
+ */
+public class VMIdManager
+{
+ // This factory generates ids for objects and types that may
+ // be sent to a debugger.
+ private static class IdFactory
+ {
+ // ID of last object / referencetype
+ private static Object _idLock = new Object ();
+ private static Object _ridLock = new Object ();
+ private static long _lastId = 0;
+ private static long _lastRid = 0;
+
+ // A list of all ID types
+ private static HashMap _idList = new HashMap ();
+
+ // Initialize the id list with known types
+ static
+ {
+ // ObjectId and ArrayId are special cases. See newObjectId.
+ _idList.put (ClassLoaderId.typeClass, ClassLoaderId.class);
+ _idList.put (ClassObjectId.typeClass, ClassObjectId.class);
+ //_idList.put (FieldId.typeClass, FieldId.class);
+ //_idList.put (FrameId.typeClass, FrameId.class);
+ //_idList.put (MethodId.typeClass, MethodId.class);
+ _idList.put (StringId.typeClass, StringId.class);
+ _idList.put (ThreadId.typeClass, ThreadId.class);
+ _idList.put (ThreadGroupId.typeClass, ThreadGroupId.class);
+ }
+
+ /**
+ * Returns a new id for the given object
+ *
+ * @param object the object for which an id is desired
+ * @returns a suitable object id
+ */
+ public static ObjectId newObjectId (SoftReference obj)
+ {
+ ObjectId id = null;
+ Object object = obj.get ();
+
+ // Special case: arrays
+ if (object.getClass ().isArray ())
+ id = new ArrayId ();
+ else
+ {
+ // Loop through all classes until we hit baseclass
+ Class myClass;
+ for (myClass = object.getClass (); myClass != null;
+ myClass = myClass.getSuperclass ())
+ {
+ Class clz = (Class) _idList.get (myClass);
+ if (clz != null)
+ {
+ try
+ {
+ id = (ObjectId) clz.newInstance ();
+ synchronized (_idLock)
+ {
+ id.setId (++_lastId);
+ }
+ id.setReference (obj);
+ return id;
+ }
+ catch (InstantiationException ie)
+ {
+ // This really should not happen
+ throw new RuntimeException ("cannot create new ID", ie);
+ }
+ catch (IllegalAccessException iae)
+ {
+ // This really should not happen
+ throw new RuntimeException ("illegal access of ID", iae);
+ }
+ }
+ }
+
+ /* getSuperclass returned null and no matching ID type found.
+ So it must derive from Object. */
+ id = new ObjectId ();
+ }
+
+ synchronized (_idLock)
+ {
+ id.setId (++_lastId);
+ }
+ id.setReference (obj);
+ return id;
+ }
+
+ /**
+ * Returns a new reference type id for the given class
+ *
+ * @param clazz the <code>Class</code> for which an id is desired
+ * @returns a suitable reference type id or null when the
+ * reference is cleared.
+ */
+ public static ReferenceTypeId newReferenceTypeId (SoftReference ref)
+ {
+ ReferenceTypeId id;
+ Class clazz = (Class) ref.get ();
+ if (clazz == null)
+ return null;
+
+ if (clazz.isArray ())
+ id = new ArrayReferenceTypeId ();
+ else if (clazz.isInterface ())
+ id = new InterfaceReferenceTypeId ();
+ else
+ id = new ClassReferenceTypeId ();
+ synchronized (_ridLock)
+ {
+ id.setId (++_lastRid);
+ }
+ return id;
+ }
+ }
+
+ /**
+ * This class is a SoftReferenceIdentity type that is used by
+ * the ID manager.
+ */
+ class ReferenceKey extends SoftReference
+ {
+ // Hash code of referent
+ private int _hash;
+
+ /**
+ * Constructs a new <code>ReferenceKey</code> object
+ * with the given referent.
+ *
+ * <p>This constructor should only be used for object lookups
+ * by the backend.
+ *
+ * @param referent the object to reference
+ */
+ public ReferenceKey (Object referent)
+ {
+ super (referent);
+ _hash = referent.hashCode ();
+ }
+
+ /**
+ * Constructs a new <code>ReferenceKey</code> object
+ * with the given referent and reference queue.
+ *
+ * <p>The JDWP back-end stores a <code>ReferenceKey</code>
+ * with its corresponding <code>JdwpId</code>. This constructor
+ * is used by the back-end when adding new IDs to be managed.
+ *
+ * @param referent the object to reference
+ * @param queue the queue to which to report garbage collections
+ */
+ public ReferenceKey (Object referent, ReferenceQueue queue)
+ {
+ super (referent, queue);
+ _hash = referent.hashCode ();
+ }
+
+ /**
+ * Returns the hash code of the referent.
+ * This seems hacky, but is required in order to use this class
+ * as a hash table key.
+ *
+ * @returns the hash code of the referent
+ */
+ public int hashCode ()
+ {
+ return _hash;
+ }
+
+ /**
+ * Comparator for keys
+ *
+ * This method can be used in two ways:
+ *
+ * <ol>
+ * <li>For table lookups, where we want to compare referents</li>
+ * <li>For clearing GCd objects, where we want to compare the actual
+ * key object (not the referent)</li>
+ * </ol>
+ */
+ public boolean equals (Object obj)
+ {
+ if (obj instanceof ReferenceKey)
+ {
+ ReferenceKey ref = (ReferenceKey) obj;
+
+ /* First check if the two references are the same.
+ If they are, that means we must be clearing GCd objects. */
+ if (this == obj)
+ return true;
+
+ return (ref.get () == get ());
+ }
+
+ return false;
+ }
+ }
+
+ // instance of VMIdManager
+ private static VMIdManager _idm = new VMIdManager ();
+
+ // A reference queue for our objects
+ private ReferenceQueue _refQueue;
+
+ // Mapping of objects (ReferenceKey) to IDs (ObjectId)
+ private Hashtable _oidTable;
+
+ // Mapping of ID numbers (Long) to IDs (ObjectId)
+ private Hashtable _idTable;
+
+ /* Mapping of class (ReferenceKey) to IDs (ReferenceTypeId) for reference
+ types. Unlike other types, reference id types are NEVER released. */
+ private Hashtable _classTable;
+
+ // Mapping of ID numbers (Long) to reference type IDs (ReferenceTypeId)
+ private Hashtable _ridTable;
+
+ /**
+ * Gets the instance of VMIdManager, constructing a new one
+ * if none currently exists.
+ */
+ public static VMIdManager getDefault ()
+ {
+ return _idm;
+ }
+
+ // Constructs a new <code>IdManager</code>
+ private VMIdManager ()
+ {
+ _refQueue = new ReferenceQueue ();
+ _oidTable = new Hashtable (50);
+ _idTable = new Hashtable (50);
+ _classTable = new Hashtable (20);
+ _ridTable = new Hashtable (20);
+ }
+
+ // Updates the object ID table, removing IDs whose objects have
+ // been garbage collected.
+ private void _update ()
+ {
+ Reference ref;
+ while ((ref = _refQueue.poll ()) != null)
+ {
+ ObjectId id = (ObjectId) _oidTable.get (ref);
+ _oidTable.remove (ref);
+ _idTable.remove (new Long (id.getId ()));
+ }
+ }
+
+ /**
+ * Returns an id for the given object, adding it
+ * if it does not have an id.
+ *
+ * @param theObject the object to get an ID/add
+ * @returns the ID of the object
+ */
+ public ObjectId getObjectId (Object theObject)
+ {
+ ReferenceKey ref = new ReferenceKey (theObject, _refQueue);
+ ObjectId id = (ObjectId) _oidTable.get (ref);
+ if (id == null)
+ {
+ // update the tables -- this is an arbitrary place to put this
+ _update ();
+
+ // Object not found. Make new id for it
+ id = IdFactory.newObjectId (ref);
+ _oidTable.put (ref, id);
+ _idTable.put (new Long (id.getId ()), id);
+ }
+
+ return id;
+ }
+
+ /**
+ * Returns the <code>JdwpId</code> for a given ID. Unlike
+ * <code>getId</code>, it throws an exception if the ID is not
+ * known.
+ *
+ * @param id the numerical ID of the desired <code>JdwpId</code>
+ * @throws InvalidObjectException if the ID is not found
+ */
+ public ObjectId get (long id)
+ throws InvalidObjectException
+ {
+ ObjectId oid = (ObjectId) _idTable.get (new Long (id));
+ if (oid == null)
+ throw new InvalidObjectException (id);
+
+ return oid;
+ }
+
+ public ObjectId readObjectId (ByteBuffer bb)
+ throws InvalidObjectException
+ {
+ long id = bb.getLong ();
+ return get (id);
+ }
+
+ /**
+ * Gets the reference type id for the given class, creating
+ * a new one if it does not already have an id
+ *
+ * @param clazz the class for which to get an ID
+ * @returns the ID of the class
+ */
+ public ReferenceTypeId getReferenceTypeId (Class clazz)
+ {
+ ReferenceKey ref = new ReferenceKey (clazz);
+ ReferenceTypeId id = (ReferenceTypeId)_classTable.get (ref);
+ if (id == null)
+ {
+ // Object not found. Make new id for it
+ id = IdFactory.newReferenceTypeId (ref);
+ _classTable.put (ref, id);
+ _ridTable.put (new Long (id.getId ()), id);
+ }
+
+ return id;
+ }
+
+ /**
+ * Returns the <code>ReferenceTypeId</code> for a given ID. Unlike
+ * <code>getReferenceTypeId</code>, it throws an exception if the ID is not
+ * known.
+ *
+ * @param id the numerical ID of the desired reference type
+ * @throws InvalidClassException if the ID is not found
+ */
+ public ReferenceTypeId getReferenceType (long id)
+ throws InvalidClassException
+ {
+ ReferenceTypeId rid = (ReferenceTypeId) _ridTable.get (new Long (id));
+ if (rid == null)
+ throw new InvalidClassException (id);
+
+ return rid;
+ }
+
+ public ReferenceTypeId readReferenceTypeId (ByteBuffer bb)
+ throws InvalidClassException
+ {
+ long id = bb.getLong ();
+ return getReferenceType (id);
+ }
+}
Index: gnu/classpath/jdwp/VMVirtualMachine.java
===================================================================
RCS file: gnu/classpath/jdwp/VMVirtualMachine.java
diff -N gnu/classpath/jdwp/VMVirtualMachine.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/classpath/jdwp/VMVirtualMachine.java 23 Sep 2005 21:23:27 -0000
@@ -0,0 +1,329 @@
+/* VMVirtualMachine.java -- A reference implementation of a JDWP virtual
+ machine
+
+ Copyright (C) 2005 Free Software Foundation
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.jdwp;
+
+import gnu.classpath.jdwp.event.EventRequest;
+import gnu.classpath.jdwp.exception.InvalidClassException;
+import gnu.classpath.jdwp.exception.InvalidObjectException;
+import gnu.classpath.jdwp.id.ObjectId;
+import gnu.classpath.jdwp.id.ReferenceTypeId;
+import gnu.classpath.jdwp.util.LineTable;
+import gnu.classpath.jdwp.util.MethodResult;
+import gnu.classpath.jdwp.util.VariableTable;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * A virtual machine according to JDWP.
+ *
+ * @author Keith Seitz <keiths@redhat.com>
+ */
+public class VMVirtualMachine
+{
+ /**
+ * Suspend a thread
+ *
+ * @param thread the thread to suspend
+ */
+ public static void suspendThread (Thread thread) { }
+
+ /**
+ * Suspend all threads
+ */
+ public static void suspendAllThreads ()
+ {
+ // Our JDWP thread group -- don't suspend any of those threads
+ Thread current = Thread.currentThread ();
+ ThreadGroup jdwpGroup = current.getThreadGroup ();
+
+ // Find the root ThreadGroup
+ ThreadGroup group = jdwpGroup;
+ ThreadGroup parent = group.getParent ();
+ while (parent != null)
+ {
+ group = parent;
+ parent = group.getParent ();
+ }
+
+ // Get all the threads in the system
+ int num = group.activeCount ();
+ Thread[] threads = new Thread[num];
+ group.enumerate (threads);
+
+ for (int i = 0; i < num; ++i)
+ {
+ Thread t = threads[i];
+ if (t != null)
+ {
+ if (t.getThreadGroup () == jdwpGroup || t == current)
+ {
+ // Don't suspend the current thread or any JDWP thread
+ continue;
+ }
+ else
+ suspendThread (t);
+ }
+ }
+
+ // Now suspend the current thread
+ suspendThread (current);
+ }
+
+ /**
+ * Resume a thread. A thread must be resumed as many times
+ * as it has been suspended.
+ *
+ * @param thread the thread to resume
+ */
+ public static void resumeThread (Thread thread) { }
+
+ /**
+ * Resume all threads. This simply decrements the thread's
+ * suspend count. It can not be used to force the application
+ * to run.
+ */
+ public static void resumeAllThreads ()
+ {
+ // Our JDWP thread group -- don't resume
+ Thread current = Thread.currentThread ();
+ ThreadGroup jdwpGroup = current.getThreadGroup ();
+
+ // Find the root ThreadGroup
+ ThreadGroup group = jdwpGroup;
+ ThreadGroup parent = group.getParent ();
+ while (parent != null)
+ {
+ group = parent;
+ parent = group.getParent ();
+ }
+
+ // Get all the threads in the system
+ int num = group.activeCount ();
+ Thread[] threads = new Thread[num];
+ group.enumerate (threads);
+
+ for (int i = 0; i < num; ++i)
+ {
+ Thread t = threads[i];
+ if (t != null)
+ {
+ if (t.getThreadGroup () == jdwpGroup || t == current)
+ {
+ // Don't resume the current thread or any JDWP thread
+ continue;
+ }
+ else
+ resumeThread (t);
+ }
+ }
+ }
+
+ /**
+ * Get the suspend count for a give thread
+ *
+ * @param thread the thread whose suspend count is desired
+ * @return the number of times the thread has been suspended
+ */
+ public static int getSuspendCount (Thread thread) { return -1; }
+
+ /**
+ * Returns a count of the number of loaded classes in the VM
+ */
+ public static int getAllLoadedClassesCount () { return -1; }
+
+ /**
+ * Returns an iterator over all the loaded classes in the VM
+ */
+ public static Iterator getAllLoadedClasses () { return null; }
+
+ /**
+ * Returns the status of the given class
+ *
+ * @param clazz the class whose status is desired
+ * @return a flag containing the class's status
+ * @see JdwpConstants.ClassStatus
+ */
+ public static int getClassStatus (Class clazz) { return -1; }
+
+
+ /**
+ * Returns the thread's call stack
+ *
+ * @param thread thread for which to get call stack
+ * @param start index of first frame to return
+ * @param length number of frames to return (-1 for all frames)
+ * @return a list of frames
+ */
+ public static ArrayList getFrames (Thread thread, int strart,
+ int length)
+ { return null; }
+
+ /**
+ * Returns the frame for a given thread with the frame ID in
+ * the buffer
+ *
+ * I don't like this.
+ *
+ * @param thread the frame's thread
+ * @param bb buffer containing the frame's ID
+ * @return the desired frame
+ */
+ public static VMFrame getFrame (Thread thread, ByteBuffer bb)
+ { return null; }
+
+ /**
+ * Returns the number of frames in the thread's stack
+ *
+ * @param thread the thread for which to get a frame count
+ * @return the number of frames in the thread's stack
+ */
+ public static int getFrameCount (Thread thread)
+ { return -1; }
+
+
+ /**
+ * Returns the status of a thread
+ *
+ * @param thread the thread for which to get status
+ * @return integer status of the thread
+ * @see JdwpConstants.ThreadStatus
+ */
+ public static int getThreadStatus (Thread thread)
+ { return -1; }
+
+ /**
+ * Returns a list of all classes which this class loader has been
+ * requested to load
+ *
+ * @param cl the class loader
+ * @return a list of all visible classes
+ */
+ public static ArrayList getLoadRequests (ClassLoader cl)
+ { return null; }
+
+ /**
+ * Executes a method in the virtual machine
+ *
+ * @param obj instance in which to invoke method (null for static)
+ * @param thread the thread in which to invoke the method
+ * @param clazz the class in which the method is defined
+ * @param method the method to invoke
+ * @param values arguments to pass to method
+ * @param nonVirtual "otherwise, normal virtual invoke
+ * (instance methods only) "
+ * @return a result object containing the results of the invocation
+ */
+ public static MethodResult executeMethod (Object obj, Thread thread,
+ Class clazz, Method method,
+ Object[] values,
+ boolean nonVirtual)
+ { return null; }
+
+ /**
+ * "Returns variable information for the method. The variable table
+ * includes arguments and locals declared within the method. For instance
+ * methods, the "this" reference is included in the table. Also, synthetic
+ * variables may be present."
+ *
+ * @param clazz the class in which the method is defined
+ * @param method the method for which variable information is desired
+ * @return a result object containing the information
+ */
+ public static VariableTable getVarTable (Class clazz, Method method)
+ { return null; }
+
+ /**
+ * "Returns line number information for the method, if present. The line
+ * table maps source line numbers to the initial code index of the line.
+ * The line table is ordered by code index (from lowest to highest). The
+ * line number information is constant unless a new class definition is
+ * installed using RedefineClasses."
+ *
+ * @param clazz the class in which the method is defined
+ * @param method the method whose line table is desired
+ * @return a result object containing the line table
+ */
+ public static LineTable getLineTable (Class clazz, Method method)
+ { return null; }
+
+ /**
+ * "Returns the name of source file in which a reference type was declared"
+ *
+ * @param clazz the class for which to return a source file
+ * @return a string containing the source file name; "no path information
+ * for the file is included"
+ */
+ public static String getSourceFile (Class clazz)
+ { return null; }
+
+ /**
+ * Register a request from the debugger
+ *
+ * Virtual machines have two options. Either do nothing and allow
+ * the event manager to take care of the request (useful for broadcast-type
+ * events like class prepare/load/unload, thread start/end, etc.)
+ * or do some internal work to set up the event notification (useful for
+ * execution-related events like breakpoints, single-stepping, etc.).
+ */
+ public static void registerEvent (EventRequest request)
+ { }
+
+ /**
+ * Unregisters the given request
+ *
+ * @param request the request to unregister
+ */
+ public static void unregisterEvent (EventRequest request)
+ { }
+
+
+ /**
+ * Clear all events of the given kind
+ *
+ * @param kind the type of events to clear
+ */
+ public static void clearEvents (byte kind) { }
+}
Index: gnu/java/net/DefaultContentHandlerFactory.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/net/DefaultContentHandlerFactory.java,v
retrieving revision 1.3
diff -u -r1.3 DefaultContentHandlerFactory.java
--- gnu/java/net/DefaultContentHandlerFactory.java 30 Jun 2005 03:18:58 -0000 1.3
+++ gnu/java/net/DefaultContentHandlerFactory.java 23 Sep 2005 21:23:27 -0000
@@ -55,9 +55,11 @@
public Object getContent(URLConnection urlc) throws IOException
{
- ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit();
- java.awt.image.ImageProducer ip = tk.createImageProducer(urlc.getURL());
- return ip;
+ // FIXME: implement using ImageIO
+ // ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit();
+ // java.awt.image.ImageProducer ip = tk.createImageProducer(urlc.getURL());
+ // return ip;
+ return null;
}
}
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- include/Makefile.am 22 Jul 2005 20:45:36 -0000 1.11
+++ include/Makefile.am 23 Sep 2005 21:23:27 -0000
@@ -11,5 +11,5 @@
tool_include_dir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
## The 'jni.h' here is fairly hacky, but it is simpler than trying to
## tell Classpath about our peculiar install directory.
-tool_include__HEADERS = jni_md.h jawt.h jawt_md.h jvmpi.h \
- ../classpath/include/jni.h
+tool_include__HEADERS = jni_md.h ../classpath/include/jawt.h \
+ ../classpath/include/jawt_md.h jvmpi.h ../classpath/include/jni.h
Index: include/jawt.h
===================================================================
RCS file: include/jawt.h
diff -N include/jawt.h
--- include/jawt.h 30 Jun 2005 03:19:24 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,101 +0,0 @@
-/* jawt.h -- the machine-independent parts of the AWT Native Interface
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
-
-
-/*
- * The AWT Native Interface allows direct access to native screen
- * resources from within a Canvas's paint method.
- */
-
-#ifndef __jawt_h__
-#define __jawt_h__
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define JAWT_VERSION_1_3 0x10003
-#define JAWT_VERSION_1_4 0x10004
-
-#define JAWT_LOCK_ERROR 0x1
-#define JAWT_LOCK_CLIP_CHANGED 0x2
-#define JAWT_LOCK_BOUNDS_CHANGED 0x4
-#define JAWT_LOCK_SURFACE_CHANGED 0x8
-
-struct _JAWT_DrawingSurfaceInfo
-{
- void* platformInfo;
-};
-
-struct _JAWT_DrawingSurface
-{
- jint (JNICALL* Lock) (struct _JAWT_DrawingSurface*);
- void (JNICALL* Unlock) (struct _JAWT_DrawingSurface*);
-
- struct _JAWT_DrawingSurfaceInfo* (JNICALL* GetDrawingSurfaceInfo) (struct _JAWT_DrawingSurface*);
- void (JNICALL* FreeDrawingSurfaceInfo) (struct _JAWT_DrawingSurfaceInfo*);
-
- struct _JAWT_DrawingSurfaceInfo* surface_info;
-
- /* An object we're going to use for locking the surface. */
- jobject lock;
-
- /* FIXME: also include bounding rectangle of drawing surface. */
- /* FIXME: also include current clipping region. */
-};
-
-struct _JAWT
-{
- jint version;
- struct _JAWT_DrawingSurface* (JNICALL* GetDrawingSurface) (JNIEnv*, jobject);
- void (JNICALL* FreeDrawingSurface) (struct _JAWT_DrawingSurface*);
- void (JNICALL *Lock) (JNIEnv*);
- void (JNICALL *Unlock) (JNIEnv*);
-};
-
-typedef struct _JAWT_DrawingSurfaceInfo JAWT_DrawingSurfaceInfo;
-typedef struct _JAWT_DrawingSurface JAWT_DrawingSurface;
-typedef struct _JAWT JAWT;
-
-JNIEXPORT jboolean JNICALL JAWT_GetAWT (JNIEnv* env, struct _JAWT* awt);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __jawt_h__ */
Index: include/jawt_md.h
===================================================================
RCS file: include/jawt_md.h
diff -N include/jawt_md.h
--- include/jawt_md.h 30 Jun 2005 03:19:24 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,64 +0,0 @@
-/* jawt_md.h -- the X11-dependent parts of the AWT Native Interface
- Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
-
-
-#ifndef __jawt_md_h__
-#define __jawt_md_h__
-
-#include <jni.h>
-#include <jawt.h>
-#include <X11/Xlib.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-struct _JAWT_X11DrawingSurfaceInfo
-{
- Display* display;
- Drawable drawable;
- VisualID visualID;
-};
-
-typedef struct _JAWT_X11DrawingSurfaceInfo JAWT_X11DrawingSurfaceInfo;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __jawt_md_h__ */
Index: java/lang/reflect/VMProxy.java
===================================================================
RCS file: java/lang/reflect/VMProxy.java
diff -N java/lang/reflect/VMProxy.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/reflect/VMProxy.java 23 Sep 2005 21:23:27 -0000
@@ -0,0 +1,143 @@
+/* VMProxy.java -- VM interface for proxy class
+ Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang.reflect;
+
+final class VMProxy
+{
+ /**
+ * Set to true if the VM provides a native method to implement
+ * Proxy.getProxyClass completely, including argument verification.
+ * If this is true, HAVE_NATIVE_GET_PROXY_DATA and
+ * HAVE_NATIVE_GENERATE_PROXY_CLASS should be false.
+ * @see java.lang.reflect.Proxy
+ */
+ static boolean HAVE_NATIVE_GET_PROXY_CLASS = false;
+
+ /**
+ * Set to true if the VM provides a native method to implement
+ * the first part of Proxy.getProxyClass: generation of the array
+ * of methods to convert, and verification of the arguments.
+ * If this is true, HAVE_NATIVE_GET_PROXY_CLASS should be false.
+ * @see java.lang.reflect.Proxy
+ */
+ static boolean HAVE_NATIVE_GET_PROXY_DATA = false;
+
+ /**
+ * Set to true if the VM provides a native method to implement
+ * the second part of Proxy.getProxyClass: conversion of an array of
+ * methods into an actual proxy class.
+ * If this is true, HAVE_NATIVE_GET_PROXY_CLASS should be false.
+ * @see java.lang.reflect.Proxy
+ */
+ static boolean HAVE_NATIVE_GENERATE_PROXY_CLASS = false;
+
+ /**
+ * Optional native method to replace (and speed up) the pure Java
+ * implementation of getProxyClass. Only needed if
+ * VMProxy.HAVE_NATIVE_GET_PROXY_CLASS is true, this does the
+ * work of both getProxyData and generateProxyClass with no
+ * intermediate form in Java. The native code may safely assume that
+ * this class must be created, and does not already exist.
+ *
+ * @param loader the class loader to define the proxy class in; null
+ * implies the bootstrap class loader
+ * @param interfaces the interfaces the class will extend
+ * @return the generated proxy class
+ * @throws IllegalArgumentException if the constraints for getProxyClass
+ * were violated, except for problems with null
+ * @throws NullPointerException if `interfaces' is null or contains
+ * a null entry, or if handler is null
+ * @see Configuration#HAVE_NATIVE_GET_PROXY_CLASS
+ * @see #getProxyClass(ClassLoader, Class[])
+ * @see #getProxyData(ClassLoader, Class[])
+ * @see #generateProxyClass(ProxyData)
+ */
+ static Class getProxyClass(ClassLoader loader, Class[] interfaces)
+ {
+ return null;
+ }
+
+ /**
+ * Optional native method to replace (and speed up) the pure Java
+ * implementation of getProxyData. Only needed if
+ * Configuration.HAVE_NATIVE_GET_PROXY_DATA is true. The native code
+ * may safely assume that a new ProxyData object must be created which
+ * does not duplicate any existing ones.
+ *
+ * @param loader the class loader to define the proxy class in; null
+ * implies the bootstrap class loader
+ * @param interfaces the interfaces the class will extend
+ * @return all data that is required to make this proxy class
+ * @throws IllegalArgumentException if the constraints for getProxyClass
+ * were violated, except for problems with null
+ * @throws NullPointerException if `interfaces' is null or contains
+ * a null entry, or if handler is null
+ * @see Configuration.HAVE_NATIVE_GET_PROXY_DATA
+ * @see #getProxyClass(ClassLoader, Class[])
+ * @see #getProxyClass(ClassLoader, Class[])
+ * @see ProxyType#getProxyData()
+ */
+ static Proxy.ProxyData getProxyData(ClassLoader loader, Class[] interfaces)
+ {
+ return null;
+ }
+
+ /**
+ * Optional native method to replace (and speed up) the pure Java
+ * implementation of generateProxyClass. Only needed if
+ * Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS is true. The native
+ * code may safely assume that a new Class must be created, and that
+ * the ProxyData object does not describe any existing class.
+ *
+ * @param loader the class loader to define the proxy class in; null
+ * implies the bootstrap class loader
+ * @param data the struct of information to convert to a Class. This
+ * has already been verified for all problems except exceeding
+ * VM limitations
+ * @return the newly generated class
+ * @throws IllegalArgumentException if VM limitations are exceeded
+ * @see #getProxyClass(ClassLoader, Class[])
+ * @see #getProxyClass(ClassLoader, Class[])
+ * @see ProxyData#generateProxyClass(ClassLoader)
+ */
+ static Class generateProxyClass(ClassLoader loader, Proxy.ProxyData data)
+ {
+ return null;
+ }
+}
Index: java/lang/reflect/natProxy.cc
===================================================================
RCS file: java/lang/reflect/natProxy.cc
diff -N java/lang/reflect/natProxy.cc
--- java/lang/reflect/natProxy.cc 30 Sep 2002 05:19:09 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,38 +0,0 @@
-// natProxy.cc - Native code for Proxy class.
-
-/* Copyright (C) 2002 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-
-#include <gcj/cni.h>
-#include <jvm.h>
-
-#include <java/lang/Class.h>
-#include <java/lang/ClassLoader.h>
-#include <java/lang/reflect/Proxy.h>
-#include <java/lang/reflect/Proxy$ProxyData.h>
-
-::java::lang::Class *
-java::lang::reflect::Proxy::getProxyClass0 (::java::lang::ClassLoader *, JArray< ::java::lang::Class *> *)
-{
- return 0;
-}
-
-::java::lang::reflect::Proxy$ProxyData *
-java::lang::reflect::Proxy::getProxyData0 (::java::lang::ClassLoader *, JArray< ::java::lang::Class *> *)
-{
- return 0;
-}
-
-::java::lang::Class *
-java::lang::reflect::Proxy::generateProxyClass0 (::java::lang::ClassLoader *,
- ::java::lang::reflect::Proxy$ProxyData *)
-{
- return 0;
-}
Index: scripts/makemake.tcl
===================================================================
RCS file: /cvs/gcc/gcc/libjava/scripts/makemake.tcl,v
retrieving revision 1.4
diff -u -r1.4 makemake.tcl
--- scripts/makemake.tcl 20 Jul 2005 23:39:44 -0000 1.4
+++ scripts/makemake.tcl 23 Sep 2005 21:23:27 -0000
@@ -42,6 +42,7 @@
set package_map(javax/xml) bc
set package_map(gnu/java/beans) bc
set package_map(gnu/java/awt/peer/gtk) bc
+set package_map(gnu/java/awt/peer/qt) bc
set package_map(org/xml) bc
set package_map(org/w3c) bc
More information about the Java-patches
mailing list