introduce variable: create finals when necessary only

This commit is contained in:
anna
2011-06-06 20:41:08 +04:00
parent d2a3db0c64
commit 19d8c228ea
@@ -824,7 +824,7 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase impleme
final String variableName = suggestedName.names[0];
final boolean replaceAll =
replaceChoice == OccurrencesChooser.ReplaceChoice.ALL || replaceChoice == OccurrencesChooser.ReplaceChoice.NO_WRITE;
final boolean declareFinal = replaceAll && (declareFinalIfAll || !anyAssignmentLHS) || createFinals(project);
final boolean declareFinal = replaceAll && declareFinalIfAll || !anyAssignmentLHS && createFinals(project);
final boolean replaceWrite = anyAssignmentLHS && replaceChoice == OccurrencesChooser.ReplaceChoice.ALL;
return new IntroduceVariableSettings() {
@Override