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
This commit is contained in:
parent
e8a68017b0
commit
35e058a2b8
@ -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:
|
||||
|
@ -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); }
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user