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 2010/01/22 18:39:22 UTC

[jira] Closed: (DIRMINA-739) IllegalArgumentException thrown from ErrorGeneratingFilter

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

Emmanuel Lecharny closed DIRMINA-739.
-------------------------------------


> IllegalArgumentException thrown from ErrorGeneratingFilter
> ----------------------------------------------------------
>
>                 Key: DIRMINA-739
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-739
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>    Affects Versions: 2.0.0-M6
>            Reporter: Stephen Crane
>            Assignee: Emmanuel Lecharny
>             Fix For: 2.0.0-RC1
>
>
> I've configured an ErrorGeneratingFilter in my tests and am now occasionally seeing the following exception:
> {code}
> Caused by: java.lang.IllegalArgumentException: n must be positive
> 	at java.util.Random.nextInt(Random.java:250)
> 	at org.apache.mina.filter.errorgenerating.ErrorGeneratingFilter.manipulateIoBuffer(ErrorGeneratingFilter.java:187)
> 	at org.apache.mina.filter.errorgenerating.ErrorGeneratingFilter.messageReceived(ErrorGeneratingFilter.java:118)
> 	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:433)
> {code}
> Obviously buffer.remaining() is returning 0 here.
> How about the following fix?
> {code}
> if (buffer.remaining() > 0 && changeByteProbability > rng.nextInt(1000)) {
> 	// as before
> }
> {code}

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