harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][nio][compatibility] Harmony doesn't support to call FileLock.release by reflection.
Date Tue, 24 Apr 2007 13:10:07 GMT
Andrew Zhang wrote:
> On 4/24/07, Tim Ellison <t.p.ellison@gmail.com> 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!
>> <snip>
>>
>> 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).

Regards,
Tim

Mime
View raw message