[java][resolve] IDEA-271676 Pattern matching for switch: fix resolve