[boxing-optimization] fixed isSafeCast, so it doesn't use Class.forName()