aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (JIRA)" <>
Subject [jira] [Commented] (ARIES-1481) blueprint-maven-plugin: fix detection of inherited @OsgiService/@PersistenceContext/Unit-annotated fields
Date Tue, 12 Jan 2016 15:16:39 GMT


Christian Schneider commented on ARIES-1481:

I am not sure if FieldUtil is correct. It simply returns a list of all fields from all classes.

Imagine the case where you have a field a in a class A and as well in class B and A extends
B. The current code will return two fields. I am not sure if this is correct. Probably we
would like to only show the field from class A. 

What do you think?

> blueprint-maven-plugin: fix detection of inherited @OsgiService/@PersistenceContext/Unit-annotated
> ---------------------------------------------------------------------------------------------------------
>                 Key: ARIES-1481
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Sam Wright
>            Assignee: Christian Schneider
>             Fix For: blueprint-maven-plugin-1.4.0
> Fields inherited from parent classes annotated with @Inject are properly detected by
blueprint-maven-plugin, but the presence of @OsgiService,
> @PersistenceContext, and @PersistenceUnit annotations on fields declared in parent classes
is ignored.
> This is because @Inject-annotated fields are found in the Bean.resolve(Matcher) method
which recursively searches all parent classes for declared fields, whereas @PersistenceContext/Unit-annotated
fields are discovered in Bean.getPersistenceFields() by simply using the fields declared in
the bean class. Similarly, @OsgiService-annotated fields are discovered in Context.addServiceRefs(Class)
by looking through the fields declared in the bean class.
> This commit extracts the field-getting algorithm used for finding
> @Inject fields to a utility method which is used for finding fields for the other
> annotations.

This message was sent by Atlassian JIRA

View raw message