Revisit mapper processor's messaging

Description

With it will become more common to run the annotation processor on compiled classes.

In that scenario, no location information is available, and this results in very poor user experience: the message passed to DecoratedMessager is output as-is, without even the name of the type.

We should generate basic location information ourselves (name of the type, method, and parameter if applicable), and always prepend it to the provided message. This will be a bit redundant when the message is actually issued in the correct place in source code, but invaluable when there is no source code.

Once we have that, we could also deprecate the mechanism that was introduced in JAVA-2302, and always issue messages on the parent type instead. Those messages will now carry their own location info, so it doesn't matter whether the parent is compiled or not.

Finally, we should add a deduplication mechanism to avoid generating the same message more than once, I noticed that this happens, for example when a method is inherited by multiple children types.

Environment

None

Pull Requests

None
Fixed

Assignee

Olivier Michallat

Reporter

Olivier Michallat

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure