diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 894f006a3ede..cdf78516e929 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2002-12-02 Tom Tromey + + * 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 Bug compatibility, for PR libgcj/8738: diff --git a/libjava/include/jni.h b/libjava/include/jni.h index 0b98ab2c5c44..31f57985683b 100644 --- a/libjava/include/jni.h +++ b/libjava/include/jni.h @@ -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); } diff --git a/libjava/jni.cc b/libjava/jni.cc index 44ea4118f894..b841b4fc481f 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -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 (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)