记录造成NullPointerException的有误代码

List orderList = null; // 应改为List orderList = new ArrayList(); OrderDTO orderDTO = new OrderDTO(); orderDTO.setOrderId(1); orderList.add(orderDTO);

    推荐阅读