[ 
https://issues.apache.org/jira/browse/FELIX-468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Felix Meschberger updated FELIX-468:
------------------------------------

    Attachment: FELIX-468.patch

Patch implementing a Comparator to sort the list of JavaClassDescriptors to be 
handled by the plugin.

> Duplicate Bind and Unbind methods may be created
> ------------------------------------------------
>
>                 Key: FELIX-468
>                 URL: https://issues.apache.org/jira/browse/FELIX-468
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: 1.0.2
>            Reporter: Felix Meschberger
>         Attachments: FELIX-468.patch
>
>
> Consider an abstract base class BC and a concrete extension CC of the base 
> class. The base class BC defines a reference and has the SCR plugin generate 
> the bind/unbind methods. The extension class CC inherits the reference 
> definition but the bind/unbind methods need not be created as they already 
> exist on the base class.
> The SCR plugin correctly handles this situation if the base class BC is 
> treated before the extension class CC. If first the extension class CC is 
> handled, the base class has not be handled yet, so the bind/unbind methods 
> will be generated on the extension class. Next the base class is handled and 
> the bind/unbind methods are created again.
> Clearly the definition of the bind/unbind methods on the extension class is 
> not needed - and may even result in runtime errors if the bind/unbind methods 
> in the extension class are created to access private fields of the base class 
> intended for use by the base class bind/unbind methods.
> This only happens if both the base class and the extension class are located 
> in the same project. The proposed solution to this issue is to sort the 
> classes to be handled according to their inheritence to ensure handling base 
> classes before their extensions.
> Will provide a patch for this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to