MacOSX build 701 - anonymous class compiler bug

This class compiles and runs fine via command line. IDEA thows "cannot resolve symbol class Contents" compiler errors.


public class Test {

public Contents cont() {

return new Contents() {
private int i = 11;
public int value() { return i; }
};

}

public static void main(String[] args) {
Test p = new Test();
Contents c = p.cont();
System.out.println( "c.value( = " + c.value());
}

} ///:~

2 comments

Hm, IDEA has changed it's mind. It compiles and runs now.

0

Axel Muench <jiveadmin@jetbrains.com> wrote:

Hm, IDEA has changed it's mind. It compiles and runs now.


Sometimes the compiler seems to get confused after refactorings (.class
files do not match the .java hierarchy). A recompile or manually
deleting the class files should help.

I didn't file a bug for that because:
- it only happens once in a while
- I am not sure how much of it is my fault (I am compiling with the
integrated compiler and with Ant to the same classes directory)

Dirk Dittert

0

Please sign in to leave a comment.