ThreadLocal 封装SimpleDateFormat 使用

JAVA 中的SimpleDateFormat 是非线程安全的 具体缘由本身百度。web 网上说用ThreadLocal 封装能够实现线程安全。tomcat 本身封装了下安全 private static final ThreadLocal<Map<String, DateFormat>> messageFormat = new ThreadLocal<
相关文章
相关标签/搜索