Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#8767 closed enhancement (fixed)

Inherit interfaces from all superclasses

Reported by: Remy Blank Owned by: Remy Blank
Priority: low Milestone: 0.12
Component: general Version: none
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When a component class is created, its interfaces are looked up in the class itself and in its direct superclasses. This means that a component class does not inherit the interfaces from its parent's parent, for example.

An example of this pathology can be found in the ticket admin panels. PriorityAdminPanel inherits from AbstractEnumAdminPanel which in turn inherits from TicketAdminPanel. The interfaces declared in TicketAdminPanel must be re-declared in AbstractEnumAdminPanel, otherwise they are not inherited by PriorityAdminPanel.

I believe this is an oversight, and interfaces should be inherited by all superclasses.

Attachments (1)

8767-interface-inheritance-r8684.patch (2.3 KB ) - added by Remy Blank 15 years ago.
Inherit interfaces from all superclasses.

Download all attachments as: .zip

Change History (6)

comment:1 by Remy Blank, 15 years ago

Small correction: the issue occurs if GrandParent implements an interface, Parent implements another one, and Child implements a third one. In that case, Child doesn't implement the interface of GrandParent.

by Remy Blank, 15 years ago

Inherit interfaces from all superclasses.

comment:2 by Remy Blank, 15 years ago

The patch above fixes the issue, and adds a test case for this situation.

Thoughts?

comment:3 by Christian Boos, 15 years ago

I tried to see if the current behavior could be useful somehow, but didn't see any real benefit, so I think it's OK to do that change.

comment:4 by Remy Blank, 15 years ago

Resolution: fixed
Status: newclosed

Patch applied in [8685].

comment:5 by Remy Blank, 15 years ago

[8694] ensures that a component isn't registered more than once as implementing an interface. This could happen in code relying on the old behavior.

It also removes an obsolete test that wasn't working anyway.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.