SimpleDateFormat java.lang.NumberFormatException: multiple points

时间转换报java.lang.NumberFormatException: multiple points问题

 

java.lang.NumberFormatException: multiple points
	at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
	at java.lang.Double.parseDouble(Double.java:540)
	at java.text.DigitList.getDouble(DigitList.java:168)
	at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
	at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1793)
	at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
	at java.text.DateFormat.parse(DateFormat.java:355)

 

偶偶会报java.lang.NumberFormatException: multiple points或者报java.lang.NumberFormatException: For input string: ".31023102EE22"

原来是SimpleDateFormat是非线程安全的,在多线程情况下会有问题,在每个线程下得各自new SimpleDateFormat()就可以了

转载地址:http://blog.csdn.net/zhongyangjian/article/details/50442504

猜你喜欢

转载自rainbowdesert.iteye.com/blog/2312308