| Summary: | FilterDescription#compareTo can throw a ClassCastException | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Marco Massenzio <mmassenzio> |
| Component: | Resources | Assignee: | Platform-Resources-Inbox <platform-resources-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Szymon.Brandys |
| Version: | 4.1 | ||
| Target Milestone: | 3.7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
It was fixed in 3.7. |
Build Identifier: M20100909-0800 The cast in compareTo is not protected by a test on instanceof: public int compareTo(Object o) { FilterDescription that = (FilterDescription) o; IPath path1 = this.getResource().getProjectRelativePath(); // ... } hence, if we compare a FilterDescription object to something other another FilterDescription, a ClassCastException will be thrown. Reproducible: Always Steps to Reproduce: 1. create a new FileDescription fd 2. execute fd.compareTo(new Foo()); 3. ClassCastException is thrown