diff --git a/CHANGES.txt b/CHANGES.txt index 36d90a0969..f942571c12 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 bfb1673222..cab52cf2bd 100644 --- a/src/java/org/apache/hadoop/io/WritableComparator.java +++ b/src/java/org/apache/hadoop/io/WritableComparator.java @@ -53,7 +53,6 @@ WritableComparator get(Class c) { // if not, use the generic one if (comparator == null) { comparator = new WritableComparator(c, true); - comparators.put(c, comparator); } } return comparator; @@ -75,7 +74,8 @@ private static void forceInit(Class cls) { } /** 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);