From 8ed70084db6d97523fc3c3d8d4a861e64d4aa6c6 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sat, 29 Dec 2012 13:31:31 +0000
Subject: [PATCH] catch iterator exception on java 5

---
 .../net/i2p/router/transport/udp/EstablishmentManager.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java b/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
index 6cfa3cdc33..155fe569b7 100644
--- a/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
+++ b/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
@@ -611,7 +611,9 @@ class EstablishmentManager {
 
             Map.Entry<RemoteHostId, List<OutNetMessage>> entry = iter.next();
             // java 5 IllegalStateException here
-            iter.remove();
+            try {
+                iter.remove();
+            } catch (IllegalStateException ise) {}
             RemoteHostId to = entry.getKey();
             List<OutNetMessage> allQueued = entry.getValue();
             List<OutNetMessage> queued = new ArrayList();
-- 
GitLab