You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Roger Kapsi (JIRA)" <ji...@apache.org> on 2009/10/22 20:04:59 UTC

[jira] Created: (DIRMINA-741) An autoexpandable IoBuffer becomes non-autoexpandable after slicing

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-RC1, 2.0.0-M6
            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.


[jira] Resolved: (DIRMINA-741) An autoexpandable IoBuffer becomes non-autoexpandable after slicing

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRMINA-741.
---------------------------------------

    Resolution: Invalid

The IoBuffer doc specifically says :

"Please note that the *buffer derived from* and its derived buffers are not both auto-expandable neither auto-shrinkable"

Which makes sense, as both IoBuffer point to the same data. If you need to work on a auto-expanded buffer taken from an existing buffer, copy it to a new IoBuffer.

> 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.


[jira] Closed: (DIRMINA-741) An autoexpandable IoBuffer becomes non-autoexpandable after slicing

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ 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.