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

Change default of @ToString.includeFieldNames to true #108

Closed
lombokissues opened this issue Jul 14, 2015 · 3 comments
Closed

Change default of @ToString.includeFieldNames to true #108

lombokissues opened this issue Jul 14, 2015 · 3 comments
Assignees

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 35)

@lombokissues
Copy link
Author

👤 gerhard.balthasar   🕗 Aug 22, 2009 at 22:31 UTC

As accepted in this discussion:
http://groups.google.com/group/project-lombok/t/e5f70d48848e109a

Relevant part:

> - I would twist the default of incudeFieldNames, so it defaults to
> true. It may be lengthy, but imho it's more annoying to look up a
> class and counting down the fields to find out the name of the field
> for the value.

The original idea behind ToString is that the printed string is all
you need to construct a new one, provided you stick 'new' in front of
it. Which doesn't really hold up - strings aren't even escaped and
quoted. So, I think you're right about this. It could be smarter about
it and only default to includeFieldNames if you have more than 1 or 2,
but then we get back to the 'too much magic' problem. So, let's go
with includeFieldNames true by default, no matter how many fields you
have. Can you file a ticket for this? Thanks.

> This would also help for @ Data, as this one is often
> used in situations, where there are many fields and one cannot
> influence the behavoir of @ ToString except by declaring it explicitly.

Agreed.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Aug 27, 2009 at 22:17 UTC

Fixed in e92fd5a - will be rolled out in v0.8.4.

@lombokissues
Copy link
Author

End of migration

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

2 participants