void (@NotNull PsiInstanceOfExpression expression) { PsiPrimaryPattern pattern = expression.getPattern(); if (pattern == null) { return; } //without support deconstruction if (assignedVariablesInCondition(expression) || !(pattern instanceof PsiTypeTestPattern typeTestPattern) || typeTestPattern.getPatternVariable() == null) { return; } LocalQuickFix quickFix = new ConvertInstanceOfPatternToCastFix(pattern, tryToPreserveUnusedVariables); if (InspectionProjectProfileManager.isInformationLevel(getShortName(), pattern)) { holder.registerProblem(expression, TextRange.create(expression.getOperand().getStartOffsetInParent(), pattern.getStartOffsetInParent() + pattern.getTextLength()), JavaBundle.message("inspection.message.pattern.variables.can.be.replaced.with.cast"), quickFix); } else { holder.registerProblem(expression, TextRange.create(pattern.getStartOffsetInParent(), pattern.getStartOffsetInParent() + pattern.getTextLength()), JavaBundle.message("inspection.message.pattern.variables.can.be.replaced.with.cast"), quickFix); } }