Noel J. Bergman wrote: > > > Norman Maurer wrote: > > > > > - Add [protected] set methods for ServiceManager and DNSServer > > > Those properties were private, and you've now exposed setters > > i make a mistake > > :-) No problem. So this was just a style change, not a > planned change in > function? You prefer to use a private setter rather than an > assignment, and > hope that the call overhead gets optimized out by the > compiler? Not that it > matters much in an init() method. :-)
Most compilers don't optimize this out, but the JVMs do. To prove the first, decompile your bytecode and see if the methods which invoke the setter method still do. To prove the latter, read the many papers on JVM optimizations, or more pragmattically test it by measuring the releveant performance of each approach over several iterations. Optimizing out trivial assertions is one of the most basic tuneups a modern JVM does. Its true that this may not happen on the first reference and the optimization will inevitably consume processor time. But its a neglible cost for good style. -- Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]