Given the code
if (object instanceof JarArtifact) {
try (JarArtifact a = (JarArtifact) object) {
a rewrite using InstanceOfPatternMatch results in
if (object instanceof JarArtifact a) {
try () {
A fix could be to simply remove the parenthesis
if (object instanceof JarArtifact a) {
try {
but that may leave the object unclosed, so it should probably be left alone.
Given the code
a rewrite using
InstanceOfPatternMatchresults inA fix could be to simply remove the parenthesis
but that may leave the object unclosed, so it should probably be left alone.