Project
IntelliJ IDEA
Priority
Normal
Type
Feature
Fix versions
No Fix versions
State
Submitted
Assignee
Bas Leijdekkers
Subsystem
Code Analysis. Inspection
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Eugene Petrenko
    10 months ago (01 Jul 2011 11:51)
  • Updated by   Dmitry Jemerov
    10 months ago (08 Jul 2011 18:03)
 
IDEA-71662 Add inspection to foreach use against Collections#synchronized
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
As we can see in javadoc (say for 1.6)
java.util.Collections#synchronized* methods does not synchronize iterators!

As we can see in spec http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2
java foreach statement uses iterator inside: http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2

Let's make IDEA highlight any usages of iterators and foreach statements for collections instances that were created with java.util.Collections#synchronized*
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments