Update class to be compatible with jdk1.6.