I have been trying to implement some practices and good framework for maintaining future code in my servlets, that i have been using in core java.
I feel that i have done everything right to keep the servlet thread safe. Just looking for a second opinion. Always parinoid about locking threads.
Christophe Verré wrote:removeItem removes items from an order which comes from the session. There may cause an ArrayIndexOutOfBounds at itemsToRemove.remove(a);
More of a null pointer i would assume
if EditOrderItems lineItem = itemsToRemove.get(a) has a valid value, itemsToRemove.remove(a); should not thow an out of bounds exception if im not mistaken.
Does the thread safety look ok?
EDIT: I see now what you were talking about: itemsToRemove = order.getEditItems();
Good catch. I will take cae of that too.