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-741) An autoexpandable IoBuffer becomes non-autoexpandable after slicing

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

Emmanuel Lecharny closed DIRMINA-741.
-------------------------------------


> An autoexpandable IoBuffer becomes non-autoexpandable after slicing
> -------------------------------------------------------------------
>
>                 Key: DIRMINA-741
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-741
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M6, 2.0.0-RC1
>            Reporter: Roger Kapsi
>
> Hi,
> an auto-expandable IoBuffer becomes non-auto-expandable in MINA 2.0 after slicing, duplicating...
> {code:title=AbstractIoBuffer.java}
> @Override
> public final IoBuffer slice() {
>     recapacityAllowed = false;
>     return slice0();
> }
> {code}
> {code}
> @Test
> public void autoExpand() {
>     IoBuffer buffer = IoBuffer.allocate(8, false);
>     buffer.setAutoExpand(true);
>     
>     TestCase.assertTrue("Should AutoExpand", buffer.isAutoExpand());
>     
>     IoBuffer slice = buffer.slice();
>     TestCase.assertTrue("Should AutoExpand", buffer.isAutoExpand());
>     TestCase.assertFalse("Should *NOT* AutoExpand", slice.isAutoExpand());
> }
> {code}
> The documentation for IoBuffer says only Derived Buffers become non-auto-expandable.
> {quote}
> Derived buffers are the buffers which were created by duplicate(), slice(), or asReadOnlyBuffer(). They are useful especially when you broadcast the same messages to multiple IoSessions. Please note that the buffer derived from and its derived buffers are not both auto-expandable neither auto-shrinkable. Trying to call setAutoExpand(boolean) or setAutoShrink(boolean)  with true parameter will raise an IllegalStateException. 
> {quote}

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