[
https://issues.jboss.org/browse/JBIDE-7665?page=com.atlassian.jira.plugin...
]
Daniel Azarov updated JBIDE-7665:
---------------------------------
Description:
This quick fix should offer next:
1. Delete @Disposes/@Observes annotation
2. Delete @Produces annotation
Test case:
EXECUTE: Create CDI project
EXECUTE: Create TestBean class
{code}
package org.test;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Produces;
public class TestBean {
@Produces
public String produceString(@Observes String aa){
return "test";
}
}
{code}
ASSERT: @Produces and @Observes annotations should be marked by problem markers
EXECUTE: Point mouse to @Produces or @Observes annotation
ASSERT: Text hover with quick fixes appears
EXECUTE: Create TestBean2 class
{code}
package org.test;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
public class TestBean2 {
@Produces
public String produceString(@Disposes String aaa){
return "test";
}
}
{code}
ASSERT: @Produces and @Disposes annotations should be marked by problem markers
EXECUTE: Point mouse to @Produces or @Disposes annotation
ASSERT: Text hover with quick fixes appears
was:
This quick fix should offer next:
1. Delete @Disposes/@Observes annotation
2. Delete @Produces annotation
Test case:
EXECUTE: Create CDI project
EXECUTE: Create TestObserverProducerMethod class
{code}
package org.jboss.jsr299.tck.tests.jbt.quickfixes;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Produces;
public class TestObserverProducerMethod {
@Produces
public String produceString(@Observes String aa){
return "test";
}
}
{code}
ASSERT: @Produces and @Observes annotations should be marked by problem markers
EXECUTE: Point mouse to @Produces or @Observes annotation
ASSERT: Text hover with quick fixes appears
EXECUTE: Create TestDisposerProducerMethod class
{code}
package org.jboss.jsr299.tck.tests.jbt.quickfixes;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
public class TestDisposerProducerMethod {
@Produces
public String produceString(@Disposes String aaa){
return "test";
}
}
{code}
ASSERT: @Produces and @Disposes annotations should be marked by problem markers
EXECUTE: Point mouse to @Produces or @Disposes annotation
ASSERT: Text hover with quick fixes appears
Quick fix for "Producer method has a parameter annotated
@Disposes/@Observes [JSR-299 §3.3.2]" error markers
------------------------------------------------------------------------------------------------------------
Key: JBIDE-7665
URL:
https://issues.jboss.org/browse/JBIDE-7665
Project: Tools (JBoss Tools)
Issue Type: Sub-task
Components: cdi
Reporter: Daniel Azarov
Assignee: Alexey Kazakov
Labels: new_and_noteworthy
Fix For: 3.3.x
Attachments: DisposerInProducer1.png, DisposerInProducer2.png,
ObserverInProducer1.png, ObserverInProducer2.png
This quick fix should offer next:
1. Delete @Disposes/@Observes annotation
2. Delete @Produces annotation
Test case:
EXECUTE: Create CDI project
EXECUTE: Create TestBean class
{code}
package org.test;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Produces;
public class TestBean {
@Produces
public String produceString(@Observes String aa){
return "test";
}
}
{code}
ASSERT: @Produces and @Observes annotations should be marked by problem markers
EXECUTE: Point mouse to @Produces or @Observes annotation
ASSERT: Text hover with quick fixes appears
EXECUTE: Create TestBean2 class
{code}
package org.test;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
public class TestBean2 {
@Produces
public String produceString(@Disposes String aaa){
return "test";
}
}
{code}
ASSERT: @Produces and @Disposes annotations should be marked by problem markers
EXECUTE: Point mouse to @Produces or @Disposes annotation
ASSERT: Text hover with quick fixes appears
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira