DonalEvans commented on a change in pull request #6625:
URL: https://github.com/apache/geode/pull/6625#discussion_r653846451



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
##########
@@ -404,15 +402,25 @@ void send(TXLockId lockId) {
                 
setRecipientsSendData(Collections.singleton(indivRecip.next()), processor, rcl);
               }
             } else {
-              if (this.notificationOnlyMembers.isEmpty()) {
+              HashSet tempNotificationOnlyMembers = new HashSet();
+              if (!rcl.isEmpty() && !getNotificationOnlyMembers().isEmpty()) {
+                for (RegionCommit rc : rcl) {
+                  Set getNOM = getNotificationOnlyMembers().get(rc);

Review comment:
       Warnings about raw uses of parameterized classes here can be fixed by 
using:
   ```
                 Set<InternalDistributedMember> tempNotificationOnlyMembers = 
new HashSet<>();
                 if (!rcl.isEmpty() && !getNotificationOnlyMembers().isEmpty()) 
{
                   for (RegionCommit rc : rcl) {
                     Set<InternalDistributedMember> getNOM = 
getNotificationOnlyMembers().get(rc);
   ```
   It would also be great if you could do similar clean-up throughout the rest 
of the method while you're modifying it. If we all clean up as we make changes, 
the codebase improves little by little and we can hopefully save a lot of time 
down the road if we ever decide to do a major clean-up.

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionState.java
##########
@@ -319,14 +319,17 @@ void buildMessage(InternalRegion r, TXCommitMessage msg) {
     try {
       if (!r.getScope().isLocal() && !this.entryMods.isEmpty()) {
 
-        msg.startRegion(r, entryMods.size());
+        TXCommitMessage.RegionCommit regionCommit = msg.startRegion(r, 
entryMods.size());
         Iterator it = this.entryMods.entrySet().iterator();
         Set<InternalDistributedMember> newMemberSet = new 
HashSet<InternalDistributedMember>();
+        Set<InternalDistributedMember> redundantMemberSet =
+            new HashSet<InternalDistributedMember>();

Review comment:
       This can be just `new HashSet<>();`

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/TXRegionState.java
##########
@@ -335,9 +338,16 @@ void buildMessage(InternalRegion r, TXCommitMessage msg) {
           TXEntryState txes = (TXEntryState) me.getValue();
           txes.buildMessage(r, eKey, msg, this.otherMembers);
           if (txes.getFilterRoutingInfo() != null) {
-            msg.setNotificationOnlyMembers(txes.getAdjunctRecipients());
+            HashSet tempSet = new HashSet(txes.getAdjunctRecipients());

Review comment:
       Warnings here can be fixed by using
   ```
   Set<InternalDistributedMember> tempSet = new 
HashSet<>(txes.getAdjunctRecipients());
   ```
   Also, is it possible that `txes.getAdjunctRecipients()` could return null 
here, causing an NPE?




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