commit-classpath
[Top][All Lists]
Advanced

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

Re: Patch for discussion: The big NIO merge


From: Michael Koch
Subject: Re: Patch for discussion: The big NIO merge
Date: Tue, 6 Apr 2004 10:51:23 +0200
User-agent: KMail/1.5.4

Am Dienstag, 6. April 2004 10:08 schrieb Jeroen Frijters:
> Michael Koch wrote:
> > Here is a little NIO patch for classpath. Its mainly to merge with
> > current libgcj to get differences smaller. It uses java.nio now
> > internally in java.io to access files. This surely needs a NEWS
> > item for the next release.
> >
> > Any comments ? Okay to commit ?
>
> Looks great! I a few small comments/requests.
>
> Would you consider renaming gnu.java.nio.channels.FileChannelImpl to
> gnu.java.nio.channels.VMFileChannel? I'm almost certainly going to
> need to replace it (unless we introduce another layer
> VMFileChannelImpl, but that seems pointless).
>
> Why are some of the fields (e.g. owner in DirectByteBufferImpl)
> protected in a final class?
>
> This looks a bit odd:
>
> +    if (channel instanceof FileChannel)
> +      {
> +       try
> +         {
> +           ((FileChannel) channel).force(true);
> +         }
> +       catch (IOException ex)
> +         {
> +           if (ex instanceof SyncFailedException)
> +             throw (SyncFailedException) ex;
> +           else
> +             throw new SyncFailedException(ex.getMessage());
> +         }
> +      }
>
> Why not simply do:
>
> +       catch (SyncFailedException ex)
> +         {
> +             throw ex;
> +         }
> +       catch (IOException ex)
> +         {
> +             throw (SyncFailedException)new
> SyncFailedException().initCause(ex);
> +         }

Yeah, looks reasonable. I will do this later (see later).

> Would you please consider moving newInputStream/newOutputStream from
> java.nio.channels.Channels to java.nio.channels.VMChannels?

I know why I always wanted to use VM* names. I havent written the code 
you wanna change. I have this change in my mind but I would like to 
commit this first to get this big patch out of my disk.


Michael





reply via email to

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