Description
The class BeanPropertyComments
has a field uuid
to keep track of unique comments: if a UUID is set, we can keep track whether we've already set this comment in ExportContextImpl
and can ensure that comments are only set once (when so desired). Since a random UUID is set, it is important the bean properties be only scanned once. After that, they're cached. This changes slightly after #135 where the bean instantiation is cached instead of the property.
It would be nicer to replace UUID with a String and to set the field name instead. String
allows easier custom behavior, and defaulting to the field name means that the "ID" is deterministic and doesn't implicitly require caching. Also, if a bean type extends from another one, the comment will not be repeated for the child type. This is currently not supported.
To do
- Replace
UUID uuid
in BeanPropertyComments to a String field - Set the value as
field.declaringClass#field.name
- Add test that checks that a unique comment is not repeated for a child bean type