Migrated from Google Code (issue 5)
👤 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.
👤 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
End of migration
Fixed Support for constructors of @Value objects with assigned final …