void (@NotNull PsiLiteralExpression expression) { super.visitLiteralExpression(expression); final PsiType type = expression.getType(); if (TypeUtils.isJavaLangString(type)) { final String value = (String)expression.getValue(); if (!isHardcodedFilenameString(value)) { return; } final PsiElement parent = ParenthesesUtils.getParentSkipParentheses(expression); if (parent != null) { final PsiElement grandParent = parent.getParent(); if (grandParent instanceof PsiMethodCallExpression methodCallExpression) { if (MethodCallUtils.isCallToRegexMethod(methodCallExpression) || myMethodMatcher.matches(methodCallExpression)) { return; } } else if (grandParent instanceof PsiNewExpression newExpression) { if (TypeUtils.expressionHasTypeOrSubtype(newExpression, "javax.swing.ImageIcon")) { return; } } } registerErrorInString(expression); } else if (type != null && type.equals(PsiTypes.charType())) { final Character value = (Character)expression.getValue(); if (value == null) { return; } final char unboxedValue = value.charValue(); if (unboxedValue == BACKSLASH || unboxedValue == SLASH) { registerErrorAtOffset(expression, 1, expression.getTextLength() - 2); } } }