On Tue, Aug 23, 2011 at 12:17 AM, Daniel Bell <[email protected]>wrote:
> Just out of curiosity, does this have to defeat the compiler optimisations? > Isn't it known at compile time that those setters will always return the > same Style instance? In that sense, from the compiler's point of view, isn't > the situation with the setter returning the Style the same as the situation > with getStyle() returning the Style? No -- it may be theoretically possible to analyze that all the methods called don't mutate the object, the current compiler doesn't do it. We have talked about producing better code for the builder pattern, but it is surprisingly difficult to get right in all situations. -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
