natClass.cc (_getConstructors): Correctly check whether method name is the init name.

* java/lang/natClass.cc (_getConstructors): Correctly check
	whether method name is the init name.
	(getMethod): Look at accflags on method in `klass', not `this'.

From-SVN: r31258
This commit is contained in:
Tom Tromey 2000-01-06 18:18:15 +00:00 committed by Tom Tromey
parent c478efd142
commit 55ff3de705
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2000-01-06 Tom Tromey <tromey@cygnus.com>
* java/lang/natClass.cc (_getConstructors): Correctly check
whether method name is the init name.
(getMethod): Look at accflags on method in `klass', not `this'.
2000-01-05 Tom Tromey <tromey@cygnus.com> 2000-01-05 Tom Tromey <tromey@cygnus.com>
* java/lang/natClass.cc (getMethod): Compute offset relative to * java/lang/natClass.cc (getMethod): Compute offset relative to

View File

@ -139,7 +139,7 @@ java::lang::Class::_getConstructors (jboolean declared)
{ {
_Jv_Method *method = &methods[i]; _Jv_Method *method = &methods[i];
if (method->name == NULL if (method->name == NULL
&& ! _Jv_equalUtf8Consts (method->name, init_name)) || ! _Jv_equalUtf8Consts (method->name, init_name))
continue; continue;
if (! declared if (! declared
&& ! java::lang::reflect::Modifier::isPublic(method->accflags)) && ! java::lang::reflect::Modifier::isPublic(method->accflags))
@ -154,7 +154,7 @@ java::lang::Class::_getConstructors (jboolean declared)
{ {
_Jv_Method *method = &methods[i]; _Jv_Method *method = &methods[i];
if (method->name == NULL if (method->name == NULL
&& ! _Jv_equalUtf8Consts (method->name, init_name)) || ! _Jv_equalUtf8Consts (method->name, init_name))
continue; continue;
if (! declared if (! declared
&& ! java::lang::reflect::Modifier::isPublic(method->accflags)) && ! java::lang::reflect::Modifier::isPublic(method->accflags))
@ -473,7 +473,7 @@ java::lang::Class::getMethod (jstring name, JArray<jclass> *param_types)
using namespace java::lang::reflect; using namespace java::lang::reflect;
// Method must be public. // Method must be public.
if (! Modifier::isPublic (methods[i].accflags)) if (! Modifier::isPublic (klass->methods[i].accflags))
break; break;
Method *rmethod = new Method (); Method *rmethod = new Method ();