java fix type safe