New issue
Advanced search Search tips

Issue 921427 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Java Style Guide: Recommend making toString() overrides Debug-only

Project Member Reported by agrieve@chromium.org, Jan 14

Issue description

Overriding Object#toString() is most frequently used to as a debugging aid when printing objects. 

We currently have 37 overrides:
https://cs.chromium.org/search/?q=lang:java+public.*toString%5C(+-file:third_party+-file:test&sq=package:chromium&type=cs

Certainly some of them are used for many than just debugging aids, but I think it's the exception to the norm.

It would be nice to still support the debug usecase, but we should add @RemovableInRelease to the overrides, and ensure that proguard removes them for release builds.
 
Labels: QuickFix

Sign in to add a comment