[jbosstools-issues] [JBoss JIRA] (JBIDE-10583) ClassCastException while CDIProject.getBeans() is working

Jaroslav Jankovič (JIRA) jira-events at lists.jboss.org
Wed Feb 29 07:45:36 EST 2012


     [ https://issues.jboss.org/browse/JBIDE-10583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jaroslav Jankovič closed JBIDE-10583.
-------------------------------------



There is no exception and TestBean.foo is correctly not found in JBoss Tools 3.3.0.Beta1b-H93. Verified and closing.
                
> ClassCastException while CDIProject.getBeans() is working
> ---------------------------------------------------------
>
>                 Key: JBIDE-10583
>                 URL: https://issues.jboss.org/browse/JBIDE-10583
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: CDI
>    Affects Versions: 3.3.0.Beta1
>            Reporter: Daniel Azarov
>            Assignee: Viacheslav Kabanovich
>             Fix For: 3.3.0.Beta1
>
>
> EXECUTE: Create two CDI projects: ProjectA and ProjectB. ProjectB depends on ProjectA.
> EXECUTE: Create a bean in ProjectA:
> {code}
> @Named("cdiBean")
> public class CDIBeanTest {
> }
> {code}
> EXECUTE: Create another bean in ProjectB:
> {code}
> public class TestBean {
>     @Inject @Named("cdiBean") Object foo;
> }
> {code}
> EXECUTE: Close ProjectB
> EXECUTE: Select CDIBeanTest class name in CDIBeanTest.java and press Ctrl+Shift+G
> Two results were found:
> 1. Exception:
> {code}
> java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.classfmt.AnnotationInfo cannot be cast to org.eclipse.jdt.internal.core.SourceRefElementInfo
> 	at org.eclipse.jdt.internal.core.SourceRefElement.getSourceRange(SourceRefElement.java:218)
> 	at org.eclipse.jdt.internal.core.Annotation.getSourceRange(Annotation.java:121)
> 	at org.jboss.tools.common.java.impl.JavaAnnotation.getStartPosition(JavaAnnotation.java:68)
> 	at org.jboss.tools.common.java.impl.AnnotationDeclaration.getStartPosition(AnnotationDeclaration.java:84)
> 	at org.jboss.tools.cdi.internal.core.impl.AbstractBeanElement.getRestrictedTypeDeclarations(AbstractBeanElement.java:292)
> 	at org.jboss.tools.cdi.internal.core.impl.ClassBean.getLegalTypes(ClassBean.java:348)
> 	at org.jboss.tools.cdi.internal.core.impl.CDIProject.getBeans(CDIProject.java:372)
> 	at org.jboss.tools.cdi.ui.search.CDIBeanQueryParticipant.searchInProject(CDIBeanQueryParticipant.java:96)
> 	at org.jboss.tools.cdi.ui.search.CDIBeanQueryParticipant.search(CDIBeanQueryParticipant.java:73)
> 	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery$2.run(JavaSearchQuery.java:164)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:170)
> 	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91)
> 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> {code}
> 2. TestBean.foo is found as an injection point and can be opened in external editor

--
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