jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1380049 - /jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java
Date Sun, 02 Sep 2012 20:23:10 GMT
Author: pmouawad
Date: Sun Sep  2 20:23:09 2012
New Revision: 1380049

URL: http://svn.apache.org/viewvc?rev=1380049&view=rev
Log:
USe interface instead of impl
Avoid StringBuilder creation in loop

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java?rev=1380049&r1=1380048&r2=1380049&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java Sun Sep  2 20:23:09
2012
@@ -48,7 +48,7 @@ public class Data implements Serializabl
 
     private final Map<String, List<Object>> data;
 
-    private ArrayList<String> header;
+    private List<String> header;
 
     // saves current position in data List
     private int currentPos, size;
@@ -268,8 +268,8 @@ public class Data implements Serializabl
      *            value to set into column.
      */
     public void addColumnValue(String column, Object value) {
-        ArrayList<Object> tempList;
-        if ((tempList = (ArrayList<Object>) data.get(column)) == null) {
+        List<Object> tempList;
+        if ((tempList = data.get(column)) == null) {
             tempList = new ArrayList<Object>();
             data.put(column, tempList);
         }
@@ -660,8 +660,9 @@ public class Data implements Serializabl
         line[0] = temp.toString();
         reset();
         int index = 1;
+        temp = new StringBuilder();
         while (next()) {
-            temp = new StringBuilder("");
+            temp.setLength(0);
             for (int count = 0; count < elements.length; count++) {
                 temp.append(getColumnValue(count));
                 if (count + 1 < elements.length) {



Mime
View raw message