EA-40189 - AIOOBE: IntroduceVariableBase.getSettings

This commit is contained in:
anna
2012-10-22 17:10:44 +02:00
parent 3c796d7901
commit f6d57b026a
@@ -964,7 +964,7 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
final boolean replaceAll =
replaceChoice == OccurrencesChooser.ReplaceChoice.ALL || replaceChoice == OccurrencesChooser.ReplaceChoice.NO_WRITE;
final SuggestedNameInfo suggestedName = getSuggestedName(typeSelectorManager.getDefaultType(), expr, anchor);
final String variableName = suggestedName.names[0];
final String variableName = suggestedName.names.length > 0 ? suggestedName.names[0] : "";
final boolean declareFinal = replaceAll && declareFinalIfAll || !anyAssignmentLHS && createFinals(project);
final boolean replaceWrite = anyAssignmentLHS && replaceChoice == OccurrencesChooser.ReplaceChoice.ALL;
return new IntroduceVariableSettings() {