mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Im" <im-ja...@hotmail.com>
Subject TextLineDecoder bug?
Date Mon, 22 Jan 2007 16:21:43 GMT
I need your help to determine if I have found a bug or not.

I use a slightly modified version of TextLineDecoder and I got an error
in decodeNormal() at line 272 (the line number correspond to the version
on the trunk):

in.limit( in.limit() - matchCount + oldMatchCount );

After investigating a bit I found that I was trying to set the limit to
8193 which was greater than the capacity (8192). Thus the error.

I've investigated some more and I saw that it happened when the
matchCount passed to decodeNormal() was 1 instead of 0.

I've investigated some more and I think that oldMatchCount should be
reset to zero when you have found a match.

Thus, after line 261 I have added:

After I did this change the problem was solved. The problem did not
occurred 100% of the time on my server and thus I have no specific test
case to reproduce the problem.
As it is hard to analyze buffer, position, limit, remaining and capacity
in loops and I therefore ask you to do a mental effort to verify if I
am right or wrong.

Del dine store filer uden problemer på MSN Messenger:  

View raw message