field.out: New file.

* libjava.jni/field.out: New file.
	* libjava.jni/field.c: New file.
	* libjava.jni/field.java: New file.

From-SVN: r40776
This commit is contained in:
Tom Tromey 2001-03-23 05:57:00 +00:00 committed by Tom Tromey
parent e4c34f6a43
commit ae8a67c4c0
4 changed files with 56 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -0,0 +1,24 @@
#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;
}

View File

@ -0,0 +1,25 @@
// 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");
}
}

View File

@ -0,0 +1 @@
true