This is an automated email from the ASF dual-hosted git repository.

jinmeiliao pushed a commit to branch feature/GEODE-7665
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 919bbc2df267a96fe35f9cd1f8f1651cc0bf23dc
Author: Kirk Lund <[email protected]>
AuthorDate: Fri Apr 9 15:22:46 2021 -0700

    GEODE-9132: Fixup PartitionResponse constructors
    
    * Chain constructors to only one constructor that calls super
    * Expose all arguments for dependency injection
    * Provide type to recipients
---
 .../cache/partitioned/PartitionMessage.java        | 32 ++++++++++++++--------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
index 8ebc4da469..ab83538354 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.internal.cache.partitioned;
 
+import static java.util.Collections.singleton;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -22,6 +24,7 @@ import java.util.Set;
 
 import org.apache.logging.log4j.Logger;
 
+import org.apache.geode.CancelCriterion;
 import org.apache.geode.CancelException;
 import org.apache.geode.InternalGemFireError;
 import org.apache.geode.InternalGemFireException;
@@ -760,24 +763,31 @@ public abstract class PartitionMessage extends 
DistributionMessage
      */
     boolean responseRequired;
 
-    public PartitionResponse(InternalDistributedSystem dm, Set initMembers) {
-      this(dm, initMembers, true);
+    protected PartitionResponse(InternalDistributedSystem dm,
+        Set<InternalDistributedMember> recipients) {
+      this(dm, recipients, true);
     }
 
-    public PartitionResponse(InternalDistributedSystem dm, Set initMembers, 
boolean register) {
-      super(dm, initMembers);
-      if (register) {
-        register();
-      }
+    protected PartitionResponse(InternalDistributedSystem system,
+        Set<InternalDistributedMember> recipients, boolean register) {
+      this(system.getDistributionManager(), system, recipients, 
system.getCancelCriterion(),
+          register);
+    }
+
+    protected PartitionResponse(InternalDistributedSystem system,
+        InternalDistributedMember member) {
+      this(system.getDistributionManager(), system, singleton(member), 
system.getCancelCriterion());
     }
 
-    public PartitionResponse(InternalDistributedSystem dm, 
InternalDistributedMember member) {
-      this(dm, member, true);
+    protected PartitionResponse(DistributionManager dm, 
InternalDistributedSystem system,
+        Set<InternalDistributedMember> recipients, CancelCriterion 
cancelCriterion) {
+      this(dm, system, recipients, cancelCriterion, true);
     }
 
-    public PartitionResponse(InternalDistributedSystem dm, 
InternalDistributedMember member,
+    private PartitionResponse(DistributionManager dm, 
InternalDistributedSystem system,
+        Set<InternalDistributedMember> recipients, CancelCriterion 
cancelCriterion,
         boolean register) {
-      super(dm, member);
+      super(dm, system, recipients, cancelCriterion);
       if (register) {
         register();
       }

Reply via email to