Hey Trustin,

Latest version we were using was 1.1.6 so I’m now checking the changes made for 
1.1.7 and later. I found that IoServiceListenerSupport in line 164 is using 
ifAbsentPut. BTW, that brought some flashbacks from my Smalltalk dev 
experience. :) However, in Java the implementation is not very optimal since it 
is always “executing” the missing value. What I mean is that a new synchronized 
set is always created even if a value already exists in the collection. I 
haven’t profiled MINA but this is a common place where creating objects is 
expensive and can be prevented. It may be possible that a standard 
#get-if-null-then-put operation could be more efficient.

Regarding your latest fix I think it is even better since it is solving the 
problem at an earlier stage thus avoiding the problem in any decoder not only 
the cumulative one.

Thanks for your prompt answer.

Regards,

  -- Gato

On 5/19/08 6:54 PM, "이희승   (Trustin Lee)" <[EMAIL PROTECTED]> wrote:

Hi Gato,

I made sure that no empty buffer is passed as an argument of
ProtocolDecoder by adding additional check in ProtocolCodecFilter.  This
is somewhat different fix than you suggested, but it should work, too.

Please svn up and confirm if my fix works for you.

MINA 2 already ignores an empty buffer.

Thanks,
--
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Reply via email to