diff options
author | Tom Tromey <tromey@redhat.com> | 2005-02-17 19:17:08 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-02-17 19:17:08 +0000 |
commit | 2a2c6e55e790704eb0e4013276aee8a91cec46c5 (patch) | |
tree | 247aeb11c899ea6580277539cb710a77d1b1f610 /libjava/link.cc | |
parent | 51615fd6cd97605e975ead59ca7780bc1bb92805 (diff) | |
download | gcc-2a2c6e55e790704eb0e4013276aee8a91cec46c5.tar.gz |
Class.h (_Jv_GetMethodString): Updated declaration.
* java/lang/Class.h (_Jv_GetMethodString): Updated declaration.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Updated.
* java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Updated.
* link.cc (_Jv_GetMethodString): Added 'derived' argument.
Changed type of second argument. Rewrote.
(make_vtable): Use it.
(append_partial_itable): Updated.
(layout_vtable_methods): Updated.
From-SVN: r95181
Diffstat (limited to 'libjava/link.cc')
-rw-r--r-- | libjava/link.cc | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/libjava/link.cc b/libjava/link.cc index 3f45ac119a2..8dd809b8687 100644 --- a/libjava/link.cc +++ b/libjava/link.cc @@ -665,12 +665,21 @@ _Jv_Linker::generate_itable (jclass klass, _Jv_ifaces *ifaces, // Format method name for use in error messages. jstring -_Jv_GetMethodString (jclass klass, _Jv_Utf8Const *name) +_Jv_GetMethodString (jclass klass, _Jv_Method *meth, + jclass derived) { - jstring r = klass->name->toString(); - r = r->concat (JvNewStringUTF (".")); - r = r->concat (name->toString()); - return r; + using namespace java::lang; + StringBuffer *buf = new StringBuffer (klass->name->toString()); + buf->append (jchar ('.')); + buf->append (meth->name->toString()); + buf->append ((jchar) ' '); + buf->append (meth->signature->toString()); + if (derived) + { + buf->append(JvNewStringLatin1(" in ")); + buf->append(derived->name->toString()); + } + return buf->toString(); } void @@ -720,13 +729,13 @@ _Jv_Linker::append_partial_itable (jclass klass, jclass iface, { if ((meth->accflags & Modifier::STATIC) != 0) throw new java::lang::IncompatibleClassChangeError - (_Jv_GetMethodString (klass, meth->name)); + (_Jv_GetMethodString (klass, meth)); if ((meth->accflags & Modifier::ABSTRACT) != 0) throw new java::lang::AbstractMethodError - (_Jv_GetMethodString (klass, meth->name)); + (_Jv_GetMethodString (klass, meth)); if ((meth->accflags & Modifier::PUBLIC) == 0) throw new java::lang::IllegalAccessError - (_Jv_GetMethodString (klass, meth->name)); + (_Jv_GetMethodString (klass, meth)); itable[pos] = meth->ncode; } @@ -1161,9 +1170,9 @@ _Jv_Linker::layout_vtable_methods (jclass klass) using namespace java::lang; StringBuffer *sb = new StringBuffer(); sb->append(JvNewStringLatin1("method ")); - sb->append(_Jv_GetMethodString(klass, meth->name)); + sb->append(_Jv_GetMethodString(klass, meth)); sb->append(JvNewStringLatin1(" overrides final method ")); - sb->append(_Jv_GetMethodString(declarer, super_meth->name)); + sb->append(_Jv_GetMethodString(declarer, super_meth)); throw new VerifyError(sb->toString()); } } @@ -1245,18 +1254,15 @@ _Jv_Linker::make_vtable (jclass klass) if (vtable->get_method(i) == (void *) &_Jv_abstractMethodError) { using namespace java::lang; + jclass orig = klass; while (klass != NULL) { for (int j = 0; j < klass->method_count; ++j) { if (klass->methods[j].index == i) - { - StringBuffer *buf = new StringBuffer (); - buf->append (_Jv_NewStringUtf8Const (klass->methods[j].name)); - buf->append ((jchar) ' '); - buf->append (_Jv_NewStringUtf8Const (klass->methods[j].signature)); - throw new AbstractMethodError (buf->toString ()); - } + throw new AbstractMethodError(_Jv_GetMethodString(klass, + &klass->methods[j], + orig)); } klass = klass->getSuperclass (); } |