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

Summary: "Enhanced 'for'" syntax shows error for user-defined Iterable
Product: ide Reporter: nuttycombe <nuttycombe>
Component: CodeAssignee: issues@ide <issues>
Status: RESOLVED INVALID    
Severity: blocker    
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

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.