SimpleDateFormatTS ?
http://weblogs.java.net/blog/kirillcool/archive/2005/01/garbage_collect.htmlのコメントで見つけたコード.
#TSはThread Safeって意味でしょ.
public class SimpleDateFormatTS { private static ThreadLocal dateFormat = new ThreadLocal() { protected synchronized Object initialValue() { return new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); } }; public static SimpleDateFormat get() { return (SimpleDateFormat)(dateFormat.get()); } }
ふーん.ちょっと覚えておこう.
Thread-SafeなDateFormatって言えば,Commons LangにFastDateFormatってのがあったな.