This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line! See this thread for details.
You cannot modify the Collection with the enhanced for loop. Here you are removing elements (poll()) from the Queue within the enhanced for loop. Try using Iterator instead. [ September 04, 2008: Message edited by: Vijitha Kumara ]
I read somewhere that if you add or delete any element from a queue, then any iterator created before the insertion or deletion is invalidated and calling any method on the iterator will cause ConcurrentModificationException