DetectedJavaChangeInfo (PsiMethod method, final boolean delegate) { final String newVisibility = VisibilityUtil.getVisibilityModifier(method.getModifierList()); final PsiType returnType = method.getReturnType(); final CanonicalTypes.Type newReturnType = returnType != null ? CanonicalTypes.createTypeWrapper(returnType) : null; final ParameterInfoImpl[] parameterInfos = ParameterInfoImpl.fromMethod(method); for (ParameterInfoImpl parameterInfo : parameterInfos) { if (!parameterInfo.getTypeWrapper().isValid()) { return null; } } final DetectedJavaChangeInfo fromMethod = new DetectedJavaChangeInfo(newVisibility, method, newReturnType, parameterInfos, null, method.getName(), method.getName(), delegate); final PsiMethod deepestSuperMethod = method.findDeepestSuperMethod(); if (deepestSuperMethod != null) { if (!deepestSuperMethod.getManager().isInProject(deepestSuperMethod)) return null; } fromMethod.setSuperMethod(deepestSuperMethod); return fromMethod; }