review request for 6798511/6860431: Include functionality of Surrogate in Character

Martin Buchholz martinrb at google.com
Mon Mar 22 22:08:08 UTC 2010


On Mon, Mar 22, 2010 at 08:29, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:
> Am 21.03.2010 20:39, schrieb Martin Buchholz:
>>
>> On Sun, Mar 21, 2010 at 00:56, Martin Buchholz<martinrb at google.com>
>>  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



More information about the core-libs-dev mailing list