You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/03 21:10:33 UTC

[GitHub] [beam] kennknowles opened a new issue, #18873: Hidden annotation does not hide methods from help text

kennknowles opened a new issue, #18873:
URL: https://github.com/apache/beam/issues/18873

   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:
   ```
   
   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
     ...
   ```
   
   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](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](https://github.com/apache/beam/blob/48f9cce76cf87ffe7073c3ad9c34a9f2f6de4b76/sdks/java/core/src/test/java/org/apache/beam/sdk/options/PipelineOptionsReflectorTest.java#L120)
   
   Imported from Jira [BEAM-4227](https://issues.apache.org/jira/browse/BEAM-4227). Original Jira may contain additional context.
   Reported by: pgerv12.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org