This is the mail archive of the java-patches@sourceware.cygnus.com 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]

Patch: another JNI test


I'm checking in this new JNI test.

2000-02-15  Tom Tromey  <tromey@cygnus.com>

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

Tom

Index: libjava.jni/findclass.out
===================================================================
RCS file: findclass.out
diff -N findclass.out
--- /dev/null	Tue May  5 13:32:27 1998
+++ findclass.out	Wed Feb 16 10:34:10 2000
@@ -0,0 +1 @@
+class java.lang.String
Index: libjava.jni/findclass.c
===================================================================
RCS file: findclass.c
diff -N findclass.c
--- /dev/null	Tue May  5 13:32:27 1998
+++ findclass.c	Wed Feb 16 10:34:10 2000
@@ -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;
+}
Index: libjava.jni/findclass.java
===================================================================
RCS file: findclass.java
diff -N findclass.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ findclass.java	Wed Feb 16 10:34:10 2000
@@ -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"));
+  }
+}

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