Tracker: Bugs

5 Debug fails if called method argument is null - ID: 2562805
Last Update: Tracker Item Submitted ( nobody )

In bsh.Reflect.java the below code fails if debug is turned on and one of
method arguments is null.

Since args[i] is null, args[i].getClass() throws NullPointerException.

This makes debuging impossible in some cases.

Line:
+" type = "+args[i].getClass() );

Should be:
+" type = "+(args[i] == null ? "void" : args[i].getClass()) );



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].getClass() );
}
}


Nobody/Anonymous ( nobody ) - 2009-02-04 01:38

5

Open

None

Nobody/Anonymous

General

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.