axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/utils JavaUtils.java
Date Fri, 02 Jul 2004 13:06:18 GMT
ias         2004/07/02 06:06:18

  Modified:    java/src/org/apache/axis/utils JavaUtils.java
  Log:
  Enhance mutual conversion between Calendar and Date.
  
  Revision  Changes    Path
  1.111     +9 -0      ws-axis/java/src/org/apache/axis/utils/JavaUtils.java
  
  Index: JavaUtils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/JavaUtils.java,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- JavaUtils.java	2 Jun 2004 18:06:26 -0000	1.110
  +++ JavaUtils.java	2 Jul 2004 13:06:18 -0000	1.111
  @@ -211,6 +211,11 @@
           if (arg instanceof Calendar && destClass == Date.class) {
               return ((Calendar) arg).getTime();
           }
  +        if (arg instanceof Date && destClass == Calendar.class) {
  +        	Calendar calendar = Calendar.getInstance();
  +        	calendar.setTime((Date) arg);
  +            return calendar;
  +        }
   
           // Convert between Calendar and java.sql.Date
           if (arg instanceof Calendar && destClass == java.sql.Date.class) {
  @@ -515,6 +520,10 @@
               
               // Allow mapping of Calendar to Date
               if (Calendar.class.isAssignableFrom(src) && dest == Date.class)
  +                return true;
  +
  +            // Allow mapping of Date to Calendar
  +            if (Date.class.isAssignableFrom(src) && dest == Calendar.class)
                   return true;
   
               // Allow mapping of Calendar to java.sql.Date
  
  
  

Mime
View raw message