Unify parameter validation's code style. (#9778)
Motivation: Unify parameter validation's code style. Modifications: Change the parameter's validation statements to the method: ObjectUtil.checkNotNull. Result: The parameter's validation code will keep same style with other codes
This commit is contained in:
parent
b0feb5a81f
commit
a1f9d50174
@ -25,6 +25,7 @@ import io.netty.channel.ChannelHandlerContext;
|
|||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOutboundBuffer;
|
import io.netty.channel.ChannelOutboundBuffer;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.ChannelPromise;
|
||||||
|
import io.netty.util.internal.ObjectUtil;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -190,9 +191,7 @@ public class IdleStateHandler extends ChannelDuplexHandler {
|
|||||||
public IdleStateHandler(boolean observeOutput,
|
public IdleStateHandler(boolean observeOutput,
|
||||||
long readerIdleTime, long writerIdleTime, long allIdleTime,
|
long readerIdleTime, long writerIdleTime, long allIdleTime,
|
||||||
TimeUnit unit) {
|
TimeUnit unit) {
|
||||||
if (unit == null) {
|
ObjectUtil.checkNotNull(unit, "unit");
|
||||||
throw new NullPointerException("unit");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.observeOutput = observeOutput;
|
this.observeOutput = observeOutput;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user