[jbosstools-issues] [JBoss JIRA] (JBIDE-9989) CDIProject.getBeans(false, injectionPoint) method does not return all CDI Beans from jar file after project rebuilding
Viacheslav Kabanovich (Commented) (JIRA)
jira-events at lists.jboss.org
Fri Oct 21 12:55:45 EDT 2011
[ https://issues.jboss.org/browse/JBIDE-9989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636551#comment-12636551 ]
Viacheslav Kabanovich commented on JBIDE-9989:
----------------------------------------------
Debugging showed that method CDIProject.getBeans(boolean, IInjectionPoint) works in this case exactly as expected. It obtains wrong injection point returned by method CDIUtil.findInjectionPoint(). When looking for injection point by Java field, this method compares field name only, when it tries each bean in the set of beans obtained by the path. But in the case of jars, that set contains all beans defined in the jar. And even for Java source files,multiple class beans may be defined in one file, and different class bean can have equally named fields. In this case the two fields are JarLoggerConsumer.logger and JarTimestampLogger.logger. The second field is the delegate field of the decorator JarTimestampLogger, and when beans injected into it are requested, it (correctly) filters the decorator out of the assignable beans.
> CDIProject.getBeans(false, injectionPoint) method does not return all CDI Beans from jar file after project rebuilding
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: JBIDE-9989
> URL: https://issues.jboss.org/browse/JBIDE-9989
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: CDI
> Affects Versions: 3.3.0.M3
> Reporter: Daniel Azarov
> Assignee: Viacheslav Kabanovich
> Fix For: 3.3.0.Beta1
>
> Attachments: AssignableBeans.png, openon1.png, openon2.png, openon_test.jar
>
>
> Test case:
> 1. Create CDI project
> 2. Put openon_test.jar to project's class path and refresh the project
> 3. Open JarLoggerConsumer from openon_test.jar file in Java Editor
> 4. Point mouse to @Inject annotation and press Ctrl
> ASSERT:
> !openon1.png!
> 5. Clean and rebuild the project
> 6. Point mouse to @Inject annotation and press Ctrl
> FAIL:
> !openon2.png!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list