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.
When I have a class which implements java.lang.Iterable and I search for usages (alt+F7) of its method iterator(), no place with the appropriate for-each loop is found.
Can you, please, provide the sample of code where is this bug visible? Thanks
public class NetbeansBug234348 implements Iterable { public java.util.Iterator iterator() { return new java.util.Iterator() { public boolean hasNext() { return false; } public Object next() { throw new java.util.NoSuchElementException(); } public void remove() { throw new UnsupportedOperationException(); } }; } public static void main(String[] args) { int i=0; for (Object o : new NetbeansBug234348()) { i++; } System.out.println("size: "+i); } }
*** Bug 249506 has been marked as a duplicate of this bug. ***