it is possible to find data accoding to date in spring : I'm trying to find data according to date throw the exception **java.lang.IllegalArgumentException: null**

    @SuppressWarnings("deprecation")
    	@GetMapping("/product-DateList/{pathDate}")
    	public ModelAndView getFindByDateOfPurchase(@PathVariable("pathDate") String pathDate) {
    		Date convertDate = new Date
    		//Date Converted according to dataBase Format 
    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    		String strDate = sdf.format(convertDate);
    		Date date = null; 
    		try {
    			date =   DateFormat.getInstance().parse(strDate);
    		} catch (ParseException pe) {
    			pe.printStackTrace();
    		}
    		
    		List<Product> dateofPurchaseList = grofersService.findByDateOfPurchase(date);
    		
    		Optional<List<Product>> optional = Optional.of(dateofPurchaseList);
    		if (!optional.isPresent()) {
    			logger.warn("Not Found Product");
    			return new ModelAndView("notFound"); 
    		}
    		logger.info("Fetching Product according to Date");
    		return new ModelAndView("productList", "dateofPurchaseList", dateofPurchaseList); 
    	}

 Please suggest me how to solve this problem.