Fix adaptor tests
This commit is contained in:
parent
050db15e07
commit
b2bf0029be
@ -1435,7 +1435,8 @@ public final class ByteBufAdaptor extends ByteBuf {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ByteBuf retainedDuplicate() {
|
public ByteBuf retainedDuplicate() {
|
||||||
return new Slice(unwrap().retainedDuplicate(), indexAdjustment, lengthAdjustment);
|
return new Slice(unwrap().retainedDuplicate(), indexAdjustment, lengthAdjustment)
|
||||||
|
.setIndex(readerIndex(), writerIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1453,7 +1454,8 @@ public final class ByteBufAdaptor extends ByteBuf {
|
|||||||
@Override
|
@Override
|
||||||
public ByteBuf duplicate() {
|
public ByteBuf duplicate() {
|
||||||
((ByteBufAdaptor) unwrap()).checkAccess();
|
((ByteBufAdaptor) unwrap()).checkAccess();
|
||||||
return new Duplicate((ByteBufAdaptor) unwrap());
|
return new Duplicate((ByteBufAdaptor) unwrap())
|
||||||
|
.setIndex(readerIndex(), writerIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1476,7 +1478,10 @@ public final class ByteBufAdaptor extends ByteBuf {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ByteBuf retainedDuplicate() {
|
public ByteBuf retainedDuplicate() {
|
||||||
return retainedSlice(0, capacity()).setIndex(readerIndex(), writerIndex());
|
checkAccess();
|
||||||
|
retain();
|
||||||
|
Duplicate duplicatedByteBuf = new Duplicate(this);
|
||||||
|
return duplicatedByteBuf.setIndex(readerIndex(), writerIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user