You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Norman Maurer <nm...@byteaction.de> on 2006/06/10 08:16:43 UTC

RE: svn commit: r413135 -/james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java

Am Freitag, den 09.06.2006, 22:05 +0100 schrieb Steve Brewin:
> 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

For me its just a "style change". Anyway if someone not like it i revert
it. But for me its "cleaner".

Bye
Norman


Re: svn commit: r413135 -/james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java

Posted by Stefano Bagnara <ap...@bago.org>.
IMO private setters are not useful.
We should use protected or public setters if this helps in the tests and 
if this helps for the "pojoification":
http://issues.apache.org/jira/browse/JAMES-494

Stefano

Norman Maurer wrote:
> Am Freitag, den 09.06.2006, 22:05 +0100 schrieb Steve Brewin:
>> 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
> 
> For me its just a "style change". Anyway if someone not like it i revert
> it. But for me its "cleaner".
> 
> Bye
> Norman
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org