axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r531774 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Date Tue, 24 Apr 2007 05:56:13 GMT
Author: amilas
Date: Mon Apr 23 22:56:12 2007
New Revision: 531774

URL: http://svn.apache.org/viewvc?view=rev&rev=531774
Log:
change the coverter util to support integers given in +1000

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?view=diff&rev=531774&r1=531773&r2=531774
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Mon Apr 23 22:56:12 2007
@@ -207,14 +207,23 @@
 
 
     public static int convertToInt(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return Integer.parseInt(s);
     }
 
     public static BigDecimal convertToBigDecimal(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new BigDecimal(s);
     }
 
     public static double convertToDouble(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         if (POSITIVE_INFINITY.equals(s)) {
             return Double.POSITIVE_INFINITY;
         } else if (NEGATIVE_INFINITY.equals(s)) {
@@ -224,10 +233,16 @@
     }
 
     public static BigDecimal convertToDecimal(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new BigDecimal(s);
     }
 
     public static float convertToFloat(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         if (POSITIVE_INFINITY.equals(s)) {
             return Float.POSITIVE_INFINITY;
         } else if (NEGATIVE_INFINITY.equals(s)) {
@@ -241,10 +256,16 @@
     }
 
     public static long convertToLong(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return Long.parseLong(s);
     }
 
     public static short convertToShort(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return Short.parseShort(s);
     }
 
@@ -386,34 +407,58 @@
     }
 
     public static UnsignedLong convertToUnsignedLong(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new UnsignedLong(s);
     }
 
     public static UnsignedInt convertToUnsignedInt(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new UnsignedInt(s);
     }
 
     public static UnsignedShort convertToUnsignedShort(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new UnsignedShort(s);
     }
 
     public static UnsignedByte convertToUnsignedByte(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new UnsignedByte(s);
     }
 
     public static NonNegativeInteger convertToNonNegativeInteger(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new NonNegativeInteger(s);
     }
 
     public static NegativeInteger convertToNegativeInteger(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new NegativeInteger(s);
     }
 
     public static PositiveInteger convertToPositiveInteger(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new PositiveInteger(s);
     }
 
     public static NonPositiveInteger convertToNonPositiveInteger(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new NonPositiveInteger(s);
     }
 
@@ -476,10 +521,16 @@
     }
 
     public static BigInteger convertToInteger(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return new BigInteger(s);
     }
 
     public static BigInteger convertToBigInteger(String s) {
+        if (s.startsWith("+")) {
+            s = s.substring(1);
+        }
         return convertToInteger(s);
     }
 



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


Mime
View raw message