Skip to content

Commit 0f07a69

Browse files
author
Max Presman
committed
sync on the state methods
1 parent b5d43a6 commit 0f07a69

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/main/java/com/pubnub/api/managers/StateManager.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public final synchronized void adaptUnsubscribeBuilder(final UnsubscribeOperatio
9797
}
9898
}
9999

100-
public Map<String, Object> createStatePayload() {
100+
public final synchronized Map<String, Object> createStatePayload() {
101101
Map<String, Object> stateResponse = new HashMap<>();
102102

103103
for (SubscriptionItem channel: channels.values()) {
@@ -115,19 +115,19 @@ public Map<String, Object> createStatePayload() {
115115
return stateResponse;
116116
}
117117

118-
public List<String> prepareChannelList(final boolean includePresence) {
118+
public synchronized List<String> prepareChannelList(final boolean includePresence) {
119119
return prepareMembershipList(channels, presenceChannels, includePresence);
120120
}
121121

122-
public List<String> prepareChannelGroupList(final boolean includePresence) {
122+
public synchronized List<String> prepareChannelGroupList(final boolean includePresence) {
123123
return prepareMembershipList(groups, presenceGroups, includePresence);
124124
}
125125

126-
public boolean isEmpty() {
126+
public synchronized boolean isEmpty() {
127127
return (channels.isEmpty() && presenceChannels.isEmpty() && groups.isEmpty() && presenceGroups.isEmpty());
128128
}
129129

130-
private List<String> prepareMembershipList(final Map<String, SubscriptionItem> dataStorage,
130+
private synchronized List<String> prepareMembershipList(final Map<String, SubscriptionItem> dataStorage,
131131
final Map<String, SubscriptionItem> presenceStorage,
132132
final boolean includePresence) {
133133
List<String> response = new ArrayList<>();

0 commit comments

Comments
 (0)