| Summary: | Possible ClassCastExceptions in ManageProvidedInterfacesHandler for BDD and IBD. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Papyrus | Reporter: | Alain Le Guennec <alain.leguennec> | ||||
| Component: | Core | Assignee: | Project Inbox <mdt-papyrus-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse-bugzilla, yann.tanguy | ||||
| Version: | 0.8.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
(1) I, Alain LE GUENNEC, wrote 100% of the code I've provided. (2) This code contains no cryptography (3) I have the right to contribute the code to Eclipse. (4) I contribute the content under the EPL. Applied in r5316 - r5317 - r5318 (trunk & 0.8.1) |
Created attachment 202232 [details] Proposed patch to fix the issue. The code for isEnabled() for these two occurrences of ManageProvidedInterfacesHandler is incorrect and can lead to ClassCastExceptions. Indeed, the code first checks if the selection is instanceOf Port, but even if it is not, it then goes on casting to Port anyway a few line after, instead of returning false right away. See attached patch for proposed fix.