lukecwik commented on a change in pull request #12029:
URL: https://github.com/apache/beam/pull/12029#discussion_r442363272



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/FnApiStateAccessor.java
##########
@@ -124,12 +124,14 @@ public FnApiStateAccessor(
     return new Supplier<ResultT>() {
       private ArgT memoizedArg;
       private ResultT memoizedResult;
+      private boolean initialized;
 
       @Override
       public ResultT get() {
         ArgT currentArg = arg.get();
-        if (currentArg != memoizedArg) {
+        if (currentArg != memoizedArg || (currentArg == null && !initialized)) 
{

Review comment:
       The initialized will become true and will stay true so checking 
`currentArg == null` won't do anything.
   ```suggestion
           if (currentArg != memoizedArg || !initialized) {
   ```




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

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


Reply via email to