You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre De Rop (JIRA)" <ji...@apache.org> on 2016/09/15 22:53:20 UTC
[jira] [Comment Edited] (FELIX-5346) Start annotation not
propagated to sub classes
[ https://issues.apache.org/jira/browse/FELIX-5346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15494761#comment-15494761 ]
Pierre De Rop edited comment on FELIX-5346 at 9/15/16 10:52 PM:
----------------------------------------------------------------
Jago,
can you please give a try to this attached patch (the svn diff has been done in the dependencymanager/ directory on org.apache.felix.dependencymanager.annotation sub project).
Notice that it should also work with scala (the scanner stops scanning inherited class if the class is "java.lang.object" or "scala/ScalaObject")
the remaining things to implement are:
1) possibly detect if the inherited class is outside the bundle of the extension class. but I'm not sure it's possible. if it's possible then I think an error should be thrown, in order to avoid potential issues (like BJ explained in his post).
2) ignores inherited annotation in case they are overriden in child/extension class
for example:
{code}
class Base {
@Start
void init() {}
}
class Extension extends Base {
@Start
void anotherStart() {}
}
{code}
currently, the patch uses the inherited @Start, not the one from the extension class (will do that a bit later).
In the meantime, I would be interested to know if it works in your environment ?
thank you.
was (Author: pderop):
Jago,
can you please give a try to this attached patch (the svn diff has been done in the dependencymanager/ directory on org.apache.felix.dependencymanager.annotation sub project).
Notice that it should also work with scala (the scanner stops scanning inherited class if the class is "java.lang.object" or "scala/ScalaObject")
the remaining things to implement are:
1) possibly detect if the inherited class is outside the bundle of the extension class. but I'm not sure it's possible. if it's possible then I think an error should be thrown, in order to avoid potential issues (like BJ explained in his post).
2) ignores inherited annotation in case they are overriden in child/extension class
for example:
{code}
class Base {
@Start
void init() {}
}
class Extension extends Base {
@Start
void anotherStart() {}
}
{code}
currently, the patch uses the inherited @Init, not the one from the extension class (will do that a bit later).
In the meantime, I would be interested to know if it works in your environment ?
thank you.
> Start annotation not propagated to sub classes
> ----------------------------------------------
>
> Key: FELIX-5346
> URL: https://issues.apache.org/jira/browse/FELIX-5346
> Project: Felix
> Issue Type: Improvement
> Components: Dependency Manager Annotations
> Reporter: Jago de Vreede
> Assignee: Pierre De Rop
> Attachments: FELIX-5346.patch
>
>
> Following case in pseudocode:
> {code}Class A {
> @Start
> public void start() {
> System.out.println("start");
> }
> }
> @Component
> Class B extends A {
> }{code}
> When you run this nothing is printed but the start method in A should be called as B extends A.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)