Community
Participate
Working Groups
Created three projects, ZZ1, ZZ2 and ZZ3. In ZZ2, include ZZ1 on the build path. In ZZ3, include ZZ2 on its build path. In ZZ1, define the following class: package pkg1; public class Foo extends Exception { } In ZZ2 define the following class: package pkg2; import pkg1.Foo; public class Bar { public Bar() throws Foo { throw new Foo(); } } In ZZ3 define the following class: package pkg3; import pkg2.Bar; public class Baz { public static void main(String[] args) throws Throwable { new Bar(); } } An error will be recorded against the last class (Baz): Report for 1 markers: Marker 1: Resource: /ZZ3/pkg3/Baz.java, Line: 0 Message: This compilation unit indirectly references the missing type pkg1.Foo (typically some required class file is referencing a type outside the classpath) Marker type: org.eclipse.jdt.core.problem Priority: Normal #1 - the error should be reported against the offending line. In a large java file it's not clear where the error is. #2 - the error should be more clear. Tell me how I'm indirectly referencing the missing type. (e.g. "The constructor Bar() is declared to throw an exception of type pkg1.Foo. The type could not be found on the build path") #3 - my code is correct, and technically the compiler doesn't need to find Foo to verify that #4 - the error message refers to the classpath, but on the properties page for the project it is called the buildpath. I think that I understand why this is an error, but it took me a while to figure it out.
Error message improvement. Will consider post 2.0.
Addressed recently in M9, source line is pointed at.
*** This bug has been marked as a duplicate of 61706 ***