I have the following code in my dto class.
public void setBillDate(Date billDate) { this.billDate = billDate; }
And I get an error in s
I wonder why none of the solutions takes null into consideration. A general, null-safe solution should look like this:
public void setBillDate(Date billDate) { this.billDate = billDate != null ? new Date(billDate.getTime()) : null; }