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

Comments

Projects
None yet
2 participants
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 35)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

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.

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

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

Collaborator

lombokissues commented Jul 14, 2015

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

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment