util: add the final modifier to myMediatedProcess
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Sat, 8 Oct 2016 10:30:59 +0000 (13:30 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Sat, 8 Oct 2016 10:30:59 +0000 (13:30 +0300)
platform/platform-impl/src/com/intellij/execution/process/KillableColoredProcessHandler.java

index a7b7c0c8dd36e2fadc990b46a413d1d6b6020d52..99ce8de3cff21172c4094d87faef7c2c35e48a09 100644 (file)
@@ -39,10 +39,10 @@ public class KillableColoredProcessHandler extends ColoredProcessHandler impleme
   private static final Key<Boolean> MEDIATOR_KEY = Key.create("KillableColoredProcessHandler.Mediator.Process");
 
   private boolean myShouldKillProcessSoftly = true;
-  private boolean myMediatedProcess = false;
+  private final boolean myMediatedProcess;
 
   public KillableColoredProcessHandler(@NotNull GeneralCommandLine commandLine) throws ExecutionException {
-    super(commandLine);
+    this(commandLine, false);
   }
 
   /**
@@ -58,6 +58,7 @@ public class KillableColoredProcessHandler extends ColoredProcessHandler impleme
    */
   public KillableColoredProcessHandler(@NotNull Process process, /*@NotNull*/ String commandLine) {
     super(process, commandLine);
+    myMediatedProcess = false;
   }
 
   /**
@@ -65,9 +66,11 @@ public class KillableColoredProcessHandler extends ColoredProcessHandler impleme
    */
   public KillableColoredProcessHandler(@NotNull Process process, /*@NotNull*/ String commandLine, @NotNull Charset charset) {
     super(process, commandLine, charset);
+    myMediatedProcess = false;
   }
 
-  private static GeneralCommandLine mediate(GeneralCommandLine commandLine, boolean withMediator) {
+  @NotNull
+  private static GeneralCommandLine mediate(@NotNull GeneralCommandLine commandLine, boolean withMediator) {
     if (withMediator && SystemInfo.isWindows) {
       boolean mediatorInjected = RunnerMediator.injectRunnerCommand(commandLine);
       MEDIATOR_KEY.set(commandLine, mediatorInjected);