Skip to content

Commit 5303d33

Browse files
committed
refactor type coercion
1 parent 99ca7e5 commit 5303d33

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎java/srcPubnubApi/com/pubnub/api/PubnubCore.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ public void setState(String channel, String uuid, JSONObject state, Callback cal
975975
"data"
976976
};
977977
if (state != null) parameters.put("state", state.toString());
978-
SubscriptionItem ch = (SubscriptionItem) channelSubscriptions.getItem(channel);
978+
SubscriptionItem ch = channelSubscriptions.getItem(channel);
979979
if (ch != null) {
980980
try {
981981
channelSubscriptions.state.put(channel, state);
@@ -1993,7 +1993,7 @@ public void subscribeGroup(String group, Callback callback,
19931993

19941994
private void callErrorCallbacks(String[] channelList, PubnubError error) {
19951995
for (String channel : channelList) {
1996-
Callback cb = ((SubscriptionItem) channelSubscriptions.getItem(channel)).callback;
1996+
Callback cb = channelSubscriptions.getItem(channel).callback;
19971997
cb.errorCallback(channel, error);
19981998
}
19991999
}
@@ -2042,7 +2042,7 @@ private void _subscribe(Hashtable args) {
20422042
*/
20432043

20442044
for (String channel : channelList) {
2045-
SubscriptionItem channelObj = channelSubscriptions.getItem(channel);
2045+
Channel channelObj = (Channel) channelSubscriptions.getItem(channel);
20462046

20472047
if (channelObj == null) {
20482048
Channel ch = new Channel(channel, callback);
@@ -2052,7 +2052,7 @@ private void _subscribe(Hashtable args) {
20522052
}
20532053

20542054
for (String group : groupList) {
2055-
SubscriptionItem channelGroupObj = channelGroupSubscriptions.getItem(group);
2055+
ChannelGroup channelGroupObj = (ChannelGroup) channelGroupSubscriptions.getItem(group);
20562056

20572057
if (channelGroupObj == null) {
20582058
ChannelGroup chg = new ChannelGroup(group, callback, this);

0 commit comments

Comments
 (0)