Thursday, January 23, 2014

2 instances of same autobean getting updated simultaneously

Have an autobean created after deserliazing the json response. Then I save it in two different files to the classmembers with getter and setter
Class A
MyBean bean = null;
public MyBean getBean()
{
   this.MyBean;
}
public void setBean(MyBean beanVal)
{
   this.MyBean = beanVal;
}
 
Similarly in Class B. The reason to have the bean value at 2 places is :one bean value is referred as original or default and the other can be updated. So whenver user wants to Reset, default bean can be loaded. I am seeing a strange behaviour: when I update the bean from  class A, bean value in class B is also updated.
Please suggest how can I have 2 instance to solve my case.
 
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment