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

Attempt to make 'find callers' on @Data do the right thing (constructor). #78

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

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 5)

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jul 24, 2009 at 04:19 UTC

finding the callers of a constructor of a data class could be useful, but right now this is hard to do,
because there's no constructor. By creating the various components of a @ Data annotation in the
right order, it may be possible to ensure that eclipse will always pick the (static) constructor when
hitting 'find callers' whilst the annotation is under the cursor.

anecdotal evidence, sample size 1: Right now you get callers of hashCode(), which is pointless.

The 'right' answer is to pick the (static) constructor - for getters/setters, you can just annotate the
field and then run 'find callers' on that annotation, and trying to find the callers of
hashCode/equals/toString is silly.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jul 26, 2009 at 07:35 UTC

Okay, this trick works, but only for the static constructor. The real constructor will not show up at the end even if
you add it last.

HOWEVER: You can start 'find callers' while the class name is under the cursor (the "Bar" in "public @ Data class
Bar") and that'll work just fine, so this is no biggy. The change to generate the static constructor last is in commit
f74109f

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant