Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 51134 invoked from network); 24 Apr 2007 14:15:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Apr 2007 14:15:34 -0000 Received: (qmail 4887 invoked by uid 500); 24 Apr 2007 14:15:39 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 4847 invoked by uid 500); 24 Apr 2007 14:15:39 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 4833 invoked by uid 99); 24 Apr 2007 14:15:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 07:15:39 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of zhanghuangzhu@gmail.com designates 209.85.132.247 as permitted sender) Received: from [209.85.132.247] (HELO an-out-0708.google.com) (209.85.132.247) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 07:15:30 -0700 Received: by an-out-0708.google.com with SMTP id b2so2505603ana for ; Tue, 24 Apr 2007 07:15:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=KOBc/pmJmg0PN683kAnbOroHAzvPPl8pzHS71UYrYwTjfdWiVR5kAUM7cQZZLih7D33pJHxTZhkqAitFrQHD1DY1C6fGvEk/21jKS1v92Lwr7QMJNwhSQK+ZveXoWnzS4q4XocpL2u2UuT0hAJCUZdc7CLbEbBPueWwzYejv/ME= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=pzLGnVLqdtjKE1whi9uZ1a0TLoqEGEhiFIRx5UkCr02qIN1A/azpGImQozkXAJhet5Z38MjeojD5ugUrWpYUtht+2jt0aYvp7jmAnZPR5yiLNWrsa1mSOS3g7BF4czARj5quV0431QPbc6CUxLiXWbO/kHdRNl1ce2kl0CTkjno= Received: by 10.100.133.9 with SMTP id g9mr4594892and.1177424109743; Tue, 24 Apr 2007 07:15:09 -0700 (PDT) Received: by 10.100.131.19 with HTTP; Tue, 24 Apr 2007 07:15:09 -0700 (PDT) Message-ID: <4d0b24970704240715q6ae4295cq14afd2948392b219@mail.gmail.com> Date: Tue, 24 Apr 2007 22:15:09 +0800 From: "Andrew Zhang" To: dev@harmony.apache.org Subject: Re: [classlib][nio][compatibility] Harmony doesn't support to call FileLock.release by reflection. In-Reply-To: <462E01AF.7030101@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_272595_15701340.1177424109656" References: <4d0b24970704240521n1a3998edx6fa21a2569c274d7@mail.gmail.com> <462DFA15.80505@gmail.com> <4d0b24970704240544s4cc3fdb7pac1658a01eed423a@mail.gmail.com> <462E01AF.7030101@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_272595_15701340.1177424109656 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 4/24/07, Tim Ellison wrote: > > Andrew Zhang wrote: > > On 4/24/07, Tim Ellison wrote: > >> > >> Andrew Zhang wrote: > >> > Harmony doesn't support to call FileLock.release by reflection. > >> Following > >> > test case shows the problem. The failure reason is that our > >> implementation > >> > class FileLockImpl is not public. A jira issue ( > >> > https://issues.apache.org/jira/browse/HARMONY-3743) is filed. Shall > we > >> fix > >> > it for compatibility reason? Thanks! > >> > >> > >> Is there some application that does this, or is it hypothetical? > > > > > > Yes, it's from a real application. The intention of this strange code is > to > > keep the code compatible with jdk1.1. (The real code even uses > > reflection to > > get the FileChannel and FileLock object). The application has some other > > mechanism to identify which version of jre is running currently. > > Hmm. Can you fix the app to include a "getSuperclass()" to bring it up > to the public FileLock type? > e.g. > lock.getClass().getSuperclass().getMethod("release", (Class[]) null); > > (for extra credit, they should walk up until they reach the right type > and not assume it is a direct subclass). hm... ok, if we won't change the FileLockImpl to public, I'll fix the app. It can call "Class.forName("java.nio.channels.FileLock");" instead of calling lock.getClass() directly. Regards, > Tim > -- Best regards, Andrew Zhang ------=_Part_272595_15701340.1177424109656--