You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Geoff Cadien <gc...@gmail.com> on 2007/08/07 01:47:26 UTC

Bug in DefaultFileRegion

I've run into a bug in DefaultFileRegion.  In the method

public void setPosition(long value) {
        if (value < position) {
            throw new IllegalArgumentException("New position value may not
be less than old position value");
        }
        count += value - position;
        position = value;
}

I believe it should be

count -= value - position;

instead.

Also,  SocketIoProcessor#clearWriteRequestQueue the WriteRequest message is
cast to a ByteBuffer, which will fail if the message is a DefaultFileRegion.

I would be happy to enter the two bugs in Jira if thats the correct
procedure.

-geoff

Re: Bug in DefaultFileRegion

Posted by Trustin Lee <tr...@gmail.com>.
On 8/7/07, Mike Heath <mh...@apache.org> wrote:
> Trustin,
>
> Did you fix DefaultFileRegion?  I don't see that change in svn.

Oops.  I forgot to check in.  It's done now.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Bug in DefaultFileRegion

Posted by Mike Heath <mh...@apache.org>.
Trustin, 

Did you fix DefaultFileRegion?  I don't see that change in svn.

-Mike

On Tue, 2007-08-07 at 11:57 +0900, Trustin Lee wrote:
> On 8/7/07, Geoff Cadien <gc...@gmail.com> wrote:
> > I've run into a bug in DefaultFileRegion.  In the method
> >
> > public void setPosition(long value) {
> >        if (value < position) {
> >            throw new IllegalArgumentException("New position value may not
> > be less than old position value");
> >        }
> >        count += value - position;
> >        position = value;
> > }
> >
> > I believe it should be
> >
> > count -= value - position;
> >
> > instead.
> >
> > Also,  SocketIoProcessor#clearWriteRequestQueue the WriteRequest message is
> > cast to a ByteBuffer, which will fail if the message is a DefaultFileRegion.
> >
> > I would be happy to enter the two bugs in Jira if thats the correct
> > procedure.
> 
> Thanks!  I've just checked in the changes you suggested.  Please let
> me know if it fixes the problem.
> 
> Thanks,
> Trustin


Re: Bug in DefaultFileRegion

Posted by Trustin Lee <tr...@gmail.com>.
On 8/7/07, Geoff Cadien <gc...@gmail.com> wrote:
> I've run into a bug in DefaultFileRegion.  In the method
>
> public void setPosition(long value) {
>        if (value < position) {
>            throw new IllegalArgumentException("New position value may not
> be less than old position value");
>        }
>        count += value - position;
>        position = value;
> }
>
> I believe it should be
>
> count -= value - position;
>
> instead.
>
> Also,  SocketIoProcessor#clearWriteRequestQueue the WriteRequest message is
> cast to a ByteBuffer, which will fail if the message is a DefaultFileRegion.
>
> I would be happy to enter the two bugs in Jira if thats the correct
> procedure.

Thanks!  I've just checked in the changes you suggested.  Please let
me know if it fixes the problem.

Thanks,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6