* dispatch characteristics (e.g. name and argument count),
* false to throw an exception instead.
*/
public void addMethod(MethodObject method, boolean bReplace)
{
Symbol symbol = method.getSymbol();
int nOrdinal = findMethodOrdinal(symbol, method.getMinArgCount());
if ((nOrdinal >= 0) ? !bReplace :
method.getMinArgCount() <= 1 && findAttributeOrdinal(symbol) >= 0)
{
throw new DeclarationException("err.scripting.methodDup",
new Object[]{symbol.getName(),
Primitive.createInteger(method.getArgCount()),
getName()});
}
if (method.getHolder() != null && method.getHolder() != this)
{
throw new DeclarationException("err.scripting.methodReuse",
new Object[]{symbol.getName(),
Primitive.createInteger(method.getArgCount()),
method.getHolder().getName(),
getName()});
}