TheNeuralBit commented on a change in pull request #15648:
URL: https://github.com/apache/beam/pull/15648#discussion_r730096144



##########
File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/renderer/PortablePipelineDotRenderer.java
##########
@@ -104,8 +102,8 @@ private void exitBlock() {
     indent -= 4;
   }
 
-  @FormatMethod
-  private void writeLine(@FormatString String format, Object... args) {
+  @SuppressWarnings("AnnotateFormatMethod")
+  private void writeLine(String format, Object... args) {

Review comment:
       Awesome, thanks!
   
   Could you update these to use the common dependency defined in 
BeamModulePlugin.groovy: 
https://github.com/apache/beam/blob/52a178f0a66829bbd1d99fcaf70921a8bd9300f6/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L537
   
   Should be able to use `compileOnly library.java.errorprone_annotations`

##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
##########
@@ -2396,6 +2396,7 @@ ErrorReporter forParameter(ParameterDescription param) {
               "parameter of type %s at index %s", format(param.getType()), 
param.getIndex()));
     }
 
+    @SuppressWarnings("AnnotateFormatMethod")

Review comment:
       I think that's a legitimate error being caught by the 
`AnnotateFormatMethod` check. Could you try changing 
https://github.com/apache/beam/blob/52a178f0a66829bbd1d99fcaf70921a8bd9300f6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java#L899-L904
   
   to:
   ```
         errors.checkArgument( 
             isBounded == null, 
             "Non-splittable, but annotated as @%s", 
              ((isBounded == PCollection.IsBounded.BOUNDED) 
                   ? format(DoFn.BoundedPerElement.class) 
                   : format(DoFn.UnboundedPerElement.class))); 
   ```

##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java
##########
@@ -2396,6 +2396,7 @@ ErrorReporter forParameter(ParameterDescription param) {
               "parameter of type %s at index %s", format(param.getType()), 
param.getIndex()));
     }
 
+    @SuppressWarnings("AnnotateFormatMethod")

Review comment:
       I think that's a legitimate error being caught by the 
`AnnotateFormatMethod` check. Could you try changing 
https://github.com/apache/beam/blob/52a178f0a66829bbd1d99fcaf70921a8bd9300f6/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java#L899-L904
   
   to:
   ```java
         errors.checkArgument( 
             isBounded == null, 
             "Non-splittable, but annotated as @%s", 
              ((isBounded == PCollection.IsBounded.BOUNDED) 
                   ? format(DoFn.BoundedPerElement.class) 
                   : format(DoFn.UnboundedPerElement.class))); 
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to