Change default of @ToString.includeFieldNames to true #108

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

Projects

None yet

2 participants

@lombokissues
Collaborator

Migrated from Google Code (issue 35)

@lombokissues
Collaborator

👤 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
Collaborator

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

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

@lombokissues
Collaborator

End of migration

@Tradunsky Tradunsky pushed a commit to Tradunsky/lombok that referenced this issue Aug 19, 2015
Michail Plushnikov Update getter/setter name generation to lombok style
Regression #108: Getter/Setter wrong after last Update
5edeff2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment