axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r492020 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Date Wed, 03 Jan 2007 02:30:46 GMT
Author: dims
Date: Tue Jan  2 18:30:45 2007
New Revision: 492020

URL: http://svn.apache.org/viewvc?view=rev&rev=492020
Log:
port 491948 - remove duplicates calls to objectList.get(i)

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=492020&r1=492019&r2=492020
==============================================================================
--- 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
Tue Jan  2 18:30:45 2007
@@ -696,56 +696,65 @@
         Object returnArray = Array.newInstance(baseArrayClass, listSize);
         if (int.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setInt(returnArray, i, Integer.parseInt(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setInt(returnArray, i, Integer.parseInt(o.toString()));
                 }
             }
         } else if (float.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setFloat(returnArray, i, Float.parseFloat(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setFloat(returnArray, i, Float.parseFloat(o.toString()));
                 }
             }
         } else if (short.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setShort(returnArray, i, Short.parseShort(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setShort(returnArray, i, Short.parseShort(o.toString()));
                 }
             }
         } else if (byte.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setByte(returnArray, i, Byte.parseByte(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setByte(returnArray, i, Byte.parseByte(o.toString()));
                 }
             }
         } else if (long.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setLong(returnArray, i, Long.parseLong(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setLong(returnArray, i, Long.parseLong(o.toString()));
                 }
             }
         } else if (boolean.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setBoolean(returnArray, i, Boolean.getBoolean(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setBoolean(returnArray, i, Boolean.getBoolean(o.toString()));
                 }
             }
         } else if (char.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setChar(returnArray, i, objectList.get(i).toString().toCharArray()[0]);
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setChar(returnArray, i, o.toString().toCharArray()[0]);
                 }
             }
         } else if (double.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.setDouble(returnArray, i, Double.parseDouble(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.setDouble(returnArray, i, Double.parseDouble(o.toString()));
                 }
             }
         } else if (Calendar.class.equals(baseArrayClass)) {
             for (int i = 0; i < listSize; i++) {
-                if (objectList.get(i) != null) {
-                    Array.set(returnArray, i, convertToDateTime(objectList.get(i).toString()));
+                Object o = objectList.get(i);
+                if (o != null) {
+                    Array.set(returnArray, i, convertToDateTime(o.toString()));
                 }
             }
         } else {



---------------------------------------------------------------------
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