classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: access modifier for FileDescriptor.setNativeFd(long)


From: Mark Wielaard
Subject: Re: access modifier for FileDescriptor.setNativeFd(long)
Date: Mon, 12 Apr 2004 22:39:33 +0200

Hi,

On Sat, 2004-03-20 at 07:04, Christian Grothoff wrote:
> I'm currently porting parts of GNU classpath to OVM (http://www.ovmj.org).  
> In 
> the process I hit a problem with the access modifier of 
> FileDescriptor.setNativeFd(long).  In order to avoid having to set that field 
> using reflection, I would need that method to be default (currently private). 
> 
> I believe that change is generally the right thing to do. First, a private 
> accessor method makes little sense anyway.  Also, in a similar context the 
> native_fd field in gnu.java.net.PlainSocketImpl is also package-scoped 
> (default) (there is a tiny difference in that PlainSocketImpl does not use 
> accessor methods, but I don't think it matters either way).

I agree that these method/fields should be package private where
possible. It helps several execution environments easier access to these
(more or less vm specific) things.  CNI for example will make package
private fields/methods accessible to C++ code. And when you do
everything in java then adding a class to the package will make it
possible to manipulate these things easily without having to go through
reflection or JNI).  With all the restructuring of java.io (through
java.nio) going on your patch is not applicable anymore.  Could you
check that the new setup?  Just saw this patch from Jeroen which might
bite you:

2004-04-09  Jeroen Frijters  <address@hidden>

    * gnu/java/nio/channels/FileChannelImpl.java (fd, mode): Made
    private.
    [...]

Jeroen, was there a particular reason to make these things private here?
(I admit to not having studied this code very hard, so maybe the
similarity with the FileDescriptor setup is not one-on-one.)

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]