fix java 1.6 replace method of maps