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...
Status: NEW
Product: java
Classification: Unclassified
Component: Editor
6.x
Macintosh (x86) Mac OS X
: P4 (vote)
: TBD
Assigned To: Dusan Balek
issues@java
: API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-14 06:35 UTC by jak777
Modified: 2011-11-16 16:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

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>
{
...
   @Override
   IteratorAbstract<T> iterator()
   {
       return(this);
   }
...
}

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"))
           System.out.println(s);
   }
}

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.


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