Method.java (hashCode): Use getName().

* java/lang/reflect/Method.java (hashCode): Use getName().
	(toString): Likewise.
	* java/lang/reflect/natMethod.cc (getType): Initialize
	exception_types.

From-SVN: r35561
This commit is contained in:
Tom Tromey 2000-08-08 03:34:51 +00:00 committed by Tom Tromey
parent f0f3a77740
commit d7ec12ae74
3 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2000-08-07 Tom Tromey <tromey@cygnus.com>
* java/lang/reflect/Method.java (hashCode): Use getName().
(toString): Likewise.
* java/lang/reflect/natMethod.cc (getType): Initialize
exception_types.
* java/lang/reflect/Method.java (toString): Use Class.getName, not
Class.toString.
* java/lang/reflect/Field.java (toString): Correct formatting.

View File

@ -65,7 +65,7 @@ public final class Method extends AccessibleObject implements Member
public int hashCode ()
{
// FIXME.
return name.hashCode() + declaringClass.getName().hashCode();
return getName().hashCode() + declaringClass.getName().hashCode();
}
public native Object invoke (Object obj, Object[] args)
@ -84,7 +84,7 @@ public final class Method extends AccessibleObject implements Member
b.append(" ");
b.append(declaringClass.getName());
b.append(".");
b.append(name);
b.append(getName());
b.append("(");
for (int i = 0; i < parameter_types.length; ++i)
{

View File

@ -203,6 +203,10 @@ java::lang::reflect::Method::getType ()
declaringClass,
&parameter_types,
&return_type);
// FIXME: for now we have no way to get exception information.
exception_types = (JArray<jclass> *) JvNewObjectArray (0, &ClassClass,
NULL);
}
void