incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r429886 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core: pages/CalendarUtils.java xhtml/ChooseDateRenderer.java xhtml/SimpleInputDateRenderer.java
Date Tue, 08 Aug 2006 23:42:19 GMT
Author: awiner
Date: Tue Aug  8 16:42:18 2006
New Revision: 429886

URL: http://svn.apache.org/viewvc?rev=429886&view=rev
Log:
Check in Simon Lessard's patch for ADFFACES-118: Previous/Next date not working in ChooseDate

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pages/CalendarUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pages/CalendarUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pages/CalendarUtils.java?rev=429886&r1=429885&r2=429886&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pages/CalendarUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pages/CalendarUtils.java
Tue Aug  8 16:42:18 2006
@@ -117,6 +117,7 @@
    * Adjust the specified dateValue in milliseconds, which is in 
    * AdfRenderingContext's LocaleContext's timeZone to the server timeZone.
    */
+  @SuppressWarnings("cast")
   private static long _adjustTimeZone(long dateValueInMs)
   {
     // Bug 4613506
@@ -142,11 +143,15 @@
     // maximum date (in ChooseDateRenderer).
     if (tzOffset < 0)
     {
-      tzOffset = Math.max(tzOffset, Long.MIN_VALUE - dateValueInMs);
+      // Cast to (float) has a purpose
+      tzOffset = (long)Math.max((float)tzOffset, 
+                                (float)Long.MIN_VALUE - (float)dateValueInMs);
     }
     else
     {
-      tzOffset = Math.min(tzOffset, Long.MAX_VALUE - dateValueInMs);
+      // Cast to (float) has a purpose
+      tzOffset = (long)Math.min((float)tzOffset, 
+                                (float)Long.MAX_VALUE - (float)dateValueInMs);
     }
     
     return dateValueInMs + tzOffset;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java?rev=429886&r1=429885&r2=429886&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
Tue Aug  8 16:42:18 2006
@@ -1117,7 +1117,7 @@
   }
 
 
-  @SuppressWarnings("deprecation")
+  @SuppressWarnings({ "deprecation", "cast" })
   private static long _getTimeAttr(
     RenderingContext arc,
     FacesBean   bean,
@@ -1170,11 +1170,15 @@
         // maximum date.
         if (tzOffset < 0)
         {
-          tzOffset = Math.max(tzOffset, Long.MIN_VALUE - dateValueInMs);
+          // Cast to (float) has a purpose
+          tzOffset = (long)Math.max((float)tzOffset, 
+                                    (float)Long.MIN_VALUE - (float)dateValueInMs);
         }
         else
         {
-          tzOffset = Math.min(tzOffset, Long.MAX_VALUE - dateValueInMs);
+          // Cast to (float) has a purpose
+          tzOffset = (long)Math.min((float)tzOffset, 
+                                    (float)Long.MAX_VALUE - (float)dateValueInMs);
         }
 
         // adjust the date in ms to the adjusted time zone.

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java?rev=429886&r1=429885&r2=429886&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
Tue Aug  8 16:42:18 2006
@@ -545,6 +545,7 @@
    * Adjust the specified date, which is in server timeZone to the timeZone
    * found in RequestContext and return the new date long value.
    */
+  @SuppressWarnings("cast")
   private static long _adjustTimeZone(Date date)
   {
     // get the current date of the server
@@ -573,11 +574,15 @@
     // properly ie. MIN_VALUE < (longValue + tzOffset) < MAX_VALUE.
     if (tzOffset < 0)
     {
-      tzOffset = Math.max(tzOffset, Long.MIN_VALUE - dateValueInMs);
+      // Cast to (float) has a purpose
+      tzOffset = (long)Math.max((float)tzOffset, 
+                                (float)Long.MIN_VALUE - (float)dateValueInMs);
     }
     else
     {
-      tzOffset = Math.min(tzOffset, Long.MAX_VALUE - dateValueInMs);
+      // Cast to (float) has a purpose
+      tzOffset = (long)Math.min((float)tzOffset, 
+                                (float)Long.MAX_VALUE - (float)dateValueInMs);
     }
 
     // adjust the date in ms to the adjusted time zone.



Mime
View raw message