Eclipse: ClassFile cannot be cast to ICompilationUnit
Today, checking out from the repository, I got this error message from Eclipse:
org.eclipse.jdt.internal.core.ClassFile cannot be cast to org.eclipse.jdt.core.ICompilationUnit
To save anybody getting the same message from wondering and poking around what it means, here is the simple reason. A colleague had accidentally checked in a .class file in a source folder, causing my Eclipse to try and process (compile) this presumed Java source file.
Deleting it from disk made the problem go away. Thinking about installing a pre-commit hook on the repository server to prevent this from happening again.