]
Alexey Kazakov reassigned JBIDE-17811:
--------------------------------------
Assignee: Jeff MAURY (was: Alexey Kazakov)
Incorrect bean injection eligibility assumption for beans excluded
using DeltaSpike @Exclude
--------------------------------------------------------------------------------------------
Key: JBIDE-17811
URL:
https://issues.jboss.org/browse/JBIDE-17811
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: cdi-extensions
Environment: JBDS 8.0.0.Beta2d
Reporter: Ron Šmeral
Assignee: Jeff MAURY
Fix For: LATER
With the following classes on the classpath:
{code:java|title=DeactivatableTest.java}
@Inject
private MyBean myBean;
{code}
{code:java|title=MyBean.java}
@Exclude
public class MyBean {}
{code}
{code:java|title=ExcludeExtensionDeactivator.java}
public class ExcludeExtensionDeactivator implements ClassDeactivator {
public Boolean isActivated(Class<? extends Deactivatable> targetClass {
if (ExcludeExtension.class.equals(targetClass)) {
return false;
}
return null;
}
}
{code}
..the injection point in DeactivatableTest is marked with a warning:
{noformat}
No bean is eligible for injection to the injection point [JSR-299 §5.2.1] {noformat}
..which is incorrect. MyBean *is* eligible despite being annotated @Exclude, since
ExcludeExtension is deactivated using the core DeltaSpike mechanism of deactivation
(ClassDeactivator).
There does not seem to be a (simple) solution to this other than executing the code in
all available ClassDeactivators.