NPE related to ColoredOutputTypeRegistry was fixed cidr/96.133 idea/96.134 pycharm/96.135
authorRoman Chernyatchik <roman.chernyatchik@jetbrains.com>
Mon, 26 Apr 2010 17:06:05 +0000 (21:06 +0400)
committerRoman Chernyatchik <roman.chernyatchik@jetbrains.com>
Mon, 26 Apr 2010 18:15:47 +0000 (22:15 +0400)
platform/platform-impl/src/com/intellij/execution/process/ColoredProcessHandler.java
platform/platform-resources/src/META-INF/PlatformExtensions.xml

index 6885b6df0ac4034000fd2d783d565da2ffee1e57..c244ed559f3a40e6aa8d1155a555f523535b1dfb 100644 (file)
@@ -16,8 +16,6 @@
 
 package com.intellij.execution.process;
 
-import com.intellij.execution.process.OSProcessHandler;
-import com.intellij.execution.process.ProcessOutputTypes;
 import com.intellij.openapi.editor.colors.EditorColorsManager;
 import com.intellij.openapi.editor.colors.TextAttributesKey;
 import com.intellij.openapi.editor.markup.TextAttributes;
@@ -81,7 +79,9 @@ public class ColoredProcessHandler extends OSProcessHandler {
       }
       int macroEndPos = text.indexOf('m', macroPos);
       if (macroEndPos < 0) break;
-      myCurrentColor = ColoredOutputTypeRegistry.getInstance().getOutputKey(text.substring(macroPos, macroEndPos+1));
+      final ColoredOutputTypeRegistry registry = ColoredOutputTypeRegistry.getInstance();
+      final String colorAttribute = text.substring(macroPos, macroEndPos + 1);
+      myCurrentColor = registry.getOutputKey(colorAttribute);
       pos = macroEndPos+1;
     }
     if (pos < text.length()) {
index c24a2371dc9b32cc0360aa5fd2b340e1fc832ac6..5605c22705690d0c28d3625ae89537adc701a6cd 100644 (file)
                       serviceImplementation="com.intellij.ide.passwordSafe.impl.PasswordSafeImpl"/>
   <applicationConfigurable implementation="com.intellij.ide.passwordSafe.config.PasswordSafeConfigurable"/>
 
+  <applicationService serviceInterface="com.intellij.execution.process.ColoredOutputTypeRegistry"
+                      serviceImplementation="com.intellij.execution.process.ColoredOutputTypeRegistry"/>
+
   <projectService serviceInterface="com.intellij.openapi.vfs.ReadonlyStatusHandler"
                   serviceImplementation="com.intellij.openapi.vcs.readOnlyHandler.ReadonlyStatusHandlerImpl"/>
   <projectService serviceInterface="com.intellij.openapi.startup.StartupManager"