Change getType method for JDK 1.7