| Summary: | Save Action "Remove Unecessary casts" also remove some casts necessary for overload resolution | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Sebastien Arod <sebastien.arod> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | stephan.herrmann |
| Version: | 4.5 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
In fact with the simple snippet I provided this works fine. I'll try to find a better case to reproduce. Ok just forget it. The problem occured between chair and keyboard... My case were using several parameters and one of the method had the parameters in a different order... |
Using the following snippet: void handle(Object object) { if (object instanceof ClassA) { handle((String) object); } else if (object instanceof ClassB) { handle((ClassB) object); } } void handle(ClassA object) { ... } void handle(ClassB object) { ... } Remove unecessary cast removes the cast in the first method changing the behavior of the code... This makes this feature highly dangerous to use.