I have class
public class Order {
private LocalDateTime creationDate;
private Date creationDateAsDate;
}
The creationDate
is an existing field in the Order.
The creationDateAsDate
is a new field for some functionality.
I need to set and save this new field in all places where I save the old field.
Unfortunately, I am working with legacy code, and I have 5 places where creationDate
field is set.
Now I see 2 solutions:
- call
creationDateAsDate
setter in all places wherecreationDate
setter is called. - call
creationDateAsDate
setter in thecreationDate
setter.
I don't like both variants. Can someone answer how to do this? It might be one of my variants, or something else.