[
https://issues.apache.org/jira/browse/GEODE-3591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16244817#comment-16244817
]
ASF GitHub Bot commented on GEODE-3591:
---------------------------------------
dschneider-pivotal closed pull request #1027: GEODE-3591: remove getAnyInstance
call
URL: https://github.com/apache/geode/pull/1027
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
index 0394f65916..fee23ae780 100644
---
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
+++
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
@@ -1150,7 +1150,8 @@ private void
enqueueInterestRegistrationMessage(ClientInterestMessageImpl messag
if (Version.GFE_701.compareTo(this.clientVersion) > 0
&& message.getKeyOfInterest() instanceof List) {
for (Iterator i = ((List) message.getKeyOfInterest()).iterator();
i.hasNext();) {
- this._messageDispatcher.enqueueMessage(new
ClientInterestMessageImpl(message, i.next()));
+ this._messageDispatcher.enqueueMessage(
+ new ClientInterestMessageImpl(getCache().getDistributedSystem(),
message, i.next()));
}
} else {
this._messageDispatcher.enqueueMessage(message);
diff --git
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientInterestMessageImpl.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientInterestMessageImpl.java
index 3fbd30a9d7..f1b82d1362 100755
---
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientInterestMessageImpl.java
+++
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientInterestMessageImpl.java
@@ -19,6 +19,7 @@
import org.apache.geode.DataSerializer;
import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.DataSerializableFixedID;
import org.apache.geode.internal.Version;
import org.apache.geode.internal.cache.EventID;
@@ -109,8 +110,9 @@ public ClientInterestMessageImpl(EventID eventId, String
regionName, Object keyO
this.action = action;
}
- public ClientInterestMessageImpl(ClientInterestMessageImpl message, Object
keyOfInterest) {
- this.eventId = new
EventID(CacheFactory.getAnyInstance().getDistributedSystem());
+ public ClientInterestMessageImpl(DistributedSystem distributedSystem,
+ ClientInterestMessageImpl message, Object keyOfInterest) {
+ this.eventId = new EventID(distributedSystem);
this.regionName = message.regionName;
this.keyOfInterest = keyOfInterest;
this.interestType = message.interestType;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> ClientInterestMessageImpl constructor should not call
> CacheFactory.getAnyInstance
> ---------------------------------------------------------------------------------
>
> Key: GEODE-3591
> URL: https://issues.apache.org/jira/browse/GEODE-3591
> Project: Geode
> Issue Type: Sub-task
> Components: client queues
> Reporter: Darrel Schneider
> Assignee: Darrel Schneider
> Fix For: 1.4.0
>
>
> The constructor is calling it to get the distributed system.
> The only caller of this constructor is:
> org.apache.geode.internal.cache.tier.sockets.CacheClientProxy.enqueueInterestRegistrationMessage(ClientInterestMessageImpl)
> and it could instead just pass the distributed system in by passing
> "this._cache.getDistributedSystem()".
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)