Summary: | ClassCastException in ProblemBinding | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Gunnar Wagenknecht <gunnar> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.1 | ||
Target Milestone: | 2.1 M5 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Gunnar Wagenknecht
2002-12-23 04:27:45 EST
Would you have a simple test case that can reproduce the problem? sorry, can't remeber The cast should not be done if the binding is a problem binding. Looking at the source code, it looks like we missed a case in which we have to return a INACCURATE_MATCH. I suggest: case BindingIds.TYPE : //=============only type ============== if (binding instanceof ProblemBinding) { return INACCURATE_MATCH; } typeBinding = (TypeBinding)binding; break; instead of: case BindingIds.TYPE : //=============only type ============== typeBinding = (TypeBinding)binding; break; What do you think? Thanks Olivier. Protection added. I don't know the sourc background but why not doing a more stricter protection? case BindingIds.TYPE : //=============only type ============== if (!(binding instanceof TypeBinding)) { return INACCURATE_MATCH; } typeBinding = (TypeBinding)binding; break; Right. I released the change. Verified. |