diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-25 20:40:09 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-25 20:40:09 +0000 |
commit | 7151fd9e91afc42e713dbb97c32f95cc7aebc050 (patch) | |
tree | 7a95909ce5f317195493ac83a8616500c5760369 | |
parent | c9a4cd6dfaec0b2a9faebe4a84550dcc81a1d763 (diff) | |
download | gcc-7151fd9e91afc42e713dbb97c32f95cc7aebc050.tar.gz |
* resolve.cc: Include StringBuffer.
(_Jv_ResolvePoolEntry): Use StringBuffer to create error string.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57515 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 3 | ||||
-rw-r--r-- | libjava/resolve.cc | 27 |
2 files changed, 18 insertions, 12 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d4a611bbbf5..2e5a4120e5e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,8 @@ 2002-09-25 Tom Tromey <tromey@redhat.com> + * resolve.cc: Include StringBuffer. + (_Jv_ResolvePoolEntry): Use StringBuffer to create error string. + * boehm.cc (_Jv_MarkObj): Don't fail if class object has been allocated but not initialized. diff --git a/libjava/resolve.cc b/libjava/resolve.cc index f55875509e3..90df67b8ab9 100644 --- a/libjava/resolve.cc +++ b/libjava/resolve.cc @@ -20,6 +20,7 @@ details. */ #include <java-cpool.h> #include <java/lang/Class.h> #include <java/lang/String.h> +#include <java/lang/StringBuffer.h> #include <java/lang/Thread.h> #include <java/lang/InternalError.h> #include <java/lang/VirtualMachineError.h> @@ -201,12 +202,13 @@ _Jv_ResolvePoolEntry (jclass klass, int index) end_of_field_search: if (the_field == 0) { - jstring msg = JvNewStringLatin1 ("field "); - msg = msg->concat (owner->getName ()); - msg = msg->concat (JvNewStringLatin1(".")); - msg = msg->concat (_Jv_NewStringUTF (field_name->data)); - msg = msg->concat (JvNewStringLatin1(" was not found.")); - throw_incompatible_class_change_error (msg); + java::lang::StringBuffer *sb = new java::lang::StringBuffer(); + sb->append(JvNewStringLatin1("field ")); + sb->append(owner->getName()); + sb->append(JvNewStringLatin1(".")); + sb->append(_Jv_NewStringUTF(field_name->data)); + sb->append(JvNewStringLatin1(" was not found.")); + throw_incompatible_class_change_error(sb->toString()); } pool->data[index].field = the_field; @@ -312,12 +314,13 @@ _Jv_ResolvePoolEntry (jclass klass, int index) if (the_method == 0) { - jstring msg = JvNewStringLatin1 ("method "); - msg = msg->concat (owner->getName ()); - msg = msg->concat (JvNewStringLatin1(".")); - msg = msg->concat (_Jv_NewStringUTF (method_name->data)); - msg = msg->concat (JvNewStringLatin1(" was not found.")); - throw new java::lang::NoSuchMethodError (msg); + java::lang::StringBuffer *sb = new java::lang::StringBuffer(); + sb->append(JvNewStringLatin1("method ")); + sb->append(owner->getName()); + sb->append(JvNewStringLatin1(".")); + sb->append(_Jv_NewStringUTF(method_name->data)); + sb->append(JvNewStringLatin1(" was not found.")); + throw new java::lang::NoSuchMethodError (sb->toString()); } pool->data[index].rmethod = |