#151 error in Reflect.resolveJavaMethod

open
nobody
General (151)
5
2003-12-22
2003-12-22
No

As the following comment says:

-------------------------
// Why do we do this? Won't the overloaded resolution
below find it
// just as well -- try to merge these next

try {
method = findAccessibleMethod(clas, name, types,
onlyStatic);
} catch ( SecurityException e ) { }

if ( Interpreter.DEBUG && method != null )
Interpreter.debug("findAccessibleMethod found: "+
method );
-------------------------

The findAccessibleMethod call is unnecessary, and it is
causing a problem. If I have a class:

class Foo {
public void foo(Object o) {
....
}
private void foo(String a) {
...
}
}

Then if I do fooObject.foo("abc") from beanshell, it
reports an error, saying the method is inaccessible.

Discussion