Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-982

ProtocolEncoderOutputImpl.flush() throws an IllegalArgumentException if buffers queue is empty

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.7
    • Fix Version/s: 2.0.8
    • Component/s: None
    • Labels:
      None

      Description

      https://git-wip-us.apache.org/repos/asf?p=mina.git;a=blob;f=mina-core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java;h=f413491e058ff1c5a24c3b2ccae6d736f481bbaf;hb=2.0#l428

      First, flush method initializes WriteFuture with a null reference.
      The object can be constructed later, if buffers queue isn't empty, but otherwise remains untouched.
      If it still holds a null reference, the DefaultWriteRequest constructor call always fails, as it doesn't accept null as a message param.

      Excerpt from the stack trace:

      Caused by: java.lang.IllegalArgumentException: message
      at org.apache.mina.core.write.DefaultWriteRequest.<init>(DefaultWriteRequest.java:133)
      at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolEncoderOutputImpl.flush(ProtocolCodecFilter.java:448)
      at com.ugcs.messaging.mina.MinaEncoder.encode(MinaEncoder.java:27)
      at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:308)
      ... 33 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jenya Jenya Pisarenko
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: