AIOOBE for groovy (IDEA-141775)

This commit is contained in:
Anna Kozlova
2015-06-24 09:55:35 +03:00
parent 6fd350576a
commit e959aeb230
@@ -134,6 +134,9 @@ public class ExtractLightMethodObjectHandler {
final PsiElement[] elementsCopy = CodeInsightUtil.findStatementsInRange(copy,
firstElementCopy.getTextRange().getStartOffset(),
anchor.getTextRange().getStartOffset());
if (elementsCopy.length == 0) {
return null;
}
if (elementsCopy[elementsCopy.length - 1] instanceof PsiExpressionStatement) {
final PsiExpression expr = ((PsiExpressionStatement)elementsCopy[elementsCopy.length - 1]).getExpression();
if (!(expr instanceof PsiAssignmentExpression)) {