[jbosstools-issues] [JBoss JIRA] (JBIDE-7638) 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
Daniel Azarov (JIRA)
jira-events at lists.jboss.org
Thu Jan 12 18:49:27 EST 2012
[ https://issues.jboss.org/browse/JBIDE-7638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Azarov updated JBIDE-7638:
---------------------------------
Description:
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
was:
This quick fix should offer to add generated name as value member to @Named annotation
> 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.4.x
>
> 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
More information about the jbosstools-issues
mailing list