[
https://issues.apache.org/jira/browse/HBASE-24640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17239010#comment-17239010
]
Duo Zhang commented on HBASE-24640:
-----------------------------------
I would say that on a IA.Private class it is fine to add VisibleForTesting
annotation? It is not about API, it is just a hint to developers. Of course a
javadoc would almost archive the same goal but I do not see the necessarity to
disable the usage of a common usage in the java world where it is not so
critical.
Anyway, I'm fine with the current patch as it is difficult to filter out
IA.Public and IA.LimitedPrivate class and only remove the VisibleForTesting on
these classes.
I will try to see if we could have some ways to disable the usage of this
annotation on IA.Public classes as well as IA.LimitedPrivate classes. If this
could be done, then I think it is OK for us to use it for IA.Private class
then. If not, maybe we could just add a strict rule to disable all the usage of
VisibleForTesting, and tell developers the reason is because we want to prevent
this usage from our public API but there is no simple way to this check
automatically so we decide to disable the usage through the whole code base.
Thanks.
> Purge use of VisibleForTesting
> ------------------------------
>
> Key: HBASE-24640
> URL: https://issues.apache.org/jira/browse/HBASE-24640
> Project: HBase
> Issue Type: Task
> Components: community
> Affects Versions: 3.0.0-alpha-1, 2.4.0
> Reporter: Nick Dimiduk
> Assignee: Andrew Kyle Purtell
> Priority: Major
> Fix For: 3.0.0-alpha-1, 1.7.0, 2.4.0
>
>
> From the dev-list thread ["[DISCUSS] VisibleForTesting annotation as it
> pertains to our API compatibility
> guidelines"|https://lists.apache.org/thread.html/rc7c7c66f134fe135d0a4454a883215e26ff3d20e5a31ecd6a2d1db77%40%3Cdev.hbase.apache.org%3E],
> when used in classes annotated with interface audience other than
> IA.Private, the VisibleForTesting annotation is confusing and considered
> harmful. The consensus is that we do not want to use this annotation as part
> of the definition of our public APIs, and we need to remove the point of
> confusion.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)