cleanup: get rid of usages of deprecated constants from PsiType (IDEA-309438)

GitOrigin-RevId: 3373eb8b47af51b9f6dd71e565f773d69e8a3218
This commit is contained in:
Nikolay Chashnikov
2023-01-26 12:17:29 +01:00
committed by intellij-monorepo-bot
parent 0a1df5c00a
commit 8ce3039acf
709 changed files with 2554 additions and 2576 deletions

View File

@@ -734,7 +734,7 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
if (typeElement.isInferredType()) {
// replace inferred type with explicit type if possible
final PsiType type = typeElement.getType();
if (type == PsiType.NULL || type instanceof PsiLambdaParameterType || type instanceof PsiLambdaExpressionType) {
if (type == PsiTypes.nullType() || type instanceof PsiLambdaParameterType || type instanceof PsiLambdaExpressionType) {
return typeElement;
}
final String canonicalText = type.getCanonicalText();

View File

@@ -149,7 +149,7 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
@Override
public void visitLiteralExpression(@NotNull PsiLiteralExpression expression) {
final PsiType type = expression.getType();
if (PsiType.BOOLEAN.equals(type) || PsiType.NULL.equals(type)) {
if (PsiTypes.booleanType().equals(type) || PsiTypes.nullType().equals(type)) {
// don't search index for literals of other types, as they can be written in many many kinds of ways for the same value.
if (!handleWord(expression.getText(), CODE, myCompilingVisitor.getContext())) return;
}
@@ -262,7 +262,7 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
if (StringUtil.isQuotedString(text)) {
@Nullable final MatchingHandler handler = myCompilingVisitor.processPatternStringWithFragments(text, LITERAL);
if (PsiType.CHAR.equals(expression.getType()) &&
if (PsiTypes.charType().equals(expression.getType()) &&
(handler instanceof LiteralWithSubstitutionHandler || handler == null && expression.getValue() == null)) {
throw new MalformedPatternException(SSRBundle.message("error.bad.character.literal"));
}
@@ -271,7 +271,7 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
}
}
else {
if (!PsiType.NULL.equals(expression.getType()) && expression.getValue() == null) {
if (!PsiTypes.nullType().equals(expression.getType()) && expression.getValue() == null) {
throw new MalformedPatternException(SSRBundle.message("error.bad.literal"));
}
}