This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: code generator -vs- "known" methods and fields
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 12 Dec 2005 09:27:13 -0700
- Subject: [gcjx] Patch: FYI: code generator -vs- "known" methods and fields
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
We weren't properly finding methods like 'iterator()' on generic
types, as we weren't looking for the erasure of the type. Likewise
for fields.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* bytecode/generate.cc (find_method): Look for erasure of return
type.
(find_field): Look for erasure of field's type.
Index: bytecode/generate.cc
===================================================================
--- bytecode/generate.cc (revision 108412)
+++ bytecode/generate.cc (working copy)
@@ -2241,7 +2241,8 @@
++it)
{
model_field *field = (*it).get ();
- if (field->get_name () == name && field->type ()->erasure () == type)
+ if (field->get_name () == name
+ && field->type ()->erasure () == type->erasure ())
return field;
}
throw request->error ("couldn't find field %1 of type %2 in class %3")
@@ -2286,7 +2287,7 @@
% mname % (argtype ? argtype : primitive_void_type) % klass;
}
- if (result->get_return_type ()->erasure () != result_type)
+ if (result->get_return_type ()->erasure () != result_type->erasure ())
{
throw request->error ("method %1 doesn't have expected return type"
" of %2")