OSDN Git Service

* jni.cc: Added `name' argument.
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Dec 2002 03:54:05 +0000 (03:54 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Dec 2002 03:54:05 +0000 (03:54 +0000)
* include/jni.h (struct JNINativeInterface) [DefineClass]: Added
`const char *' argument.
(class _Jv_JNIEnv) [DefineClass]: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59756 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/include/jni.h
libjava/jni.cc

index 894f006..cdf7851 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-02  Tom Tromey  <tromey@redhat.com>
+
+       * jni.cc: Added `name' argument.
+       * include/jni.h (struct JNINativeInterface) [DefineClass]: Added
+       `const char *' argument.
+       (class _Jv_JNIEnv) [DefineClass]: Likewise.
+
 2002-12-01  Tom Tromey  <tromey@redhat.com>
 
        Bug compatibility, for PR libgcj/8738:
index 0b98ab2..31f5798 100644 (file)
@@ -249,14 +249,15 @@ struct JNINativeInterface
   _Jv_func reserved3;
 
   jint     (JNICALL *GetVersion)                   (JNIEnv *);
-  jclass   (JNICALL *DefineClass)                  (JNIEnv *, jobject,
-                                                    const jbyte *, jsize);
+  jclass   (JNICALL *DefineClass)                  (JNIEnv *, const char *,
+                                                   jobject, const jbyte *,
+                                                   jsize);
   jclass   (JNICALL *FindClass)                    (JNIEnv *, const char *);
 
   jmethodID (JNICALL *FromReflectedMethod)        (JNIEnv *, jobject);
   jfieldID  (JNICALL *FromReflectedField)         (JNIEnv *, jobject);
-  jobject   (JNICALL *ToReflectedMethod)          (JNIEnv *, jclass, jmethodID,
-                                                    jboolean);
+  jobject   (JNICALL *ToReflectedMethod)          (JNIEnv *, jclass,
+                                                   jmethodID, jboolean);
 
   jclass   (JNICALL *GetSuperclass)                (JNIEnv *, jclass);
   jboolean (JNICALL *IsAssignableFrom)             (JNIEnv *, jclass, jclass);
@@ -687,8 +688,9 @@ public:
   jint GetVersion ()
   { return p->GetVersion (this); }
 
-  jclass DefineClass (jobject obj0, const jbyte * val1, jsize val2)
-  { return p->DefineClass (this, obj0, val1, val2); }
+  jclass DefineClass (const char *name, jobject obj0, const jbyte * val1,
+                     jsize val2)
+  { return p->DefineClass (this, name, obj0, val1, val2); }
 
   jclass FindClass (const char * val0)
   { return p->FindClass (this, val0); }
index 44ea411..b841b4f 100644 (file)
@@ -428,13 +428,14 @@ static jint
 }
 
 static jclass
-(JNICALL _Jv_JNI_DefineClass) (JNIEnv *env, jobject loader,
+(JNICALL _Jv_JNI_DefineClass) (JNIEnv *env, const char *name, jobject loader,
                               const jbyte *buf, jsize bufLen)
 {
   try
     {
       loader = unwrap (loader);
 
+      jstring sname = JvNewStringUTF (name);
       jbyteArray bytes = JvNewByteArray (bufLen);
 
       jbyte *elts = elements (bytes);
@@ -443,7 +444,7 @@ static jclass
       java::lang::ClassLoader *l
        = reinterpret_cast<java::lang::ClassLoader *> (loader);
 
-      jclass result = l->defineClass (bytes, 0, bufLen);
+      jclass result = l->defineClass (sname, bytes, 0, bufLen);
       return (jclass) wrap_value (env, result);
     }
   catch (jthrowable t)