Author: ehillenius
Date: Tue Jul  3 17:49:39 2007
New Revision: 553029

URL: http://svn.apache.org/viewvc?view=rev&rev=553029
Log:
added cast check

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java?view=diff&rev=553029&r1=553028&r2=553029
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DatePicker.java
 Tue Jul  3 17:49:39 2007
@@ -263,9 +263,11 @@
                // TODO localize
                widgetProperties.put("title", "Select a date:");
 
-               Date date = (Date)component.getModelObject();
-               if (date != null)
+               Object modelObject = component.getModelObject();
+               // null and cast check
+               if (modelObject instanceof Date)
                {
+                       Date date = (Date)modelObject;
                        widgetProperties.put("selected", 
AbstractCalendar.FORMAT_DATE.format(date));
                        widgetProperties.put("pagedate", 
AbstractCalendar.FORMAT_PAGEDATE.format(date));
                }


Reply via email to