Hey there,
in some places, we use nested records to e.g. return multiple values from a method, or to encapsulate them for passing them as single argument instead of multiples. Most of those records are private nested classes as they are in almost all cases very specific.
The problem is, that Java allows to use the fields of nested records directly e.g r.name instead of the accessor r.name().
I have not found a check for this case, only RecordAccessorInCompactConstructor which ironically does kind of the opposite.
Depending on how common our use case is in the outside world, I wonder if it would make sense to have such a check in errorprone directly.
Currently we are considering to build that check for our internal plugin, but if there is interest in having it as a core check we could contribute it.
Hey there,
in some places, we use nested records to e.g. return multiple values from a method, or to encapsulate them for passing them as single argument instead of multiples. Most of those records are private nested classes as they are in almost all cases very specific.
The problem is, that Java allows to use the fields of nested records directly e.g
r.nameinstead of the accessorr.name().I have not found a check for this case, only RecordAccessorInCompactConstructor which ironically does kind of the opposite.
Depending on how common our use case is in the outside world, I wonder if it would make sense to have such a check in errorprone directly.
Currently we are considering to build that check for our internal plugin, but if there is interest in having it as a core check we could contribute it.