diff --git a/CHANGES.txt b/CHANGES.txt index 473b0ace7d4..f57e6550e10 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -487,6 +487,8 @@ Other Changes 35. SOLR-786: Refactor DisMaxQParser to allow overriding certain features of DisMaxQParser (Wojciech Biela via shalin) +36. SOLR-458: Add equals and hashCode methods to NamedList (Stefan Rinner, shalin) + Build ---------------------- 1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers) diff --git a/src/common/org/apache/solr/common/util/NamedList.java b/src/common/org/apache/solr/common/util/NamedList.java index cb0e7ea5944..046b4927afd 100644 --- a/src/common/org/apache/solr/common/util/NamedList.java +++ b/src/common/org/apache/solr/common/util/NamedList.java @@ -61,7 +61,7 @@ public class NamedList implements Cloneable, Serializable, Iterable * Modifying the contents of the Entry[] after calling this constructor may change * the NamedList (in future versions of Solr), but this is not garunteed and should @@ -91,12 +91,12 @@ public class NamedList implements Cloneable, Serializable, Iterable implements Cloneable, Serializable, Iterable[] nameValuePairs) { List result = new ArrayList(); - for (Map.Entry ent : nameValuePairs) { + for (Map.Entry ent : nameValuePairs) { result.add(ent.getKey()); result.add(ent.getValue()); } return result; - } + } /** The total number of name/value pairs */ public int size() { @@ -136,7 +136,7 @@ public class NamedList implements Cloneable, Serializable, Iterable implements Cloneable, Serializable, Iterable implements Cloneable, Serializable, Iterable implements Cloneable, Serializable, Iterable to store the key-value * relationship in NamedList (the keys of which are String-s) - * + * * @param */ public static final class NamedListEntry implements Map.Entry { - public NamedListEntry() { - + public NamedListEntry() { + } - + public NamedListEntry(String _key, T _value) { key = _key; value = _value; } - + public String getKey() { return key; } @@ -288,10 +288,10 @@ public class NamedList implements Cloneable, Serializable, Iterable implements Cloneable, Serializable, Iterable> iterator() { - + final NamedList list = this; - + Iterator> iter = new Iterator>() { - + int idx = 0; - + public boolean hasNext() { return idx < list.size(); } @@ -351,7 +351,7 @@ public class NamedList implements Cloneable, Serializable, Iterable