I just tried to extract some code but it was blocked by IDEA due to
having multiple return paths. However, I think this limitation should
be relaxed in the cases were each return path returns a consistent type
(and using the super-most, or interface class as the return).
In the example, the return types are PsiClass and null. null should be
allowed as it is a valid return type. IDEA could also intelligently (if
told to do so) add the @Nullable annotation to the extracted method.
Thoughts? I've entered this in JIRA as IDEA-6537 along with the snippet
of code I was using: