Hi guys,
ive written the following method.
its supposed to delete objects in a LinkedList.
These objects implicit Connections to other objects.
if one object is deleted all the connections in the other objects should be deleted as well.
all in all this code should do what I want. the only problem is that i get an ConcurrentModif icationExceptio n running it.
in the API it says
unfortunately I cant figure out the problem
would be great if anybody can help.!
Thanks very much
ive written the following method.
its supposed to delete objects in a LinkedList.
These objects implicit Connections to other objects.
if one object is deleted all the connections in the other objects should be deleted as well.
all in all this code should do what I want. the only problem is that i get an ConcurrentModif icationExceptio n running it.
in the API it says
This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.
would be great if anybody can help.!
Thanks very much
Code:
public void removeEntry(AddressBookEntry en) throws AddressBookException{
LinkedList<Connection> temp;
temp = en.getConnections();
if(!temp.isEmpty()){
for(Connection con : temp){
en.deleteConnection(con);
}
}
entries.remove(en);
}
Comment