Summary: | Provide default methods for IContentProvider | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Lars Vogel <Lars.Vogel> |
Component: | UI | Assignee: | Lars Vogel <Lars.Vogel> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | alex.blewitt, brian.vosburgh, bsd, daniel_megert, Lars.Vogel, markus.kell.r, simon.scholz, sxenos, tom.schindl |
Version: | 4.6 | Keywords: | noteworthy |
Target Milestone: | 4.6 M6 | ||
Hardware: | PC | ||
OS: | Linux | ||
See Also: |
https://git.eclipse.org/r/56214 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=62372d7c5cb099ed3286d3fa138c186eb42cbf2d |
||
Whiteboard: | |||
Bug Depends on: | 477774 | ||
Bug Blocks: | 477782 |
Description
Lars Vogel
2015-09-18 05:05:50 EDT
New Gerrit change created: https://git.eclipse.org/r/56214 Gerrit change https://git.eclipse.org/r/56214 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=62372d7c5cb099ed3286d3fa138c186eb42cbf2d Just in case you did not know: Defining a default implementation for an interface is not completely harmless. :-) This change caused a compile error in Dali (bug 488427). This is because Dali has an interface (StructuredStateProvider) that indirectly extends IContentProvider and IBaseLabelProvider; and IBaseLabelProvider also defines a dispose() method. The compile error reads like this: The default method dispose() inherited from IContentProvider conflicts with another method inherited from IBaseLabelProvider The "fix" was to define a default implementation of dispose() in StructuredStateProvider. Well I just ran into this as well and I have to say the abuse of "default" methods is completely inappropriate. They have been invented so provide new features and not to implement convenient APIs. A problem i see in our code base now is that people are implementing an interface are not forced to implement the dispose-method because this default-implementation hides it from them. I know this ship has sailed a long time ago but I think adding default-methods just to provide convenience methods needs to be discussed |