Method parameter sd & ed is LocalDate, I need return date object, but sd & ed return null. My define a private method:
private void setQuarter(LocalDate sd,LocalDate ed,LocalDate today){
            switch (getQuarter(today.getMonthValue())){
                case 1:
                    sd=LocalDate.of(today.getYear(),1,1);
                    ed=LocalDate.of(today.getYear(),3,31);
                    break;
                case 2:
                    sd=LocalDate.of(today.getYear(),4,1);
                    ed=LocalDate.of(today.getYear(),6,30);
                    break;
                case 3:
                    sd=LocalDate.of(today.getYear(),7,1);
                    ed=LocalDate.of(today.getYear(),9,30);
                    break;
                case 4:
                    sd=LocalDate.of(today.getYear(),10,1);
                    ed=LocalDate.of(today.getYear(),12,31);
                    break;
                default:
                    sd=LocalDate.of(today.getYear()+1,1,1);
                    ed=LocalDate.of(today.getYear()+1,1,1);
            }
        }
Invoke this method:
LocalDate sd=null;
LocalDate ed=null;
setQuarter(sd,ed,today);
log.info("==> sd:{},ed:{}",sd,ed);
Output message: ==> sd:null,ed:null
 
    