findclass.java: New file

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

From-SVN: r32011
This commit is contained in:
Tom Tromey 2000-02-16 18:35:05 +00:00
parent 4798472070
commit 04297fe74f
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#include <stdlib.h>
#include <findclass.h>
jclass
Java_findclass_doit (JNIEnv *env, jclass klass, jstring name)
{
const char *buf = (*env)->GetStringUTFChars (env, name, NULL);
jclass k = (*env)->FindClass (env, buf);
(*env)->ReleaseStringUTFChars (env, name, buf);
return k;
}

View File

@ -0,0 +1,16 @@
// Test FindClass part of JNI.
public class findclass
{
static
{
System.loadLibrary ("findclass");
}
public static native Class doit (String name);
public static void main (String[] args)
{
System.out.println ("" + doit ("java/lang/String"));
}
}

View File

@ -0,0 +1 @@
class java.lang.String