Inconsistent classfile encountered: The undefined type parameter K is referenced from within Foo

From JavaErrors

Jump to: navigation, search

This seems to be a compiler bug or artifact rather than a true syntax error. Something is clearly wrong, but that something is not directly related to the class displaying the error (hereafter C), or to Foo or to K. (See discussion on bug tracker.)

In the two cases I've encountered it (in Eclipse 3.3 with JDK 1.5 (latest)) there were no errors in the type hierarchy of C or of Foo. In one case Foo wasn't even in the class graph*. In both cases the error disappeared when I eliminated compile errors from the source folder. In the one case the error disappeared spontaneously when most other errors were eliminated. In the other case (where there was a reference to Foo within C) the error did not disappear spontaneously when all compile errors were eliminated. But it did disappear when I deleted all import statements for other classes in the source folder, saved (to force a re-build), and re-established them using <ctrl-shift-O>.

It would be instructive to find an example of this error occurring with no other compile errors in the project or source folder.


  • Class graph: The set of classes including C that are explicitly referenced by C plus classes those classes reference, etc.