harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin" <ilya.oko...@gmail.com>
Subject Re: [classlib][i18n] Messages code comments
Date Mon, 11 Sep 2006 10:41:31 GMT
Hello, Nathan!

Thank you for taking a deep look at the i18n task!!
I try to comment inline...



On 9/11/06, Nathan Beyer <nbeyer@kc.rr.com> wrote:
>
> Is there any reason that there are three overloaded getString(String, XXX)
> methods that take variations of Object?


Actually, source code for the Messages class was taken (it was discussed at
the threads of internationalization issues) from the existing
o.a.h.luni.util.Msg and o.a.h.luni.util.MsgHelp classes.
I'm not the author of mentioned classses but I assume that three overloaded
getString() methods were designed to increase performance of the common used
messages calls.


Can't we just condense this into one method?
>
>
>
> public static String getString(String key, Object. args)


I worried for the performance, however, I ran several small tests with
existing Messages implementation and with Java 5.0 variable arguments
feature usage and didn't see the big difference in performance. Condensing
all these methods in one seems to me  a good idea.

In fact, this signature allows for the getString(String) method to be
> removed as well, since a vararg argument can be omitted altogether.
> Additionally, I would change the format method to use a vararg as well.


All enhancements are welcomed!!

Also, I'd argue that there's little value in having the overloaded methods
> that take an 'int' and a 'char'. I'd suggest just letting autoboxing
> handle
> this in conjunction with the varargs.

Where is the code generator for these classes located?

Take a look at the HARMONY-1041issue, all sources for the i18n classes
generator are available there.
If you want to improve Messages class code - you just need to modify
Messages template file.


Regards,
Ilya.


-Nathan






-- 
--
Ilya Okomin
Intel Middleware Products Division

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message