-
Notifications
You must be signed in to change notification settings - Fork 756
Warn against toString() on an array #65
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
Comments
Original comment posted by adgar@google.com on 2012-12-10 at 09:59 PM Apologies, was checked into the wrong git commit when I made that patch. Please consider the following. |
Original comment posted by eaftan@google.com on 2012-12-11 at 06:40 PM Hi Mike, Thanks for the contribution! This check has been on our todo list for a while. Could you please create a clone of our repository and push your change there? Then request a code review with a link to the revision with your change. We'll do a code review and then merge it into our trunk. How to create a clone: Status: Accepted |
Original comment posted by cpovirk@google.com on 2013-01-23 at 08:07 PM Similar in spirit is a check for arrays used in string concatenation ("foo" + array) and, I suppose, in String.format(). I ran across an instance of the former not long ago. |
Original comment posted by eaftan@google.com on 2013-02-11 at 08:01 PM This has been checked into trunk. Status: Fixed |
Original comment posted by lowasser@google.com on 2013-04-13 at 07:29 PM Issue #118 has been merged into this issue. |
Original issue created by adgar@google.com on 2012-12-10 at 09:15 PM
Much like an Array's equals() method is warned against, so too should Array's toString() method. The resolution is also similar: use java.util.Arrays.toString(array).
I've attached a patch adding the check based on the ArrayEquals check.
The text was updated successfully, but these errors were encountered: