continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r365686 - /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java
Date Tue, 03 Jan 2006 17:06:06 GMT
Author: evenisse
Date: Tue Jan  3 09:06:04 2006
New Revision: 365686

URL: http://svn.apache.org/viewcvs?rev=365686&view=rev
Log:
Add more check for null value

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java?rev=365686&r1=365685&r2=365686&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java
Tue Jan  3 09:06:04 2006
@@ -66,19 +66,22 @@
         OgnlValueStack stack = getStack();
         //find the name on the valueStack, and cast it to a date
         Object dateObj = stack.findValue( actualName );
-        if ( dateObj instanceof Date )
+        if ( dateObj != null )
         {
-            date = (Date) dateObj;
-        }
-        else if ( dateObj instanceof Long )
-        {
-            Calendar cal = Calendar.getInstance();
-            cal.setTimeInMillis( ( (Long) dateObj).longValue() );
-            date = cal.getTime();
-        }
-        else
-        {
-            throw new JspException( "Could not cast the requested object " + nameAttr + "
to a java.util.Date" );
+            if ( dateObj instanceof Date )
+            {
+                date = (Date) dateObj;
+            }
+            else if ( dateObj instanceof Long )
+            {
+                Calendar cal = Calendar.getInstance();
+                cal.setTimeInMillis( ( (Long) dateObj).longValue() );
+                date = cal.getTime();
+            }
+            else
+            {
+                throw new JspException( "Could not cast the requested object " + nameAttr
+ " to a java.util.Date" );
+            }
         }
 
         if ( date != null )



Mime
View raw message