From 27844e41ea9e80b5ff59f82eedb8832aefe22bd8 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Fri, 8 Oct 2010 12:01:12 +0200 Subject: [PATCH] create less new variables --- .../forloop/ReplaceForEachLoopWithIndexedForLoopIntention.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/forloop/ReplaceForEachLoopWithIndexedForLoopIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/forloop/ReplaceForEachLoopWithIndexedForLoopIntention.java index d756d88033f8..cb3bace8866f 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/forloop/ReplaceForEachLoopWithIndexedForLoopIntention.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/forloop/ReplaceForEachLoopWithIndexedForLoopIntention.java @@ -198,7 +198,7 @@ public class ReplaceForEachLoopWithIndexedForLoopIntention extends Intention { return createVariable(variableName, expression, context); } final PsiElement target = referenceElement.resolve(); - if (target instanceof PsiLocalVariable) { + if (target instanceof PsiVariable) { // maybe should not do this for local variables outside of // anonymous classes return variableName;