技术细节之SimpleDateFormat线程安全问题

Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579

Sun refused to accept this issue as a BUG, so we have to handle the thread-safe by ourselves.

REF:http://jroller.com/page/dschneller?entry=calendar_dateformat_and_multi_threading


java.util.Calendar也存在这个问题,更差的是,其Javadoc中一字也未提到。

搜索代码中static Calender和static SimpleDateFormat吧,隐患啊,而且一般测试测不出来的。

你可能感兴趣的:(thread,Access,sun)