This won't result in pvm being null, it'll result in a class cast exception if it fails. 

Either we're confident it never will, in which case remove the null check, or we're not confident in which case use 'x as y'