This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The editor marks any "for ( i : iterable ) { ... }" expression as error with "foreach not applicable to expression type" if the iterable isn't a subclass of Collection. Editor must recognize any object that implements java.lang.Iterable.
Are you able to compile your file?? The error annotations in the editor come directly from javac, it is quite unlikely there would be a bug.
Compilation works fine - no errors, no warnings. I use Java 1.5 beta2.
I can also reliably reproduce it. I will attach a source. It is compilable, however editor reports an error at line 18. Tom, please look at it.
Created attachment 17170 [details] test case - file containing "for (Object i : iterable)"
foreach statements with an Iterable type were incorrectly flagged as errors. This was due to javac using -target for its test instead of -source, and -target wasn't being set since we don't generate any classfiles.
Reorganization of java component