do not insert final if final checkbox is disabled
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 12 May 2011 09:28:53 +0000 (13:28 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 12 May 2011 09:28:53 +0000 (13:28 +0400)
java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableDialog.java

index 52e3d71b2661e4c4e68acb73c2b64a038ff5ef23..07c216f48e1bd35a3a7bc7a2461f7d02ef358d32 100644 (file)
@@ -104,11 +104,7 @@ class IntroduceVariableDialog extends DialogWrapper implements IntroduceVariable
   }
 
   public boolean isDeclareFinal() {
-    if (myCbFinal.isEnabled()) {
-      return myCbFinalState;
-    } else {
-      return true;
-    }
+    return myCbFinal.isEnabled() && myCbFinalState;
   }
 
   public boolean isReplaceLValues() {