Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 39636 invoked from network); 13 Jul 2006 05:31:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2006 05:31:48 -0000 Received: (qmail 26042 invoked by uid 500); 13 Jul 2006 05:31:46 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 25528 invoked by uid 500); 13 Jul 2006 05:31:44 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 25517 invoked by uid 99); 13 Jul 2006 05:31:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2006 22:31:44 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of vvgorr@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2006 22:31:43 -0700 Received: by py-out-1112.google.com with SMTP id b29so104220pya for ; Wed, 12 Jul 2006 22:31:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=EgkNuZ6cOFho+Xxvjplh1S/i0o+LhLEFhJdULmH6pMiL8ebXeBiLTOsfBORDg8ISV/KwYV0KlTy85b6ZQ5KjtxcgxvJVvlnqL+hjECMb1n5SgB6x9+YZIHDxKLXMJ+3rkFQg9vRDf4zSrWT8hreN+2ZmKO0FR1VLruyJkEHjcIw= Received: by 10.35.107.20 with SMTP id j20mr181627pym; Wed, 12 Jul 2006 22:31:23 -0700 (PDT) Received: by 10.35.88.14 with HTTP; Wed, 12 Jul 2006 22:31:23 -0700 (PDT) Message-ID: <23951bd90607122231w7c77860m529d3069f950139a@mail.gmail.com> Date: Thu, 13 Jul 2006 12:31:23 +0700 From: "Vladimir Gorr" To: harmony-dev@incubator.apache.org Subject: Re: I18N on native (was:Re: [jira] Commented: (HARMONY-815) [classlib][nio] Refine implConfigureBlocking(boolean) method of DatagramChannel and SocketChannel.) In-Reply-To: <44B5BF3F.8050409@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9782_32842123.1152768683336" References: <44B5BF3F.8050409@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_9782_32842123.1152768683336 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/13/06, Jimmy, Jing Lv wrote: > > Hi: > > I'd like to raise the topic on I18N of native code. As discussed > about patch-815, we found there are exceptions thrown by native code > with un-internationalized error message. To resolve this problem, there > may be two solutions: > > 1) make native code return error code instead of throw exceptions, and > let Java code deal with these errors. This seems pretty good, and also > resolve such problems like 815, but require much more effort to refactor > all native and Java codes. What's more, as some native methods do not > return an integer at all, we may add an output parameter to them, at > least for network-related luni/nio, there are about 10 methods like this. > > 2) As it is still easy for native code to call Java code, so rewrite > error-message-lookup native method to lookup internationalized message, > e.g., call MsgUtil.getString(). This refactor may be easy, but to > JIRA-815 and other message-dependent Java code, it do no help. So it > still requires other refactoring, e.g., return error code in some > situation like suggested in (1). Indeed we need to i18d the native code to resolve this issue. I'd suggest to use the log4cxx & resource bundle approach for doing this. This one can be suitable for both VMs & API natives. I'm going to create new thread to discuss this approach. Thanks, Vladimir. Another solution can be: catch exceptions on Java code, replace its > message, and throw out again, this may be too ugly, so I do not suggest > so. > > Any suggestions? Thanks! > > -- > > Best Regards! > > Jimmy, Jing Lv > China Software Development Lab, IBM > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > ------=_Part_9782_32842123.1152768683336--