1. 官方说明:
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. |
2. 问题代码:
private static final DateFormat df = new SimpleDateFormat("yyyy年MM月");
public String convertDate( Date date ){
String date = df.format(date);
return date;
}
3. 附加说明:
DateFormat不是线程安全的。