Netbeans is complaining about this code, which appears on the IDEA Code Inspections List.
public Date getStartDate()
{
return theStartDate;
}
IDEA site says:
This inspection reports any attempt to return a java.lang.Date or java.lang.Calendar field from a method. Since Date or Calendar are often treated as immutable values but are actually mutable, this construct may result in an object having its state modified unexpectedly. While occasionally useful for performance reasons, this construct is inherently bug-prone.
How else would I return a Date
?