Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2486

ClassLoaderJavaClassDescription.isA does not work under certain circumstances



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: maven-scr-plugin-1.4.4
    • Fix Version/s: maven-scr-plugin-1.6.0
    • Component/s: SCR Tooling
    • Labels:


      Consider two bundles B1 and B2. B1 provides an abstract component AC1. This abstract component declares itself to implement Service S by means of
      @scr.service interface="S"
      No AC1 does not itself implement S but it extends a baseclass which in turn implements S.

      This bundle B1 builds perfectly and the SCR plugin generates the descriptor for the abstract component.

      Now, B2 provides a concrete component CC2 extending AC1. B2 fails to build while trying to generate the SCR descriptor.

      The reason for this is, that while generating descriptor for CC2, the exsting service descriptor for AC1 is validated, particularly the service element. This element is checked in the context of the abstract AC1 component class internally represented by a ClassLoaderJavaClassDescriptor instance. To verify the interface, the isA(String) method is called.

      This is where the problem occurrs: The ClassLoaderJavaClassDescriptor.isA method only considers the interfaces directly implemented by the class but not any interfaces implemented by the parent class. Moreover, this implementation does not allow for classes (as opposed to interfaces) to be used as service interface name.

      The fix is probably to use Class.isAssignableFrom to implement the isA method.




            • Assignee:
              fmeschbe Felix Meschberger
              fmeschbe Felix Meschberger
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: