Removed unncecessary casts from generation of try-with-resource (#1125)
Fixed test .src becuase of changes to generation of try-with-resource (#1125)