axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isur...@apache.org
Subject svn commit: r809992 - /webservices/axis2/trunk/java/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
Date Tue, 01 Sep 2009 12:00:42 GMT
Author: isurues
Date: Tue Sep  1 12:00:42 2009
New Revision: 809992

URL: http://svn.apache.org/viewvc?rev=809992&view=rev
Log:
using a StringBuffer to support large JSON strings

Modified:
    webservices/axis2/trunk/java/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java

Modified: webservices/axis2/trunk/java/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java?rev=809992&r1=809991&r2=809992&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
(original)
+++ webservices/axis2/trunk/java/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
Tue Sep  1 12:00:42 2009
@@ -170,11 +170,13 @@
         } else {
             try {
                 char temp = (char)jsonReader.read();
-                jsonString = "";
+                // use a buffer to support long json strings better..
+                StringBuilder sb = new StringBuilder(100);
                 while ((int)temp != 65535) {
-                    jsonString += temp;
+                    sb.append(temp);
                     temp = (char)jsonReader.read();
                 }
+                jsonString = sb.toString();
             } catch (IOException e) {
                 throw new OMException();
             }



Mime
View raw message