SPARK-1583: Fix a bug that using java.util.HashMap by mistake

JIRA: https://issues.apache.org/jira/browse/SPARK-1583

Does anyone know why using `java.util.HashMap` rather than `mutable.HashMap`? Some methods of `java.util.HashMap` are not generics and compiler can not help us find similar problems.

Author: zsxwing <zsxwing@gmail.com>

Closes #500 from zsxwing/SPARK-1583 and squashes the following commits:

7bfd74d [zsxwing] SPARK-1583: Fix a bug that using java.util.HashMap by mistake

(cherry picked from commit a66460661303bd652b5c5d32860216cc3ceb7f98)
Signed-off-by: Reynold Xin <rxin@apache.org>