package io.github.simonxianyu.util.common;

import java.io.Closeable;
import java.io.IOException;

/**
 *
 * Created by Simon Xianyu on 2015/9/16 0016.
 */
public class DwUtil {
  public static String stringValue(Object obj) {
    return null == obj ? null : obj.toString();
  }

  public static void closeQuietly(Closeable cl) {
    if (null != cl) {
      try {
        cl.close();
      } catch (IOException e) {
        // do nothing here.
      }
    }
  }
}

@@ -90,16 +90,69 @@
 ception;
+%0Aimport java.util.Collections;%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -224,16 +224,152 @@
 wUtil %7B%0A
+%0A  @SuppressWarnings(%22unchecked%22)%0A  public static %3CT%3E List%3CT%3E safe(List%3CT%3E a) %7B%0A    return a == null ? Collections.EMPTY_LIST : a;%0A  %7D%0A%0A
   public

add static safe method to simplify null checking in for-each