Bug 11218 - Missing type compiler error message is vague and on line 0
Summary: Missing type compiler error message is vague and on line 0
Status: RESOLVED DUPLICATE of bug 61706
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-12 17:34 EST by Peter Burka CLA
Modified: 2004-05-24 12:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Burka CLA 2002-03-12 17:34:28 EST
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.
Comment 1 Philipe Mulet CLA 2002-03-13 07:18:19 EST
Error message improvement.
Will consider post 2.0.
Comment 2 Philipe Mulet CLA 2004-05-24 12:46:45 EDT
Addressed recently in M9, source line is pointed at.
Comment 3 Philipe Mulet CLA 2004-05-24 12:48:03 EDT

*** This bug has been marked as a duplicate of 61706 ***