On Mon, Mar 22, 2010 at 08:29, Ulf Zibis <[email protected]> wrote:
> Am 21.03.2010 20:39, schrieb Martin Buchholz:
>>
>> On Sun, Mar 21, 2010 at 00:56, Martin Buchholz<[email protected]>
>>  wrote:
>>
>>
>>>
>>> Study also:
>> http://code.google.com/p/guava-libraries/source/browse/trunk/src/com/google/common/base/Preconditions.java
>>
>> especially this comment:
>>
>
> Thanks for the update. I'm not sure if I understand right the below comment.
> Does it mean, that inlining the message from a constant is less fast than
> from a call on badMsg()?

I'm not sure I understand exactly, but as the comment says,
always make your error-checking code look like this:

   *
   * if (guardExpression) {
   *    throw new BadException(badMsg(...));
   * }
   *

although in String it's not so important because
there's no String concatenation, which is a notable cause
of cold bytecode bloat.

Martin

Reply via email to