Here you can find the source of parseDateAllowNull(String date)
public static Date parseDateAllowNull(String date) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDateAllowNull(String date) throws ParseException { DateFormat df = new SimpleDateFormat("dd/MMM/yyyy"); return (date == null || date.isEmpty()) ? null : df.parse(date); }//w ww . j ava2 s. c o m }