public void generateMethodBody(GrMethod method) { final GrOpenBlock block = method.getBlock(); boolean shouldInsertReturnNull; myExitPoints.clear(); PsiType returnType = context.typeProvider.getReturnType(method); if (!method.isConstructor() && returnType != PsiType.VOID) { myExitPoints.addAll(ControlFlowUtils.collectReturns(block)); shouldInsertReturnNull = block != null && !(returnType instanceof PsiPrimitiveType) && MissingReturnInspection.methodMissesSomeReturns( block, MissingReturnInspection.ReturnStatus.getReturnStatus(method)); } else { shouldInsertReturnNull = false; } if (block != null) { generateCodeBlock(block, shouldInsertReturnNull); } }