Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug fails if called method argument is null #44

Closed
GoogleCodeExporter opened this issue Sep 9, 2015 · 3 comments
Closed

Debug fails if called method argument is null #44

GoogleCodeExporter opened this issue Sep 9, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Copied from 
https://sourceforge.net/tracker/?func=detail&aid=2562805&group_id=4075&atid=1040
75

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


Original issue reported on code.google.com by pejob...@gmail.com on 27 Feb 2011 at 12:30

@GoogleCodeExporter
Copy link
Author

Original comment by pejob...@gmail.com on 27 Feb 2011 at 12:31

  • Added labels: Milestone-2.1b1

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r68.

Original comment by `` on 27 Feb 2011 at 2:23

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by pejob...@gmail.com on 20 Oct 2011 at 7:12

  • Added labels: v2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant