gemini-code-assist[bot] commented on code in PR #37792:
URL: https://github.com/apache/beam/pull/37792#discussion_r2912715792


##########
sdks/java/io/datadog/src/main/java/org/apache/beam/sdk/io/datadog/DatadogEventPublisher.java:
##########
@@ -263,7 +263,7 @@ public Builder withApiKey(String apiKey) {
      * @param maxElapsedMillis max elapsed time in milliseconds for timeout.
      * @return {@link Builder}
      */
-    public Builder withMaxElapsedMillis(Integer maxElapsedMillis) {
+    public Builder withMaxElapsedMillis(int maxElapsedMillis) {
       checkNotNull(
           maxElapsedMillis, "withMaxElapsedMillis(maxElapsedMillis) called 
with null input.");

Review Comment:
   ![critical](https://www.gstatic.com/codereviewagent/critical.svg)
   
   Since `maxElapsedMillis` is now a primitive `int`, it can't be null. This 
`checkNotNull` call is redundant and will cause a compilation error. It should 
be removed.



##########
sdks/java/extensions/zetasketch/src/main/java/org/apache/beam/sdk/extensions/zetasketch/ApproximateCountDistinct.java:
##########
@@ -186,14 +186,14 @@ public abstract static class PerKey<K, V>
     @AutoValue.Builder
     public abstract static class Builder<K, V> {
 
-      public abstract Builder<K, V> setPrecision(Integer precision);
+      public abstract Builder<K, V> setPrecision(int precision);
 
       public abstract Builder<K, V> setMapping(Contextful<Fn<KV<K, V>, KV<K, 
Long>>> value);
 
       public abstract PerKey<K, V> build();
     }
 
-    public <K2, V2> PerKey<K2, V2> withPercision(Integer withPercision) {
+    public <K2, V2> PerKey<K2, V2> withPercision(int withPercision) {
       // Work around for loss of type inference when using API.
       @SuppressWarnings("unchecked")
       PerKey<K2, V2> perKey = (PerKey<K2, V2>) 
this.toBuilder().setPrecision(withPercision).build();

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   There's a typo in the method name (`withPercision`) and the parameter name 
(`withPercision`). They should be `withPrecision` and `precision` respectively.
   
   ```suggestion
       public <K2, V2> PerKey<K2, V2> withPrecision(int precision) {
         // Work around for loss of type inference when using API.
         @SuppressWarnings("unchecked")
         PerKey<K2, V2> perKey = (PerKey<K2, V2>) 
this.toBuilder().setPrecision(precision).build();
   ```



##########
sdks/java/extensions/zetasketch/src/main/java/org/apache/beam/sdk/extensions/zetasketch/ApproximateCountDistinct.java:
##########
@@ -130,7 +130,7 @@ public Globally<T> via(ProcessFunction<T, Long> fn) {
       return toBuilder().setMapping(Contextful.<T, Long>fn(fn)).build();
     }
 
-    public <V> Globally<V> withPercision(Integer withPercision) {
+    public <V> Globally<V> withPercision(int withPercision) {
       @SuppressWarnings("unchecked")
       Globally<V> globally = (Globally<V>) 
toBuilder().setPrecision(withPercision).build();

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   There's a typo in the method name (`withPercision`) and the parameter name 
(`withPercision`). They should be `withPrecision` and `precision` respectively.
   
   ```suggestion
       public <V> Globally<V> withPrecision(int precision) {
         @SuppressWarnings("unchecked")
         Globally<V> globally = (Globally<V>) 
toBuilder().setPrecision(precision).build();
   ```



-- 
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