The following obviously incorrect code (inspired by @dexter's answer to a question of mine):
Class<? extends Exception>[] exceptions;
try {
// some stuff here
} catch (exceptions[0] e) {
// some more stuff here
}
causes Eclipse to frequently pop up a dialog box titled "Problem Occurred" with the following message:
'Building workspace' has encountered a problem.
Errors occurred during the build.
The dialog offers the following 'Details':
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'test'.
org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to
org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
Eclipse does place red squiggles under exceptions[0]
, but if I mouse over them, it doesn't have any error associated with them. Instead, it also places a red (x) in the very top of the margin and squiggles the first letter of the first line in the file (the p
in package ...
) and if I mouse over that, I get:
Internal compiler error: java.lang.ClassCastException:
org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to
org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding at
org.eclipse.jdt.internal.compiler.ast.TryStatement.verifyDuplicationAndOrder
(TryStatement.java:1191)
Is this a bug in Eclipse? If so, what's the best place to report it?
Also (to make this question it useful to someone who runs into the same issue), is there a good way to locate the source of such a build error, if it's buried somewhere deep in the code? The only information I get from the error messages is the project name in the details of the dialog, which may not be too helpful if there are many other problems with the project (taking over someone else's work, for example). Are there other places, where I can find more information about the exact location of this error, like at least a file-name?