+2005-09-06 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/23739:
+ * testsuite/libjava.jni/pr23739.c: New file.
+ * testsuite/libjava.jni/pr23739.java: New file.
+ * testsuite/libjava.jni/pr23739.out: New file.
+ * jni.cc (_Jv_JNI_IsAssignableFrom): Reversed arguments.
+ * java/lang/reflect/natMethod.cc (invoke): Updated.
+ * java/lang/natClass.cc (isAssignableFrom): Updated.
+ (isInstance): Likewise.
+ (_Jv_IsAssignableFrom): Reversed arguments.
+ (_Jv_IsInstanceOf): Updated.
+ (_Jv_CheckCast): Likewise.
+ (_Jv_CheckArrayStore): Likewise.
+ (_Jv_IsAssignableFromSlow): Reversed arguments.
+ (_Jv_InterfaceAssignableFrom): Likewise.
+ * link.cc (verify_type_assertions): Updated.
+ * prims.cc (_Jv_CheckAccess): Updated.
+
2005-09-05 Ranjit Mathew <rmathew@hotmail.com>
Testsuite changes for PR java/23431.
// Arguments may not have been initialized, given ".class" syntax.
_Jv_InitClass (this);
_Jv_InitClass (klass);
- return _Jv_IsAssignableFrom (this, klass);
+ return _Jv_IsAssignableFrom (klass, this);
}
jboolean
if (! obj)
return false;
_Jv_InitClass (this);
- return _Jv_IsAssignableFrom (this, JV_CLASS (obj));
+ return _Jv_IsAssignableFrom (JV_CLASS (obj), this);
}
jobject
}
jboolean
-_Jv_IsAssignableFrom (jclass target, jclass source)
+_Jv_IsAssignableFrom (jclass source, jclass target)
{
if (source == target)
return true;
// two interfaces for assignability.
if (__builtin_expect
(source->idt == NULL || source->isInterface(), false))
- return _Jv_InterfaceAssignableFrom (target, source);
+ return _Jv_InterfaceAssignableFrom (source, target);
_Jv_IDispatchTable *cl_idt = source->idt;
_Jv_IDispatchTable *if_idt = target->idt;
// superinterface of SOURCE. This is used when SOURCE is also an interface,
// or a class with no interface dispatch table.
jboolean
-_Jv_InterfaceAssignableFrom (jclass iface, jclass source)
+_Jv_InterfaceAssignableFrom (jclass source, jclass iface)
{
for (int i = 0; i < source->interface_count; i++)
{
jclass interface = source->interfaces[i];
if (iface == interface
- || _Jv_InterfaceAssignableFrom (iface, interface))
+ || _Jv_InterfaceAssignableFrom (interface, iface))
return true;
}
if (!source->isInterface()
&& source->superclass
- && _Jv_InterfaceAssignableFrom (iface, source->superclass))
+ && _Jv_InterfaceAssignableFrom (source->superclass, iface))
return true;
return false;
{
if (__builtin_expect (!obj, false))
return false;
- return (_Jv_IsAssignableFrom (cl, JV_CLASS (obj)));
+ return _Jv_IsAssignableFrom (JV_CLASS (obj), cl);
}
void *
_Jv_CheckCast (jclass c, jobject obj)
{
if (__builtin_expect
- (obj != NULL && ! _Jv_IsAssignableFrom(c, JV_CLASS (obj)), false))
+ (obj != NULL && ! _Jv_IsAssignableFrom(JV_CLASS (obj), c), false))
throw new java::lang::ClassCastException
((new java::lang::StringBuffer
(obj->getClass()->getName()))->append
return;
jclass obj_class = JV_CLASS (obj);
if (__builtin_expect
- (! _Jv_IsAssignableFrom (elt_class, obj_class), false))
+ (! _Jv_IsAssignableFrom (obj_class, elt_class), false))
throw new java::lang::ArrayStoreException
((new java::lang::StringBuffer
(JvNewStringUTF("Cannot store ")))->append
}
jboolean
-_Jv_IsAssignableFromSlow (jclass target, jclass source)
+_Jv_IsAssignableFromSlow (jclass source, jclass target)
{
// First, strip arrays.
while (target->isArray ())
{
// We use a recursive call because we also need to
// check superinterfaces.
- if (_Jv_IsAssignableFromSlow (target, source->getInterface (i)))
+ if (_Jv_IsAssignableFromSlow (source->getInterface (i), target))
return true;
}
}