Commit 35e058a2 by Tom Tromey Committed by Tom Tromey

jni.cc: Added `name' argument.

	* jni.cc: Added `name' argument.
	* include/jni.h (struct JNINativeInterface) [DefineClass]: Added
	`const char *' argument.
	(class _Jv_JNIEnv) [DefineClass]: Likewise.

From-SVN: r59756
parent e8a68017
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> 2002-12-01 Tom Tromey <tromey@redhat.com>
Bug compatibility, for PR libgcj/8738: Bug compatibility, for PR libgcj/8738:
......
...@@ -249,14 +249,15 @@ struct JNINativeInterface ...@@ -249,14 +249,15 @@ struct JNINativeInterface
_Jv_func reserved3; _Jv_func reserved3;
jint (JNICALL *GetVersion) (JNIEnv *); jint (JNICALL *GetVersion) (JNIEnv *);
jclass (JNICALL *DefineClass) (JNIEnv *, jobject, jclass (JNICALL *DefineClass) (JNIEnv *, const char *,
const jbyte *, jsize); jobject, const jbyte *,
jsize);
jclass (JNICALL *FindClass) (JNIEnv *, const char *); jclass (JNICALL *FindClass) (JNIEnv *, const char *);
jmethodID (JNICALL *FromReflectedMethod) (JNIEnv *, jobject); jmethodID (JNICALL *FromReflectedMethod) (JNIEnv *, jobject);
jfieldID (JNICALL *FromReflectedField) (JNIEnv *, jobject); jfieldID (JNICALL *FromReflectedField) (JNIEnv *, jobject);
jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass, jmethodID, jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass,
jboolean); jmethodID, jboolean);
jclass (JNICALL *GetSuperclass) (JNIEnv *, jclass); jclass (JNICALL *GetSuperclass) (JNIEnv *, jclass);
jboolean (JNICALL *IsAssignableFrom) (JNIEnv *, jclass, jclass); jboolean (JNICALL *IsAssignableFrom) (JNIEnv *, jclass, jclass);
...@@ -687,8 +688,9 @@ public: ...@@ -687,8 +688,9 @@ public:
jint GetVersion () jint GetVersion ()
{ return p->GetVersion (this); } { return p->GetVersion (this); }
jclass DefineClass (jobject obj0, const jbyte * val1, jsize val2) jclass DefineClass (const char *name, jobject obj0, const jbyte * val1,
{ return p->DefineClass (this, obj0, val1, val2); } jsize val2)
{ return p->DefineClass (this, name, obj0, val1, val2); }
jclass FindClass (const char * val0) jclass FindClass (const char * val0)
{ return p->FindClass (this, val0); } { return p->FindClass (this, val0); }
......
...@@ -428,13 +428,14 @@ static jint ...@@ -428,13 +428,14 @@ static jint
} }
static jclass 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) const jbyte *buf, jsize bufLen)
{ {
try try
{ {
loader = unwrap (loader); loader = unwrap (loader);
jstring sname = JvNewStringUTF (name);
jbyteArray bytes = JvNewByteArray (bufLen); jbyteArray bytes = JvNewByteArray (bufLen);
jbyte *elts = elements (bytes); jbyte *elts = elements (bytes);
...@@ -443,7 +444,7 @@ static jclass ...@@ -443,7 +444,7 @@ static jclass
java::lang::ClassLoader *l java::lang::ClassLoader *l
= reinterpret_cast<java::lang::ClassLoader *> (loader); = 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); return (jclass) wrap_value (env, result);
} }
catch (jthrowable t) catch (jthrowable t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment