* libjava.jni/field.out: New file.
* libjava.jni/field.c: New file.
* libjava.jni/field.java: New file.
From-SVN: r40776
+2001-03-22 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jni/field.out: New file.
+ * libjava.jni/field.c: New file.
+ * libjava.jni/field.java: New file.
+
2001-03-20 Tom Tromey <tromey@redhat.com>
* libjava.compile/uesc.java: New file.
--- /dev/null
+#include <jni.h>
+#include <field.h>
+
+jobjectArray
+Java_field_fetch (JNIEnv *env, jobject this)
+{
+ jclass cls;
+ jfieldID fid;
+ jobjectArray obj;
+
+ cls = (*env)->GetObjectClass (env, this);
+ if (! cls)
+ return 0;
+
+ fid = (*env)->GetFieldID (env, cls, "F", "[Ljava/lang/Object;");
+ if (! fid)
+ return 0;
+
+ obj = (*env)->GetObjectField (env, this, fid);
+
+ return obj;
+}
+
+
--- /dev/null
+// Test for array field lookup.
+
+public class field
+{
+ // A field for us to look up.
+ public Object[] F = new Object[7];
+
+ public native Object[] fetch ();
+
+ public void doit ()
+ {
+ System.out.println (F == fetch ());
+ }
+
+ public static void main (String[] args)
+ {
+ field q = new field ();
+ q.doit ();
+ }
+
+ static
+ {
+ System.loadLibrary ("field");
+ }
+}