https://github.com/infinispan/infinispan/pull/1899#commitcomment-3420141

Technically this could be done in the if statement and it wouldn't allocate the object except if the local node is the primary even, since the variable is only referenced from other locations in the if block.