Spectral types and masses of white dwarfs in globular clusters