Error highlighting: False positive(?)

This code is marked as wrong ("section" is underlined red) saying
"foreach not applicable to type y.option.OptionSection".
But OptionSection extends Vector - so I think it should work (and it
compiles).

for ( Object sectionItem : section ) {
}

Any comments?


Johannes Schneider

4 comments
Comment actions Permalink

Check your JDK. If it's 1.4, the Vector doesn't extend Iterable, and IDEA is right to complain. Otherwise, it's a very surprising bug.

--Dave Griffith

0
Comment actions Permalink

It is also a well-known problem with multijdk projects.

0
Comment actions Permalink

Eugene Vigdorchik wrote:

It is also a well-known problem with multijdk projects.


Now I also know it (well)...

0
Comment actions Permalink

Still in most cases it should not happen, and if you could consolidate a small project where this could be reproduced, I would certainly look into the problem.

0

Please sign in to leave a comment.