Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Impacts both the activate/deactivate methods and the bind/unbind methods
The scenario where this happens is when the parent class has an activate/deactivate/bind/unbind method with one set of arguments and the subclass has an activate/deactivate/bind/unbind method with the same name but with a different set of arguments.
For example, when the context.registerInjectActivateService(..) call is invoked, it finds the activate(Map) method from the parent class and invokes it and then returns instead of calling the more specific activate(Config) methods from the subclass.
public class ParentComponent { protected void activate(Map<String, Object> props) { // this should not be invoked when activating SubComponent } } @Component @Designate(ocd=SubComponent.Config.class) public class SubComponent extends ParentComponent { @ObjectClassDefinition(name = "SubComponent Config") public @interface Config { @AttributeDefinition(name = "Prop One") boolean prop1() default true; } @Activate protected void activate(Config cfg) { // should be invoked when activating } }
Attachments
Issue Links
- links to