[jbosstools-issues] [JBoss JIRA] Updated: (JBIDE-9476) Quick fix should be aware of bean producers in case of ambiguous dependency

Alexey Kazakov (JIRA) jira-events at lists.jboss.org
Thu Aug 4 18:08:38 EDT 2011


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

Alexey Kazakov updated JBIDE-9476:
----------------------------------

    Steps to Reproduce: 
EXECUTE: Create a CDI project
EXECUTE: Add the following code to the project:
{code}
@Stereotype
@Named
@Target({ TYPE, METHOD, FIELD })
@Retention(RUNTIME)
@Documented
public @interface TestS {
}
{code}
{code}
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Named;

public class MyBean {

	@Inject	String s; // Ambiguous
	@Inject	@Named String foo3; // OK
	@Inject	@Named("foo3") String s1; // OK

	@Inject	@Named String xyz; // OK
	@Inject	@Named("xyz") String s2; // OK

	@Inject	@Named String abc; // OK
	@Inject	@Named("abc") String s3; // OK

	@Inject	@Named String foo; // OK
	@Inject	@Named("foo") String s4; // OK

	@Inject	@Named String unknownName; // Unsatisfied
	@Inject	@Named("unknownName") String unknownName1; // Unsatisfied

	@Inject	public void doSmth(@Named("foo4") String foo8) {} // Ambiguous: foo4, foo4(), foo5(), foo6()
	@Inject	@Named("foo4") String s5;  // Ambiguous: foo4, foo4(), foo5(), foo6()

	@Produces @TestS // OK
	public String foo() {return "";}

	@Produces @TestS @Named("abc") // OK
	public String foo1;

	@Produces @Named("xyz") // OK
	public String foo2;

	@Produces @Named // OK
	public String foo3() {return "";}

	@Produces @Named // Duplicate EL name
	public String foo4() {return "";}

	@Produces @Named("foo4") // Duplicate EL name
	public String foo5() {return "";}

	@Produces @TestS @Named("foo4")  // Duplicate EL name
	public String foo6() {return "";}

	@Produces @TestS // Duplicate EL name
	public String foo4;

	@Produces // OK
	public String foo7() {return "";}
}
{code}
EXECUTE: Point mouse cursor to the problem marker at @Inject @Named("foo4") String s5;
FAILURE: There is a list of quick fixes for bean "MyBean" instead of correct names: MyBean.foo4, MyBean.foo4(), etc.
!screen.png!

  was:
EXECUTE: Create a CDI project
EXECUTE: Add the following code to the project:
{code}
@Stereotype
@Named
@Target({ TYPE, METHOD, FIELD })
@Retention(RUNTIME)
@Documented
public @interface TestS {
}
{code}
{code}
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Named;

public class MyBean {

	@Inject	String s; // Ambiguous
	@Inject	@Named String foo3; // OK
	@Inject	@Named("foo3") String s1; // OK

	@Inject	@Named String xyz; // OK
	@Inject	@Named("xyz") String s2; // OK

	@Inject	@Named String abc; // OK
	@Inject	@Named("abc") String s3; // OK

	@Inject	@Named String foo; // OK
	@Inject	@Named("foo") String s4; // OK

	@Inject	@Named String unknownName; // Unsatisfied
	@Inject	@Named("unknownName") String unknownName1; // Unsatisfied

	@Inject	public void doSmth(@Named("foo4") String foo8) {} // Ambiguous: foo4, foo4(), foo5(), foo6()
	@Inject	@Named("foo4") String s5;  // Ambiguous: foo4, foo4(), foo5(), foo6()

	@Produces @TestS // OK
	public String foo() {return "";}

	@Produces @TestS @Named("abc") // OK
	public String foo1;

	@Produces @Named("xyz") // OK
	public String foo2;

	@Produces @Named // OK
	public String foo3() {return "";}

	@Produces @Named // Duplicate EL name
	public String foo4() {return "";}

	@Produces @Named("foo4") // Duplicate EL name
	public String foo5() {return "";}

	@Produces @TestS @Named("foo4")  // Duplicate EL name
	public String foo6() {return "";}

	@Produces @TestS // Duplicate EL name
	public String foo4;

	@Produces // OK
	public String foo7() {return "";}
}
{code}
EXECUTE: Point mouse cursor to the problem marker at @Inject @Named("foo4") String s5;
FAILURE: There is a list of quick fixes for bean "MyBean" instead of correct names: MyBean.foo4, MyBean.foo4(), etc.



> Quick fix should be aware of bean producers in case of ambiguous dependency
> ---------------------------------------------------------------------------
>
>                 Key: JBIDE-9476
>                 URL: https://issues.jboss.org/browse/JBIDE-9476
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: cdi
>    Affects Versions: 3.3.0.M3
>            Reporter: Alexey Kazakov
>            Assignee: Daniel Azarov
>             Fix For: 3.3.0.M4
>
>         Attachments: screen.png
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list