mutianf commented on code in PR #28122:
URL: https://github.com/apache/beam/pull/28122#discussion_r1304672738


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceFactory.java:
##########
@@ -105,8 +106,12 @@ BigtableServiceEntry getServiceForReading(
       BigtableServiceEntry entry = entries.get(configId.id());
       if (entry != null) {
         // When entry is not null, refCount.get(configId.id()) should always 
exist.
-        // Do a getOrDefault to avoid unexpected NPEs.
-        refCounts.getOrDefault(configId.id(), new 
AtomicInteger(0)).getAndIncrement();
+        Preconditions.checkNotNull(
+            refCounts.get(configId.id()),

Review Comment:
   I don't thnk i'm able to remove the suppress(nullness) annotation on the 
class. If I removed it doing:
   
   ```
         BigtableServiceEntry entry = entries.get(configId.id());
         if (entry != null) {
   ```
   
   Won't 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