Here you can find the source of parseDate(final String source)
public static Date parseDate(final String source) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final ThreadLocal<DateFormat> dateFormat = new ThreadLocal<DateFormat>() { @Override// w w w . jav a 2 s. co m protected DateFormat initialValue() { return new SimpleDateFormat("yyyyMMdd"); } }; public static Date parseDate(final String source) throws ParseException { return dateFormat.get().parse(source); } }