Been trying to find the best way to implement a method that makes a defensive copy of a Calendar object.
eg:
public void setDate(Calendar date) {
Simplest way would be:
copy = Calendar.getInstance(original.getTimeZone()); copy.setTime(original.getTime());
But I strongly suggest that (whenever possible) you use JodaTime to express times and dates in Java. It has immutable classes as well as mutable.