Project stanfordnlp/CoreNLP in file ...6/src.edu.stanford.nlp.classify.KNNClassifier.java (2013-08-19)
@@ -6,6 +6,7 @@ import edu.stanford.nlp.ling.Datum;
 import edu.stanford.nlp.ling.RVFDatum;
 import edu.stanford.nlp.stats.*;
 import edu.stanford.nlp.util.CollectionValuedMap;
+import edu.stanford.nlp.util.Generics;
 
 /**
  * A simple k-NN classifier, with the options of using unit votes, or weighted votes (by 
@@ -25,7 +26,7 @@ public class KNNClassifier<K,V> implements Classifier<K, V> {
   private static final long serialVersionUID = 7115357548209007944L;
   private boolean weightedVotes = false; // whether this is a weighted vote (by sim), or not
   private CollectionValuedMap<K, Counter<V>> instances = new CollectionValuedMap<K, Counter<V>>();
-  private Map<Counter<V>, K> classLookup = new HashMap<Counter<V>, K>();
+  private Map<Counter<V>, K> classLookup = Generics.newHashMap();
   private boolean l2Normalize = false;
   int k = 0;