This was the reason why I suggested it ;) we should just keep it simple

> Am 12.04.2014 um 21:53 schrieb Jakob Buchgraber <notifications@github.com>:
> 
> In buffer/src/main/java/io/netty/buffer/BipartiteByteBuf.java:
> 
> > +
> > +    public BipartiteByteBuf(ByteBufAllocator alloc, boolean directByDefault, ByteBuf part1, ByteBuf part2) {
> > +        super(Integer.MAX_VALUE);
> > +
> > +        if (alloc == null) {
> > +            throw new NullPointerException("alloc");
> > +        }
> > +
> > +        this.alloc = alloc;
> > +        this.directByDefault = directByDefault;
> > +        leak = leakDetector.open(this);
> > +        part1(part1);
> > +        part2(part2);
> > +    }
> > +
> > +    public BipartiteByteBuf part1(ByteBuf buffer) {
> I am just asking, because if we can always make sure that part1 and part2 is not null then I could make some optimizations/simplifications in the code. Von: Norman Maurer Gesendet: ‎Samstag‎, ‎12‎. ‎April‎ ‎2014 ‎21‎:‎37 An: netty/netty Cc: Jakob Buchgraber In buffer/src/main/java/io/netty/buffer/BipartiteByteBuf.java:
> + + public BipartiteByteBuf(ByteBufAllocator alloc, boolean directByDefault, ByteBuf part1, ByteBuf part2) { + super(Integer.MAX_VALUE); + + if (alloc == null) { + throw new NullPointerException("alloc"); + } + + this.alloc = alloc; + this.directByDefault = directByDefault; + leak = leakDetector.open(this); + part1(part1); + part2(part2); + } + + public BipartiteByteBuf part1(ByteBuf buffer) {
> I think I would just set the maxCapacity in the constructor and not allow to change it — Reply to this email directly or view it on GitHub.
> —
> Reply to this email directly or view it on GitHub.