assert valid substitutor (EA-40074)

This commit is contained in:
peter
2012-10-22 16:29:56 +02:00
parent de9bc374ff
commit e9b700bc8c
2 changed files with 4 additions and 1 deletions
@@ -77,6 +77,8 @@ public class MethodSignatureBackedByPsiMethod extends MethodSignatureBase {
substitutor = JavaPsiFacade.getInstance(method.getProject()).getElementFactory().createRawSubstitutor(substitutor, methodTypeParameters);
methodTypeParameters = PsiTypeParameter.EMPTY_ARRAY;
}
assert substitutor.isValid();
final PsiParameter[] parameters = method.getParameterList().getParameters();
PsiType[] parameterTypes = new PsiType[parameters.length];
@@ -29,10 +29,11 @@ public abstract class MethodSignatureBase implements MethodSignature {
protected MethodSignatureBase(@NotNull PsiSubstitutor substitutor, @NotNull PsiType[] parameterTypes, @NotNull PsiTypeParameter[] typeParameters) {
mySubstitutor = substitutor;
assert substitutor.isValid();
myParameterTypes = parameterTypes.length == 0 ? PsiType.EMPTY_ARRAY : new PsiType[parameterTypes.length];
for (int i = 0; i < parameterTypes.length; i++) {
PsiType type = parameterTypes[i];
assert type.isValid();
assert type == null || type.isValid();
if (type instanceof PsiEllipsisType) type = ((PsiEllipsisType) type).toArrayType();
myParameterTypes[i] = substitutor.substitute(type);
}