jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1528213 - in /jmeter/trunk: src/jorphan/org/apache/jorphan/collections/HashTree.java src/jorphan/org/apache/jorphan/collections/ListedHashTree.java xdocs/changes.xml
Date Tue, 01 Oct 2013 20:47:45 GMT
Author: pmouawad
Date: Tue Oct  1 20:47:45 2013
New Revision: 1528213

URL: http://svn.apache.org/r1528213
Log:
Bug 55617 - Improvements to jorphan collection
Bugzilla Id: 55617

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java?rev=1528213&r1=1528212&r2=1528213&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java Tue Oct  1 20:47:45
2013
@@ -25,6 +25,7 @@ import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -51,8 +52,6 @@ public class HashTree implements Seriali
 
     private static final long serialVersionUID = 240L;
 
-//    private static final Logger log = LoggingManager.getLoggerForClass();
-    
     // Used for the RuntimeException to short-circuit the traversal
     private static final String FOUND = "found"; // $NON-NLS-1$
 
@@ -185,8 +184,7 @@ public class HashTree implements Seriali
      *            sub tree to add to the node created for the first argument.
      */
     public void add(Object key, HashTree subTree) {
-        add(key);
-        getTree(key).add(subTree);
+        add(key).add(subTree);
     }
 
     /**
@@ -197,8 +195,7 @@ public class HashTree implements Seriali
      */
     public void add(HashTree newTree) {
         for (Object item : newTree.list()) {
-            add(item);
-            getTree(item).add(newTree.getTree(item));
+            add(item).add(newTree.getTree(item));
         }
     }
 
@@ -448,8 +445,7 @@ public class HashTree implements Seriali
      *            value to be added as a key in the secondary node
      */
     public HashTree add(Object key, Object value) {
-        add(key);
-        return getTree(key).add(value);
+        return add(key).add(value);
     }
 
     /**
@@ -463,8 +459,7 @@ public class HashTree implements Seriali
      *            array of objects to be added as keys in the secondary node
      */
     public void add(Object key, Object[] values) {
-        add(key);
-        getTree(key).add(values);
+        add(key).add(values);
     }
 
     /**
@@ -478,8 +473,7 @@ public class HashTree implements Seriali
      *            node
      */
     public void add(Object key, Collection<?> values) {
-        add(key);
-        getTree(key).add(values);
+        add(key).add(values);
     }
 
     /**
@@ -576,8 +570,7 @@ public class HashTree implements Seriali
     protected HashTree addTreePath(Collection<?> treePath) {
         HashTree tree = this;
         for (Object temp : treePath) {
-            tree.add(temp);
-            tree = tree.getTree(temp);
+            tree = tree.add(temp);
         }
         return tree;
     }
@@ -716,7 +709,7 @@ public class HashTree implements Seriali
         if (temp != null) {
             return temp.list();
         }
-        return new HashTree().list();
+        return new HashSet<Object>();
     }
 
     /**
@@ -763,7 +756,7 @@ public class HashTree implements Seriali
         if (tree != null) {
             return tree.list();
         }
-        return new HashTree().list();
+        return new HashSet<Object>();
     }
 
     /**
@@ -881,39 +874,6 @@ public class HashTree implements Seriali
             return false;
         }
         return data.equals(oo.data);
-
-        // boolean flag = true;
-        // if (o instanceof HashTree)
-        // {
-        // HashTree oo = (HashTree) o;
-        // Iterator it = data.keySet().iterator();
-        // while (it.hasNext())
-        // {
-        // if (!oo.containsKey(it.next()))
-        // {
-        // flag = false;
-        // break;
-        // }
-        // }
-        // if (flag)
-        // {
-        // it = data.keySet().iterator();
-        // while (it.hasNext())
-        // {
-        // Object temp = it.next();
-        // flag = get(temp).equals(oo.get(temp));
-        // if (!flag)
-        // {
-        // break;
-        // }
-        // }
-        // }
-        // }
-        // else
-        // {
-        // flag = false;
-        // }
-        // return flag;
     }
 
     /**

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java?rev=1528213&r1=1528212&r2=1528213&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java Tue Oct  1
20:47:45 2013
@@ -25,7 +25,6 @@ import java.io.Serializable;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.jorphan.util.JMeterError;
 
@@ -206,52 +205,8 @@ public class ListedHashTree extends Hash
         }
         ListedHashTree lht = (ListedHashTree) o;
         return (super.equals(lht) && order.equals(lht.order));
-
-        // boolean flag = true;
-        // if (o instanceof ListedHashTree)
-        // {
-        // ListedHashTree oo = (ListedHashTree) o;
-        // Iterator it = order.iterator();
-        // Iterator it2 = oo.order.iterator();
-        // if (size() != oo.size())
-        // {
-        // flag = false;
-        // }
-        // while (it.hasNext() && it2.hasNext() && flag)
-        // {
-        // if (!it.next().equals(it2.next()))
-        // {
-        // flag = false;
-        // }
-        // }
-        // if (flag)
-        // {
-        // it = order.iterator();
-        // while (it.hasNext() && flag)
-        // {
-        // Object temp = it.next();
-        // flag = get(temp).equals(oo.get(temp));
-        // }
-        // }
-        // }
-        // else
-        // {
-        // flag = false;
-        // }
-        // return flag;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public Set<Object> keySet() {
-        return data.keySet();
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public int size() {
-        return data.size();
-    }
 
     private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
{
         ois.defaultReadObject();

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1528213&r1=1528212&r2=1528213&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Oct  1 20:47:45 2013
@@ -487,6 +487,7 @@ To revert to previous behaviour, set the
 <li><bugzilla>55463</bugzilla> - Component.requestFocus() is discouraged;
use requestFocusInWindow() instead</li>
 <li><bugzilla>55486</bugzilla> - New JMeter Logo. Contributed by UBIK Load
Pack (support at ubikloadpack.com)</li>
 <li><bugzilla>55548</bugzilla> - Tidy up use of TestElement.ENABLED; use
TestElement.isEnabled()/setEnabled() throughout</li>
+<li><bugzilla>55617</bugzilla> - Improvements to jorphan collection. Contributed
by Benoit Wiart (benoit.wiart at gmail.com)</li>
 </ul>
 
 <h2>Thanks</h2>



Mime
View raw message