编程习惯1

判断参数 ,抛出异常, 一个方法一个return

public FixedLengthFrameDecoder(int frameLength) {
        if(frameLength <= 0) {
            throw new IllegalArgumentException("frameLength must be a positive integer: " + frameLength );
        }
        this.frameLength = frameLength;
 }

 

posted @ 2017-11-16 11:18  上台阶  阅读(160)  评论(0编辑  收藏  举报