#234 NullPointerException in logInvokeMethod during logging null

open
nobody
General (151)
5
2005-07-21
2005-07-21
No

In function: Reflect.logInvokeMethod

During logging null-Primitive a NullPointerException
occurs because null.getClass() is invalid.

Fix:
private static void logInvokeMethod(
String msg, Method method, Object[] args )
{
if ( Interpreter.DEBUG )
{
Interpreter.debug( msg +method+" with args:" );
for(int i=0; i<args.length; i++)
Interpreter.debug(
"args["+i+"] = "+ args[i]
+ " type = "+ ( (args[i] instanceof
Object)?args[i].getClass(): args[i]) );
}
}

Discussion