lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r819892 - in /lucene/solr/trunk/contrib/dataimporthandler: CHANGES.txt src/main/java/org/apache/solr/handler/dataimport/XPathRecordReader.java
Date Tue, 29 Sep 2009 12:05:23 GMT
Author: shalin
Date: Tue Sep 29 12:05:22 2009
New Revision: 819892

URL: http://svn.apache.org/viewvc?rev=819892&view=rev
Log:
SOLR-1465 -- Replaced string concatenations with StringBuilder append calls in XPathRecordReader

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathRecordReader.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt?rev=819892&r1=819891&r2=819892&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt Tue Sep 29 12:05:22 2009
@@ -171,6 +171,9 @@
 4. SOLR-1098: DateFormatTransformer can cache the format objects.
               (Noble Paul via shalin)
 
+5. SOLR-1465: Replaced string concatenations with StringBuilder append calls in XPathRecordReader.
+              (Mark Miller, shalin)
+
 Bug Fixes
 ----------------------
 1. SOLR-800:  Deep copy collections to avoid ConcurrentModificationException in XPathEntityprocessor
while streaming

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathRecordReader.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathRecordReader.java?rev=819892&r1=819891&r2=819892&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathRecordReader.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathRecordReader.java
Tue Sep 29 12:05:22 2009
@@ -288,19 +288,19 @@
             // becuase we are fetching events here we need to ensure the outer
             // loop does not end up doing an extra parser.next()
             isNextEventFetched = true;
-            String text = parser.getText();
+            StringBuilder text = new StringBuilder(parser.getText());
             event = parser.next();
 
             while (true) {
               if(event == CDATA || event == CHARACTERS || event == SPACE) {
-                text = text + parser.getText();
+                text.append(parser.getText());
               } else if(event == START_ELEMENT) {
                 if (flatten) {
                   int starts = 1;
                   while (true) {
                     event = parser.next();
                     if (event == CDATA || event == CHARACTERS || event == SPACE) {
-                      text = text + parser.getText();
+                      text.append(parser.getText());
                     } else if (event == START_ELEMENT) {
                       starts++;
                     } else if (event == END_ELEMENT) {
@@ -319,7 +319,7 @@
               event = parser.next();
             }
             // save the text we have read against the fieldName in the Map values
-            putText(values, text, fieldName, multiValued);
+            putText(values, text.toString(), fieldName, multiValued);
           } else if (event == START_ELEMENT) {
             handleStartElement(parser, childrenFound, handler, values, stack, recordStarted);
           }



Mime
View raw message