Community
Participate
Working Groups
If inner classes are specified in import statement, they are flagged as errors WHEN: the inner classes come from either 1. interface or 2. super class. To reproduce: create Foo.java with inner public class InnerFoo create Bar.java that implements Foo.java create Baz.java that has import statement as: import Bar.InnerFoo; Javac does not complain about abocve setup. Eclipse does not complain if all inner classes are in Baz.java. Thanks. Jay.
I have tried inheriting the inner type from an interface & a superclass... javac 1.3 doesn't except either import statements. Which version of javac are you running? Can you paste in the exact source files so there is no confusion please.
Reopen when you have a repeatable case.
Created attachment 2546 [details] Test Case that shows the problem This file contains complete code that shows the problem indicated by this bug report. When compiled outside of Eclipse, all scenarios described in test classes compile and work fine. Inside of Eclipse, however, some imports are flagged as errors.
test case description: there are two packages: 1. test.pkg.one This package contains inheritance and implementation classes needed the test. 2. test.pkg.two This package contains two test files; one for inheritance test and one for implementation test. Both tests have import statements that work with eclipse. Therefore, as is, the code will cause eclipse to flag errors within code. However, when compiled with JDK 131 and JDK 141, both tests compile and run fine.
I think you have found a bug in Sun's compiler. Here is the trace from using javac (both 1.3 & 1.4.1 behave the same): D:\Bug>javac test\pkg\one\Subclass.java test\pkg\one\AbstractClass.java D:\Bug>javac test\pkg\two\InheritanceTest.java NOTE: No problem compiling the test IF the necessary .class files exist for the member types D:\Bug>javac test\pkg\two\InheritanceTest.java test\pkg\one\Subclass.java test\pkg\one\AbstractClass.java test\pkg\two\InheritanceTest.java:7: cannot resolve symbol symbol : class AbstractInnerClassOne location: class test.pkg.one.SubClass import test.pkg.one.SubClass.AbstractInnerClassOne; ^ test\pkg\two\InheritanceTest.java:13: cannot resolve symbol symbol : variable AbstractInnerClassOne location: class test.pkg.two.InheritanceTest System.out.println( AbstractInnerClassOne.NAME ); ^ 2 errors BUT when all 3 source files are compiled together (the .class files still exist), then javac cannot resolve the member type. Our compiler always complains that the member type cannot be resolved.