Minor, make JavaMethod#getReturnType non-null

PsiMethod#getReturnType only returns null for constructors, and JavaMethod is
not created for constructors (JavaConstructor is)
This commit is contained in:
Alexander Udalov
2015-06-25 23:01:10 +03:00
parent b064b947ce
commit cd847b7cb9
4 changed files with 16 additions and 15 deletions
@@ -64,9 +64,10 @@ public class JavaMethodImpl extends JavaMemberImpl<PsiMethod> implements JavaMet
}
@Override
@Nullable
@NotNull
public JavaType getReturnType() {
PsiType psiType = getPsi().getReturnType();
return psiType == null ? null : JavaTypeImpl.create(psiType);
assert psiType != null : "Method is not a constructor and has no return type: " + getName();
return JavaTypeImpl.create(psiType);
}
}