[ 
https://issues.apache.org/jira/browse/WICKET-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897424#action_12897424
 ] 

Hudson commented on WICKET-2964:
--------------------------------

Integrated in Apache Wicket 1.5.x #219 (See 
[http://hudson.zones.apache.org/hudson/job/Apache%20Wicket%201.5.x/219/])
    WICKET-2964 Improve the code that uses copy-list-on-iterate pattern

Remove the copying of the map's values before iterating over them.
>From java.util.concurrent.ConcurrentHashMap.values() javadoc:

The view's returned <tt>iterator</tt> is a "weakly consistent" iterator that
will never throw {...@link java.util.ConcurrentModificationException},
and guarantees to traverse elements as they existed upon
construction of the iterator, and may (but is not guaranteed to)
reflect any modifications subsequent to construction.

It seems the copying was there from the days before "modifiableToEntry" became 
ConcurrentHashMap


> Improve the code that uses copy-list-on-iterate pattern 
> --------------------------------------------------------
>
>                 Key: WICKET-2964
>                 URL: https://issues.apache.org/jira/browse/WICKET-2964
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket, wicket-auth-roles, wicket-datetime, 
> wicket-examples, wicket-extensions, wicket-guice, wicket-jmx, wicket-portlet, 
> wicket-quickstart, wicket-spring
>    Affects Versions: 1.4.9, 1.5-M1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.4.11, 1.5-M2
>
>
> http://www.zeroturnaround.com/blog/copy-on-iterate-java-idiom-considered-broken/
>  describes a problem in ArrayList constructor in JDK1.5 and less that they 
> debugged in a Wicket application.
> We can easy improve it by using the "simple solution":
> for (Iterator i = Arrays.asList(collection.toArray()).iterator(); 
> i.hasNext();)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to