Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 189505 - Trouble with Netbeans 6.9.x on different OSes regarding foreach loop, overloading methods and error marked files with no line listed as cause of the error
Trouble with Netbeans 6.9.x on different OSes regarding foreach loop, overloa...
Product: java
Classification: Unclassified
Component: Editor
Macintosh (x86) Mac OS X
: P4 (vote)
Assigned To: Dusan Balek
Depends on:
  Show dependency treegraph
Reported: 2010-08-14 06:35 UTC by jak777
Modified: 2016-07-07 07:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description jak777 2010-08-14 06:35:52 UTC
Have similar problem with Netbeans 6.9 and 6.9.1. With 6.9 it was installed on Mac OS X Snow Leopard (64 bit Intel) with the latest version of java made by Apple (1.6.0_20). With 6.9.1 it was installed on Red Hat Linux (64 bit Intel) also java (1.6.0_20). In both cases, it was using the same code and had the same errors. The first error is "foreach not applicable to expression type", the next refers to the iterator method not existing and a completely unrelated bug will appear noted on some other files with no line flagged. I have gotten it to compile successfully by returning to Netbeans 6.8 on the Red Hat machine and same with the Mac. The code looks like this.

public interface IteratorInterface<T> extends Iterator<T>, Iterable<T> {}

public abstract class IteratorAbstract<T> implements IteratorInterface<T>
   IteratorAbstract<T> iterator()

public class SomeIterator extends IteratorAbstract<String>
//ignoring other methods for simplicity they are actually all filled out
//including the constructor.

   public static void main(String args[])
       for (String s : new SomeIterator("a", "b", "c"))

I don't know whether the proposed solutions works for my case as I am not quite sure what it is or how to complete it, but I do know reverting to the old version has worked.
Comment 1 Jaroslav Tulach 2014-11-05 09:30:10 UTC
I don't see a reason this should be an API review.
Comment 2 Martin Balin 2016-07-07 07:16:34 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo