Sure they describe it in the last paragraph. You either have @Immutable 
objects, enums or inherently immutable objects 
from the jdk.
Otherwise clonable objects are cloned on their way in _and_ out.
All other types will result in exceptions being thrown.

The only problem I see there is that they don't restrict collection contents to 
the above.

Michael

Private final also doesn't mean immutable :) - read the appropriate java 
specialist newsletter from Heinz Kabutz
just set the modifiers on the field using reflection to non final and you're 
done. :)
(http://www.javaspecialists.eu/archive/Issue161.html)


Am 27.02.2009 21:19 Uhr, schrieb Raoul Duke:
>> Does this: http://groovy.codehaus.org/Immutable+AST+Macro look familiar? :)
>
> nice except for how they forgot to mention that the fields have to
> themselves be immutable objects as well, not just private final (final
> does not mean immutable) -- at least, if you want to avoid potential
> insanity imho.
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev


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

Reply via email to