[ 
https://issues.apache.org/jira/browse/FLINK-25043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17448571#comment-17448571
 ] 

Ingo Bürk commented on FLINK-25043:
-----------------------------------

I would tend to agree that it isn't optimal that the original package-private 
usage is flagged, but if the violation is resolved with some care (as they all 
should), this wouldn't really be a problem; one would remove the public 
(violating) usage, recognize that the internal usage is fine and reduce the 
method's visibility again.

In any case, other than the initially captured violations this is theoretical 
anyway: if a method is now made public producing a violation, that change 
should ideally not be merged in the first place.

> Allow calls to public @VisibleForTesting from the same package
> --------------------------------------------------------------
>
>                 Key: FLINK-25043
>                 URL: https://issues.apache.org/jira/browse/FLINK-25043
>             Project: Flink
>          Issue Type: Improvement
>          Components: Tests
>            Reporter: Chesnay Schepler
>            Priority: Major
>             Fix For: 1.15.0
>
>
> Consider a class having some package-private method that is used by other 
> classes in said package.
> If this method is then needed from outside the package, and thus made public 
> and annotated with VisibleForTesting, then the architecture tests currently 
> flag the original usage as well.
> We could think about allowing package-private access if the method is public.
> On the other hand, if the method was originally annotated with 
> VisibleForTesting, then marking it as public would remove a violation, which 
> would be incorrect.
> Maybe we need to extend our VisibleForTesting annotation to provide this 
> information.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to