flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephan Ewen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6444) Add a check that '@VisibleForTesting' methods are only used in tests
Date Thu, 21 Sep 2017 09:25:00 GMT

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

Stephan Ewen commented on FLINK-6444:

Cool, thanks for picking this up.

Would be interested to hear what approach you want to take.

Spontaneously, I could think of two ways to approach that
  - See if there is a way to define a "Spotbugs" rule
  - Use the Reflections library to check and enforce that. We use it in a similar way to make
sure that no string construction happens without explicit charset. See for example here: https://github.com/apache/flink/blob/9bd491e05120915cbde36d4452e3982fe5d0975f/flink-tests/src/test/java/org/apache/flink/test/manual/CheckForbiddenMethodsUsage.java

> Add a check that '@VisibleForTesting' methods are only used in tests
> --------------------------------------------------------------------
>                 Key: FLINK-6444
>                 URL: https://issues.apache.org/jira/browse/FLINK-6444
>             Project: Flink
>          Issue Type: Improvement
>          Components: Build System
>            Reporter: Stephan Ewen
>            Assignee: Hai Zhou_UTC+8
> Some methods are annotated with {{@VisibleForTesting}}. These methods should only be
called from tests.
> This is currently not enforced / checked during the build. We should add such a check.

This message was sent by Atlassian JIRA

View raw message