编程习惯1

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

public FixedLengthFrameDecoder(int frameLength) {
        if(frameLength <= 0) {
            throw new IllegalArgumentException("frameLength must be a positive integer: " + frameLength );
        }
        this.frameLength = frameLength;
 }
原文地址:https://www.cnblogs.com/wuer888/p/7843381.html