[
https://jira.jboss.org/jira/browse/WELD-311?page=com.atlassian.jira.plugi...
]
Pete Muir closed WELD-311.
--------------------------
Resolution: Cannot Reproduce Bug
I can't reproduce this issue (please see ).
I think what you are seeing is that the producers field object sticks around between
requests. This is entirely correct:
__Request 1__
- request for @TenTemp Temp
- ProducerField: HelloWorld is created, and Temp instance (let's call it instance1)
assigned to the field when the object is created and used as produced value
- ProducerMethod: HelloWorld is created, and producer method called (which creates an
new instance, instance1) and used as produced value
__Request 2__
- request for @TenTemp Temp
- ProducerField: HelloWorld is retrieved (it is session scoped), and Temp instance
(instance1) is already assigned to the field, it is used as produced value
- ProducerMethod: HelloWorld is created, and producer method called (which creates an
new instance, instance2) and used as produced value
Producer field behavior differs from producer method
----------------------------------------------------
Key: WELD-311
URL:
https://jira.jboss.org/jira/browse/WELD-311
Project: Weld
Issue Type: Bug
Components: Producers (Methods, Fields and Disposers)
Affects Versions: 1.0.0.CR1
Environment: Ubuntu 9.10, Java 6.
Reporter: alberto Gori
Assignee: Pete Muir
Priority: Critical
Fix For: 1.0.1.CR1
This producer field inject a Temp object into the request scope, corretly.
@Named @SessionScoped
public class HelloWorld implements Serializable {
@Produces @RequestScoped @TenTemp
public Temp getTemp() {
return new Temp(10);
}
}
The same producer written as a field create a session scoped object (note that the main
bean is session scoped too) instead of request scoped.
@Named @SessionScoped
public class HelloWorld implements Serializable {
@Produces @RequestScoped @TenTemp Temp t = new Temp(10);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira