You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2008/11/11 21:05:45 UTC

[jira] Assigned: (DIRMINA-636) The ProtocolDecoderOutput class initialization will fail if some filter is added after the codec

     [ https://issues.apache.org/jira/browse/DIRMINA-636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny reassigned DIRMINA-636:
-----------------------------------------

    Assignee: Emmanuel Lecharny

> The ProtocolDecoderOutput class initialization will fail if some filter is added after the codec
> ------------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-636
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-636
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M3
>            Reporter: Emmanuel Lecharny
>            Assignee: Emmanuel Lecharny
>
> The way this class is initialized is wrong : it takes the nextFilter as a parameter, which means we can't add a filter after the codec without having a broken chain.
> Here is the method which initialize this object :
>     private ProtocolDecoderOutput getDecoderOut(IoSession session,
>             NextFilter nextFilter) {
>         ProtocolDecoderOutput out = (ProtocolDecoderOutput) session.getAttribute(DECODER_OUT);
>         if (out == null) {
>             out = new ProtocolDecoderOutputImpl(session, nextFilter);  <===== This is WRONG
>             session.setAttribute(DECODER_OUT, out);
>         }
>         return out;
>     }
> It would be way better not to pass the <NextFilter, Session> to the constructor, but passing them to the flush() method, avoiding any potential problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.