From f6d57b026a6caf4f00c957f2d79e6004b4bf3ee6 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 22 Oct 2012 16:59:12 +0200 Subject: [PATCH] EA-40189 - AIOOBE: IntroduceVariableBase.getSettings --- .../refactoring/introduceVariable/IntroduceVariableBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java index ae2a697b2a3b..82a764b64b55 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java @@ -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() {