hunthu2000 / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

Calendar setDate() side effect #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Invoke CalendarWidget.setDate(...), any of the overloaded versions of
the method.
2. The method will modify the passed date. Also, if the client code
modifies the date, it inadvertently could affect the Calendar widget behavior. 
3. Apply a 'defensive copy' approach on the setter.

This is the original feedback kindly provided by Daniele Renda.

Hi,
I think that setDate(Date date) method of CalendarWidget should be use
a clone() of the date parameter.Infact in this method you reset time
but the user that call this method don't know about this!
Only watch the sources I noticed this behaviuor. So I think that the
parameter that a client send to the library should be not modified.

Thanks

Best regards

Daniele

Original issue reported on code.google.com by carlos.m...@gmail.com on 29 Apr 2010 at 3:32

GoogleCodeExporter commented 9 years ago
Resolved in revision 298.

Original comment by carlos.m...@gmail.com on 29 Apr 2010 at 3:34

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 12 May 2010 at 7:05