Paul Gerver created BEAM-4227:
---------------------------------

             Summary: Hidden annotation does not hide methods from help text
                 Key: BEAM-4227
                 URL: https://issues.apache.org/jira/browse/BEAM-4227
             Project: Beam
          Issue Type: Bug
          Components: sdk-java-core
    Affects Versions: 2.4.0
            Reporter: Paul Gerver
            Assignee: Kenneth Knowles


The javadoc for *@Hidden* mentions that it hides methods and/or interfaces, but 
the filtering of *@Hidden* for *--help* only works for interfaces while methods 
with the annotation are still visible.

 

For example, in *PipelineOptions* the optionsId getter is set with the *Hidden* 
annotation, but when *–help* is executed, it appears in the list:
{noformat}
org.apache.beam.sdk.options.PipelineOptions:

  --jobName=<String>
    Default: JobNameFactory
    Name of the pipeline execution.It must match the regular expression
    '[a-z]([-a-z0-9]{0,38}[a-z0-9])?'.It defaults to
    ApplicationName-UserName-Date-RandomInteger
  --optionsId=<long>
    Default: AtomicLongFactory
  ...
  --userAgent=<String>
    Default: UserAgentFactory
  ...{noformat}
A proper fix should be skip methods marked with the Hidden class when 
performing print help [1]. Additionally, a test should be added to 
*PipelineOptionsReflectorTest* [2] or factory test.

[1] 
[https://github.com/apache/beam/blob/19bdad654550958f5749ebfcedc3981240127b05/sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java#L581]
 [2] 
[https://github.com/apache/beam/blob/48f9cce76cf87ffe7073c3ad9c34a9f2f6de4b76/sdks/java/core/src/test/java/org/apache/beam/sdk/options/PipelineOptionsReflectorTest.java#L120]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to