mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Fixed ConcurrentModificationException
This commit is contained in:
@@ -21,6 +21,9 @@ import com.google.appengine.api.channel.ChannelMessage;
|
|||||||
import com.google.appengine.api.channel.ChannelServiceFactory;
|
import com.google.appengine.api.channel.ChannelServiceFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
@@ -92,8 +95,9 @@ public class SendServlet extends HttpServlet {
|
|||||||
boolean reqDebug = "1".equals(reqInfo.getParameter("debug"));
|
boolean reqDebug = "1".equals(reqInfo.getParameter("debug"));
|
||||||
|
|
||||||
int ac2dmCnt = 0;
|
int ac2dmCnt = 0;
|
||||||
|
Iterator<DeviceInfo> iterator = reqInfo.devices.iterator();
|
||||||
for (DeviceInfo deviceInfo : reqInfo.devices) {
|
while (iterator.hasNext()) {
|
||||||
|
DeviceInfo deviceInfo = iterator.next();
|
||||||
if ("ac2dm".equals(deviceInfo.getType())) {
|
if ("ac2dm".equals(deviceInfo.getType())) {
|
||||||
ac2dmCnt++;
|
ac2dmCnt++;
|
||||||
}
|
}
|
||||||
@@ -130,7 +134,7 @@ public class SendServlet extends HttpServlet {
|
|||||||
if ("InvalidRegistration".equals(ex.getMessage())) {
|
if ("InvalidRegistration".equals(ex.getMessage())) {
|
||||||
// Prune device, it no longer works
|
// Prune device, it no longer works
|
||||||
reqInfo.deleteRegistration(deviceInfo.getDeviceRegistrationID());
|
reqInfo.deleteRegistration(deviceInfo.getDeviceRegistrationID());
|
||||||
reqInfo.devices.remove(deviceInfo);
|
iterator.remove();
|
||||||
ac2dmCnt--;
|
ac2dmCnt--;
|
||||||
} else {
|
} else {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|||||||
Reference in New Issue
Block a user