diff --git a/CHANGES.txt b/CHANGES.txt index 36d90a0969d..f942571c124 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -682,6 +682,9 @@ Release 0.21.1 - Unreleased HADOOP-7194. Fix resource leak in IOUtils.copyBytes(..). (Devaraj K via szetszwo) + HADOOP-7183. WritableComparator.get should not cache comparator objects. + (tomwhite via eli) + Release 0.21.0 - 2010-08-13 INCOMPATIBLE CHANGES diff --git a/src/java/org/apache/hadoop/io/WritableComparator.java b/src/java/org/apache/hadoop/io/WritableComparator.java index bfb16732222..cab52cf2bda 100644 --- a/src/java/org/apache/hadoop/io/WritableComparator.java +++ b/src/java/org/apache/hadoop/io/WritableComparator.java @@ -53,7 +53,6 @@ public class WritableComparator implements RawComparator { // if not, use the generic one if (comparator == null) { comparator = new WritableComparator(c, true); - comparators.put(c, comparator); } } return comparator; @@ -75,7 +74,8 @@ public class WritableComparator implements RawComparator { } /** Register an optimized comparator for a {@link WritableComparable} - * implementation. */ + * implementation. Comparators registered with this method must be + * thread-safe. */ public static synchronized void define(Class c, WritableComparator comparator) { comparators.put(c, comparator);