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
I noticed that calling ForwardingAudience#audiences generates a warning in my IDE that the method is annotated with @OverrideOnly. What is the purpose of making this method, in particular, annotated with @OverrideOnly? In my case, I wanted to make a new ForwardingAudience implementation whose audiences() is based on a manipulation of another ForwardingAudience's audiences(), while preserving the ability to run operations on specific audiences in the Iterable.
I have broader questions about the use of @OverrideOnly. It is easy to compile calls to these methods considering there is no compiler warning due to their usage. From a perspective of pure API compatibility, are these methods considered equal to any other, even when they are called?
The text was updated successfully, but these errors were encountered:
To answer the original question directly, @kashike on Discord stated that the purpose was to discourage iterating over audiences() to invoke operations on the underlying audiences directly and instead promote the correct style of calling methods on the Audience directly. The method, by necessity, is exposed since there has to be a way to supply audiences to the forwarding functions in ForwardingAudience.
Perhaps you'd like to open a discussion changing ForwardingAudience itself, and if so, that's fine. I don't have any real problems with ForwardingAudience as it is now (speaking as a developer of a platform that uses Adventure natively).
I noticed that calling
ForwardingAudience#audiences
generates a warning in my IDE that the method is annotated with@OverrideOnly
. What is the purpose of making this method, in particular, annotated with @OverrideOnly? In my case, I wanted to make a new ForwardingAudience implementation whoseaudiences()
is based on a manipulation of another ForwardingAudience'saudiences()
, while preserving the ability to run operations on specific audiences in the Iterable.I have broader questions about the use of @OverrideOnly. It is easy to compile calls to these methods considering there is no compiler warning due to their usage. From a perspective of pure API compatibility, are these methods considered equal to any other, even when they are called?
The text was updated successfully, but these errors were encountered: