cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r764038 - in /cxf/branches/2.1.x-fixes: ./ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/ ...
Date Fri, 10 Apr 2009 20:31:50 GMT
Author: dkulp
Date: Fri Apr 10 20:31:50 2009
New Revision: 764038

URL: http://svn.apache.org/viewvc?rev=764038&view=rev
Log:
Merged revisions 761120,762567 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r761120 | bimargulies | 2009-04-01 20:29:08 -0400 (Wed, 01 Apr 2009) | 2 lines
  
  CXF-2143.
........
  r762567 | bimargulies | 2009-04-06 19:35:52 -0400 (Mon, 06 Apr 2009) | 2 lines
  
  CXF-2130, CXF-2143
........

Added:
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java
      - copied, changed from r761120, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/TimezoneLessXsDateFormat.java
      - copied unchanged from r761120, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/TimezoneLessXsDateFormat.java
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DateTimezoneTest.java
      - copied unchanged from r762567, cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DateTimezoneTest.java
Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 10 20:31:50 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761759,761789,762393
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761759,761789,762393,762567

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java?rev=764038&r1=764037&r2=764038&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
Fri Apr 10 20:31:50 2009
@@ -74,7 +74,7 @@
             }
         
             if (baseType != null) {
-                LOG.info("xsi:type=\"" + overrideName
+                LOG.debug("xsi:type=\"" + overrideName
                          + "\" was specified, but no corresponding Type was registered; defaulting
to "
                          + baseType.getSchemaType());
                 return baseType;

Copied: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java
(from r761120, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java)
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java?p2=cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java&p1=cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java&r1=761120&r2=764038&rev=764038&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java
Fri Apr 10 20:31:50 2009
@@ -55,8 +55,13 @@
 
     @Override
     public void writeObject(Object object, MessageWriter writer, Context context) {
-        Calendar c = Calendar.getInstance();
-        c.setTime((Date)object);
+        Calendar c;
+        if (object instanceof Calendar) {
+            c = (Calendar) object;
+        } else {
+            c = Calendar.getInstance();
+            c.setTime((Date) object);
+        }
         writer.writeValue(format.format(c));
     }
 }

Modified: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java?rev=764038&r1=764037&r2=764038&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/date/XsDateTimeFormat.java
Fri Apr 10 20:31:50 2009
@@ -40,17 +40,24 @@
     final boolean parseDate;
 
     final boolean parseTime;
+    
+    final boolean parseTimezone;
 
     XsDateTimeFormat(boolean pParseDate, boolean pParseTime) {
+      this(pParseDate, pParseTime, true);
+    }
+    
+    XsDateTimeFormat(boolean pParseDate, boolean pParseTime, boolean pParseTimezone) {
         parseDate = pParseDate;
         parseTime = pParseTime;
+        parseTimezone = pParseTimezone;
     }
 
     /**
      * Creates a new instance.
      */
     public XsDateTimeFormat() {
-        this(true, true);
+        this(true, true, true);
     }
 
 
@@ -136,27 +143,29 @@
                 append(pBuffer, millis, 3);
             }
         }
-        TimeZone tz = cal.getTimeZone();
-        // JDK 1.4: int offset = tz.getOffset(cal.getTimeInMillis());
-        int offset = cal.get(Calendar.ZONE_OFFSET);
-        if (tz.inDaylightTime(cal.getTime())) {
-            offset += cal.get(Calendar.DST_OFFSET);
-        }
-        if (offset == 0) {
-            pBuffer.append('Z');
-        } else {
-            if (offset < 0) {
-                pBuffer.append('-');
-                offset = -offset;
+        if (parseTimezone) {
+            TimeZone tz = cal.getTimeZone();
+            // JDK 1.4: int offset = tz.getOffset(cal.getTimeInMillis());
+            int offset = cal.get(Calendar.ZONE_OFFSET);
+            if (tz.inDaylightTime(cal.getTime())) {
+                offset += cal.get(Calendar.DST_OFFSET);
+            }
+            if (offset == 0) {
+                pBuffer.append('Z');
             } else {
-                pBuffer.append('+');
+                if (offset < 0) {
+                    pBuffer.append('-');
+                    offset = -offset;
+                } else {
+                    pBuffer.append('+');
+                }
+                int minutes = offset / (60 * 1000);
+                int hours = minutes / 60;
+                minutes -= hours * 60;
+                append(pBuffer, hours, 2);
+                pBuffer.append(':');
+                append(pBuffer, minutes, 2);
             }
-            int minutes = offset / (60 * 1000);
-            int hours = minutes / 60;
-            minutes -= hours * 60;
-            append(pBuffer, hours, 2);
-            pBuffer.append(':');
-            append(pBuffer, minutes, 2);
         }
         return pBuffer;
     }



Mime
View raw message