mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
some @NotNull assertions (EA-30173)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.psi;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -29,6 +30,7 @@ public abstract class PsiDiamondType extends PsiType {
|
||||
|
||||
public static class DiamondInferenceResult {
|
||||
public static final DiamondInferenceResult EXPLICIT_CONSTRUCTOR_TYPE_ARGS = new DiamondInferenceResult() {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiType[] getTypes() {
|
||||
return PsiType.EMPTY_ARRAY;
|
||||
@@ -41,6 +43,7 @@ public abstract class PsiDiamondType extends PsiType {
|
||||
};
|
||||
|
||||
public static final DiamondInferenceResult NULL_RESULT = new DiamondInferenceResult() {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiType[] getTypes() {
|
||||
return PsiType.EMPTY_ARRAY;
|
||||
@@ -53,6 +56,7 @@ public abstract class PsiDiamondType extends PsiType {
|
||||
};
|
||||
|
||||
public static final DiamondInferenceResult ANONYMOUS_INNER_RESULT = new DiamondInferenceResult() {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiType[] getTypes() {
|
||||
return PsiType.EMPTY_ARRAY;
|
||||
@@ -78,6 +82,7 @@ public abstract class PsiDiamondType extends PsiType {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiType[] getTypes() {
|
||||
if (myErrorMessage != null) {
|
||||
return PsiType.EMPTY_ARRAY;
|
||||
|
||||
@@ -437,7 +437,7 @@ public final class PsiUtil extends PsiUtilCore {
|
||||
return getApplicabilityLevel(method, substitutorForMethod, argList.getExpressionTypes(), getLanguageLevel(argList));
|
||||
}
|
||||
|
||||
public static int getApplicabilityLevel(final PsiMethod method, final PsiSubstitutor substitutorForMethod, final PsiType[] args,
|
||||
public static int getApplicabilityLevel(final PsiMethod method, final PsiSubstitutor substitutorForMethod, @NotNull final PsiType[] args,
|
||||
final LanguageLevel languageLevel) {
|
||||
final PsiParameter[] parms = method.getParameterList().getParameters();
|
||||
if (args.length < parms.length - 1) return ApplicabilityLevel.NOT_APPLICABLE;
|
||||
|
||||
Reference in New Issue
Block a user