Update code checks both non-null and instance of a class in jdk.jdi module classes.
The checks and explicit casts could also be replaced with pattern matching for the instanceof operator.
The checks and explicit casts could also be replaced with pattern matching for the instanceof operator.