You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of the AutoLogAnnotationProcessor would parse only the fields contained within SomeNotLoggedClass, but notably not SomeNotLoggedClassand it's field, someLoggedProperty. I would like to suggest changes to AutoLogAnnotationProcessor which would log the aforementioned, as well as only attempting to log field elements that have the access modifiers public or protected.
The latter of which would provide a route by which to prevent fields in a super class (or any class for that matter) from unecessarily logging a field. If done, it would remove the additional complexity that currently exists of having to manually implement LoggableInputs if you wish to have the super class field someLoggedProperty to be logged.
The text was updated successfully, but these errors were encountered:
Jelatinone
changed the title
Add Support for superclass fields to @AutoLog
Add support for superclass fields to @AutoLog
Jun 23, 2024
I think there are a few pieces here which are missing right now, and they don't all depend on each other:
Logging fields declared in superclasses
Logging generic fields from superclasses
Logging only public/protected fields
I think that all of those are doable, though dealing with superclasses in particular is a bit challenging for compile-type annotation processing. At runtime it's trivial to retrieve all of the fields of a class including its superclasses, but I believe doing it at compile time will require searching each superclass and explicitly filling in generics as necessary.
Consider any given class which does not have the
@AutoLog
annotation applied:Then consider another class, which extends the aforementioned
SomeNotLoggedClass
:Current implementation of the
AutoLogAnnotationProcessor
would parse only the fields contained withinSomeNotLoggedClass,
but notably notSomeNotLoggedClass
and it's field,someLoggedProperty
. I would like to suggest changes toAutoLogAnnotationProcessor
which would log the aforementioned, as well as only attempting to log field elements that have the access modifiers public or protected.The latter of which would provide a route by which to prevent fields in a super class (or any class for that matter) from unecessarily logging a field. If done, it would remove the additional complexity that currently exists of having to manually implement
LoggableInputs
if you wish to have the super class fieldsomeLoggedProperty
to be logged.The text was updated successfully, but these errors were encountered: