本文整理汇总了Java中com.intellij.psi.util.MethodSignatureBackedByPsiMethod.getSubstitutor方法的典型用法代码示例。如果您正苦于以下问题:Java MethodSignatureBackedByPsiMethod.getSubstitutor方法的具体用法?Java MethodSignatureBackedByPsiMethod.getSubstitutor怎么用?Java MethodSignatureBackedByPsiMethod.getSubstitutor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.util.MethodSignatureBackedByPsiMethod
的用法示例。
在下文中一共展示了MethodSignatureBackedByPsiMethod.getSubstitutor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HierarchicalMethodSignature
import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; //导入方法依赖的package包/类
public HierarchicalMethodSignature(@NotNull MethodSignatureBackedByPsiMethod signature) {
super(signature.getMethod(), signature.getSubstitutor(), signature.isRaw(),
getParameterTypes(signature.getMethod()), signature.getTypeParameters());
}
示例2: visitMethod
import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method)
{
super.visitMethod(method);
if(IGNORE_UNCHECKED_OVERRIDING)
{
return;
}
if(!method.isConstructor())
{
List<HierarchicalMethodSignature> superMethodSignatures = method.getHierarchicalMethodSignature().getSuperSignatures();
if(!superMethodSignatures.isEmpty() && !method.hasModifierProperty(PsiModifier.STATIC))
{
final MethodSignature signature = method.getSignature(PsiSubstitutor.EMPTY);
for(MethodSignatureBackedByPsiMethod superSignature : superMethodSignatures)
{
PsiMethod baseMethod = superSignature.getMethod();
PsiSubstitutor substitutor = MethodSignatureUtil.getSuperMethodSignatureSubstitutor(signature, superSignature);
if(substitutor == null)
{
substitutor = superSignature.getSubstitutor();
}
if(PsiUtil.isRawSubstitutor(baseMethod, superSignature.getSubstitutor()))
{
continue;
}
final PsiType baseReturnType = substitutor.substitute(baseMethod.getReturnType());
final PsiType overriderReturnType = method.getReturnType();
if(baseReturnType == null || overriderReturnType == null)
{
return;
}
if(JavaGenericsUtil.isRawToGeneric(baseReturnType, overriderReturnType))
{
final String message = JavaErrorMessages.message("unchecked.overriding.incompatible.return.type", JavaHighlightUtil.formatType(overriderReturnType), JavaHighlightUtil
.formatType(baseReturnType));
final PsiTypeElement returnTypeElement = method.getReturnTypeElement();
LOG.assertTrue(returnTypeElement != null);
registerProblem(message, null, returnTypeElement, LocalQuickFix.EMPTY_ARRAY);
}
}
}
}
}