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
... the generated methods getBar and setBar are given the @foo annotation also. This causes problems for widely used Java libraries that rely on the convention of either the field OR the method being annotated.
Given @BeanProperty's express purpose for Java interoperability, the default behavior for @BeanProperty should be aligned with the prevailing Java convention. The generated getter and setter should not have the underlying field's annotations added.
If a developer wishes to have annotations defined on the Java-visible getter or setter, they should define those methods explicitly in the Scala class, and add the desired annotations manually.
This is not a duplicate of #1846 or #2245. Those tickets both raise this issue, but request that the problem be addressed by either adding more metadata at the Scala language level, or by providing compiler plugins that add knowledge of the annotations in use. For the @BeanProperty use cases, this is overkill. I am requesting that incorrect compiler behavior be removed.