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.

Bug 48005 - [gjast] no syntax support for foreach on arbitrary iterable objects
Summary: [gjast] no syntax support for foreach on arbitrary iterable objects
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: _ tball
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-26 15:42 UTC by keil
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test case - file containing "for (Object i : iterable)" (299 bytes, text/plain)
2004-08-26 17:47 UTC, Martin Matula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description keil 2004-08-26 15:42:34 UTC
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.
Comment 1 Martin Matula 2004-08-26 16:54:34 UTC
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.
Comment 2 keil 2004-08-26 17:15:39 UTC
Compilation works fine - no errors, no warnings. I use Java 1.5 beta2.
Comment 3 Martin Matula 2004-08-26 17:45:26 UTC
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.
Comment 4 Martin Matula 2004-08-26 17:47:14 UTC
Created attachment 17170 [details]
test case - file containing "for (Object i : iterable)"
Comment 5 _ tball 2004-09-01 20:30:12 UTC
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.
Comment 6 Quality Engineering 2007-09-20 12:09:19 UTC
Reorganization of java component