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 62333 - "Enhanced 'for'" syntax shows error for user-defined Iterable
Summary: "Enhanced 'for'" syntax shows error for user-defined Iterable
Status: RESOLVED INVALID
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-15 22:37 UTC by nuttycombe
Modified: 2005-08-17 17:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nuttycombe 2005-08-15 22:37:46 UTC
The "enhanced for" loop syntax shows a compilation error in the code editor (red
underlining) for user-defined Iterable classes, although the code compiles
correctly.

ex:

class MyIterable<Elem> implements Iterable<Elem> {
    public Iterator<Elem> iterator() {
        ...
    }
}

for (Elem e : new MyIterable()) { // <- this line would be underlined in red
    ...
}
Comment 1 Milan Kubec 2005-08-17 09:11:52 UTC
The code you provided deosn't compile for me, please provide code snipet or
whole class that shows the problem, Thanks.
Comment 2 nuttycombe 2005-08-17 17:16:13 UTC
Okay, in creating a complete test example for this error I discovered that it
may be related to Mevenide integration, because I cannot reproduce the problem
reliably in a standard NetBeans project but it appears consistently in Maven
projects. I will file a bug report with the Mevenide folks.
Comment 3 nuttycombe 2005-08-17 17:41:23 UTC
Never mind, this problem is fixed in the latest version of the mevenide plugin.