AuthMe / ConfigMe

A simple configuration management library for any Java project!
MIT License
37 stars 16 forks source link

BeanPropertyComments: Replace UUID with field name #454

Open ljacqu opened 1 month ago

ljacqu commented 1 month ago

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