[
https://issues.jboss.org/browse/JBIDE-7638?page=com.atlassian.jira.plugin...
]
Jaroslav Jankovič closed JBIDE-7638.
------------------------------------
Verified with jbdevstudio-product-universal-5.0.0.v201205272317M-H143-CR1.
Quick fix for "Injection point other than injected field must
not declare a @Named annotation that does not specify the value member [JSR-299
§3.11]" error marker
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBIDE-7638
URL:
https://issues.jboss.org/browse/JBIDE-7638
Project: Tools (JBoss Tools)
Issue Type: Sub-task
Components: CDI
Reporter: Daniel Azarov
Assignee: Daniel Azarov
Labels: new_and_noteworthy
Fix For: 3.3.0.Beta1
Attachments: AddNameQFX.png
This quick fix should offer to add generated name as value member to @Named annotation
Test case:
EXECUTE:
1. Create CDI Project
2. Create java classes:
{code}
import javax.inject.Named;
@Named("order")
public class Order {
}
{code}
{code}
import javax.inject.Named;
@Named("order2")
public class Order2 extends Order {
}
{code}
{code}
import javax.inject.Inject;
import javax.inject.Named;
public class TestBean {
@Inject public void init(@Named Order order) {
// DO nothing
}
}
{code}
3. Build project
4. Open TestBean class in Java Editor
ASSERT: annotation @Named should be marked with problem "Injection point other than
injected field must not declare a @Named annotation that does not specify the value member
[JSR-299 §3.11]"
EXECUTE: Point mouse to annotation @Named and press Ctrl
ASSERT: Quick fixes should be shown in Pop Up menu:
!AddNameQFX.png!
EXECUTE: select one of quick fixes
ASSERT: annotation @Named should be changed to @Named("oreder") or
@Named("order2") accordingly
--
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