You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by am...@apache.org on 2007/02/12 08:41:47 UTC

svn commit: r506352 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java

Author: amilas
Date: Sun Feb 11 23:41:47 2007
New Revision: 506352

URL: http://svn.apache.org/viewvc?view=rev&rev=506352
Log:
used a new data format object in simple type mapper. static object produce and exception


Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?view=diff&rev=506352&r1=506351&r2=506352
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java Sun Feb 11 23:41:47 2007
@@ -25,14 +25,6 @@
 
 public class SimpleTypeMapper {
 
-    private static SimpleDateFormat zulu =
-            new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
-    //  0123456789 0 123456789
-
-    static {
-        zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
-    }
-
     private static final String STRING = "java.lang.String";
     private static final String W_INT = "java.lang.Integer";
     private static final String W_DOUBLE = "java.lang.Double";
@@ -203,8 +195,12 @@
                 return obj.toString();
             }
         } else if (obj instanceof Calendar) {
+            SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+            zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
             return zulu.format(((Calendar) obj).getTime());
         } else if (obj instanceof Date) {
+            SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+            zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
             return zulu.format(obj);
         }
         return obj.toString();
@@ -238,9 +234,9 @@
         }
         // convert what we have validated so far
         try {
-            synchronized (zulu) {
+                SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+                zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
                 date = zulu.parse(source.substring(0, 19) + ".000Z");
-            }
         } catch (Exception e) {
             throw new NumberFormatException(e.toString());
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org