# 问题代码

private static final DateFormat df = new SimpleDateFormat("yyyy年MM月");
 
public String convertDate( Date date ){
  String date = df.format(date);
  return date;
}

# 官方解释

Call to static DateFormat

As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous.
For more information on this see Sun Bug #6231579 and Sun Bug #6178997.

Sun Bug #6231579

Sun Bug #6178997

DateFormat 不是线程安全的

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Jalen Chu 微信支付

微信支付

Jalen Chu 支付宝

支付宝

Jalen Chu 公众号

公众号