Re: [java-gnome-hackers] gnome.UIInfo array out of bound.
Brought to you by:
afcowie
From: Tom B. <Tom...@Su...> - 2002-12-23 23:24:47
|
On Mon, 2002-12-23 at 13:36, Mark Howard wrote: > > I think that all the byte array methods should be replaced with char > > arrays until the actual native GTK or GNOME call is made. In Java, char > > arrays should always be used with characters, while byte arrays should > > only be used for raw data. If we adopt this policy now, we probably > > won't be broken by future internationalization fixes in GTK and GNOME. > Does this mean that the automatically generated code would have been > better using char arrays also? or does it just affect the custom written > code. I don't have a strong opinion, unless that code is part of our public or protected API, then yes, string or char array parameters should use Java char arrays. If the API isn't affected, then converting to a byte array in Java may make sense. In general, I'm looking to minimize the native code I work on and move what functionality I can into Java. That's not because I'm a Java bigot, but because maintaining the code is easier since more bugs are caught by the compiler and runtime. This is especially true for native code that makes unnecessary upcalls into the VM, since upcalls are a lot slower than downcalls. Tom |