Fix Java6 compatibility issue