[ 
https://jira.terracotta.org/jira//browse/CDV-305?page=comments#action_21628 ] 
            
Tim Eck commented on CDV-305:
-----------------------------

This was conscious  design decision way back when. The strongest argument is 
that seriailzation of enum instances (nothing to do with DSO) does not preserve 
mutable state either

There really should be a FindBugs plugin that detects mutable enums.

> Changes in enums aren't recognized by DSO
> -----------------------------------------
>
>                 Key: CDV-305
>                 URL: https://jira.terracotta.org/jira//browse/CDV-305
>             Project: Community Development
>          Issue Type: Bug
>            Reporter: Orion Letizi
>         Assigned To: QA Team
>            Priority: 0 Showstopper
>
> Many of the issues around enums have been resolved, but there is still this 
> caveat:
> f you define an enum that contains state:
> enum MutableEnum {
>   A, B;
>   
>   private int fVal;
>   
>   public void setValue(int i) {
>     fVal = i;
>   }
>   
>   public int getValue() {
>     return fVal;
>   }
> }
> You can share the enum value but the state will not be shared. If you make 
> this a root and view it in the AdminConsole, you will not see fVal. In fact, 
> in the console we treat enums as simple literals: enumRoot=A.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to