Readability / Fix inception year
This commit is contained in:
parent
3a5aa12000
commit
e58af1bc94
@ -128,13 +128,12 @@ public class LengthFieldPrepender extends MessageToByteEncoder<ByteBuf> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void encode(
|
||||
ChannelHandlerContext ctx,
|
||||
ByteBuf msg, ByteBuf out) throws Exception {
|
||||
protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception {
|
||||
|
||||
int length = (lengthIncludesLengthFieldLength?
|
||||
msg.readableBytes() + lengthFieldLength : msg.readableBytes()) +
|
||||
lengthAdjustment;
|
||||
int length = msg.readableBytes() + lengthAdjustment;
|
||||
if (lengthIncludesLengthFieldLength) {
|
||||
length += lengthFieldLength;
|
||||
}
|
||||
|
||||
if (length < 0) {
|
||||
throw new IllegalArgumentException(
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012 The Netty Project
|
||||
* Copyright 2013 The Netty Project
|
||||
*
|
||||
* The Netty Project licenses this file to you under the Apache License,
|
||||
* version 2.0 (the "License"); you may not use this file except in compliance
|
||||
@ -23,11 +23,9 @@ import io.netty.util.CharsetUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static io.netty.buffer.Unpooled.copiedBuffer;
|
||||
import static io.netty.buffer.Unpooled.wrappedBuffer;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
import static io.netty.buffer.Unpooled.*;
|
||||
import static org.hamcrest.core.Is.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class LengthFieldPrependerTest {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user