MINA
  1. MINA
  2. DIRMINA-780

Writing null objects to the Session should raise an Exception

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0-RC1
    • Fix Version/s: 2.0.8
    • Component/s: Core
    • Labels:
      None

      Description

      When using MINA in JAMES we saw malformated packets when processing POP3. This was a cause of a bug in our code which wrote a "null" object to the session. Unfortunally MINA don't throw an exception in this case and just write garbage to the session. We only found the bug because we have a netty implementation too which throws a NullPointerException in this case.

      I think MINA should do something similar..

        Activity

        Hide
        Emmanuel Lecharny added a comment -

        We have to fix this one before 2.0

        Show
        Emmanuel Lecharny added a comment - We have to fix this one before 2.0
        Hide
        Ashish Paliwal added a comment -

        Write API guards against null objects, here is the snippet from AbstractIoSession from trunk

        /**

        • {@inheritDoc}
          */
          public WriteFuture write(Object message) { return write(message, null); }

          /**
          * {@inheritDoc}

          */
          public WriteFuture write(Object message, SocketAddress remoteAddress) {
          if (message == null)

          { throw new NullPointerException("message"); }

          ..

        Am I looking at wrong place ?

        Show
        Ashish Paliwal added a comment - Write API guards against null objects, here is the snippet from AbstractIoSession from trunk /** {@inheritDoc} */ public WriteFuture write(Object message) { return write(message, null); } /** * {@inheritDoc} */ public WriteFuture write(Object message, SocketAddress remoteAddress) { if (message == null) { throw new NullPointerException("message"); } .. Am I looking at wrong place ?
        Hide
        Emmanuel Lecharny added a comment -

        Postponed to 2.0.1

        Show
        Emmanuel Lecharny added a comment - Postponed to 2.0.1
        Hide
        Emmanuel Lecharny added a comment -

        Ashish, it seems like we deal with this case in 2.0.0. Norman, we may need some more infos because IFAICT, when a null message is written, you'll get an exception. I'm also quite sure that the exception was thrown before 2.0.0-RC1.

        Show
        Emmanuel Lecharny added a comment - Ashish, it seems like we deal with this case in 2.0.0. Norman, we may need some more infos because IFAICT, when a null message is written, you'll get an exception. I'm also quite sure that the exception was thrown before 2.0.0-RC1.

          People

          • Assignee:
            Unassigned
            Reporter:
            Norman Maurer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development