Closed ljacqu closed 1 year ago
We can use Map#containsKey
to check if the path is already mapped to a list of comments before throwing the exception. However, this approach may not allow us to overwrite an existing path.
It seems the CommentsConfiguration#setComment
should allow overriding the paths. Hence as mentioned in the issue description Map#put
is used to check.
Pull Request: https://github.com/AuthMe/ConfigMe/pull/373
Currently, if
@Comment
on a property and some statement inSettingsHolder#registerComments
set the comments for the same path, one of the comments is just discarded. This is misleading, and should be prevented by throwing an exception. There's no use case to defining part of the comment in the annotation or in the method—one approach should be used per path.To do
CommentsConfiguration
to throw an exception if a comment is registered to a path that already has commentsHint