File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/java/com/arangodb/internal/net Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 66import java .io .IOException ;
77import java .util .ArrayList ;
88import java .util .Collections ;
9+ import java .util .Iterator ;
910import java .util .List ;
1011
1112public class HostSet {
@@ -75,15 +76,17 @@ public void clearAllMarkedForDeletion() {
7576
7677 LOGGER .debug ("Clear all Hosts in Set with markForDeletion" );
7778
78- for (Host host : hosts ) {
79+ Iterator <Host > iterable = hosts .iterator ();
80+ while (iterable .hasNext ()){
81+ Host host = iterable .next ();
7982 if (host .isMarkforDeletion ()) {
8083 try {
81-
8284 LOGGER .debug ("Try to close Host " + host );
8385 host .close ();
84-
8586 } catch (IOException e ) {
8687 LOGGER .warn ("Error during closing the Host " + host , e );
88+ } finally {
89+ iterable .remove ();
8790 }
8891 }
8992 }
You can’t perform that action at this time.
0 commit comments