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.