diff --git a/bin/linux/fsnotifier b/bin/linux/fsnotifier index 436cfc3d68b8..df7985a5bfc2 100755 Binary files a/bin/linux/fsnotifier and b/bin/linux/fsnotifier differ diff --git a/bin/linux/fsnotifier64 b/bin/linux/fsnotifier64 index d7c47273bd3d..9f0b3a46d2f2 100755 Binary files a/bin/linux/fsnotifier64 and b/bin/linux/fsnotifier64 differ diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/InspectionProfileTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/InspectionProfileTest.java index f182751543ee..8467309ef28d 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/InspectionProfileTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/InspectionProfileTest.java @@ -263,6 +263,7 @@ public class InspectionProfileTest extends LightIdeaTestCase { else { profile.enableTool(id); } + assertEquals(0, countInitializedTools(profile)); profile.writeExternal(new Element("profile")); List initializedTools = getInitializedTools(profile); if (initializedTools.size() != 1) { diff --git a/native/fsNotifier/linux/main.c b/native/fsNotifier/linux/main.c index 25c04350d1bd..87fcf26139b9 100644 --- a/native/fsNotifier/linux/main.c +++ b/native/fsNotifier/linux/main.c @@ -104,7 +104,6 @@ int main(int argc, char** argv) { } setvbuf(stdin, NULL, _IONBF, 0); - setvbuf(stdout, NULL, _IONBF, 0); roots = array_create(20); if (init_inotify() && roots != NULL) { @@ -120,7 +119,7 @@ int main(int argc, char** argv) { unregister_roots(); } else { - printf("GIVEUP\n"); + output("GIVEUP\n"); } close_inotify(); array_delete(roots); @@ -430,7 +429,7 @@ static void report_event(char* event, char* path) { userlog(LOG_DEBUG, "%s: %s", event, path); int len = strlen(path); - for (char* p = path; *p != '\0'; p++){ + for (char* p = path; *p != '\0'; p++) { if (*p == '\n') { *p = '\0'; } @@ -440,6 +439,8 @@ static void report_event(char* event, char* path) { fputc('\n', stdout); fwrite(path, len, 1, stdout); fputc('\n', stdout); + + fflush(stdout); } @@ -452,4 +453,6 @@ static void output(const char* format, ...) { va_start(ap, format); vprintf(format, ap); va_end(ap); + + fflush(stdout); } diff --git a/native/fsNotifier/mac/fsnotifier.c b/native/fsNotifier/mac/fsnotifier.c index f7b044074eaa..0f872b88eb8f 100644 --- a/native/fsNotifier/mac/fsnotifier.c +++ b/native/fsNotifier/mac/fsnotifier.c @@ -24,7 +24,7 @@ static void reportEvent(char *event, char *path) { int len = 0; if (path != NULL) { len = strlen(path); - for (char* p = path; *p != '\0'; p++){ + for (char* p = path; *p != '\0'; p++) { if (*p == '\n') { *p = '\0'; } diff --git a/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java b/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java index 70e1757acea5..c275d689aa9a 100644 --- a/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java +++ b/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java @@ -51,7 +51,7 @@ public abstract class ProgressIndicatorProvider { }; } - public static boolean ourNeedToCheckCancel = false; + public static volatile boolean ourNeedToCheckCancel = false; public static void checkCanceled() throws ProcessCanceledException { // smart optimization! There's a thread started in ProgressManagerImpl, that set's this flag up once in 10 milliseconds if (ourNeedToCheckCancel && ourInstance != null) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java index 286bfb6af03c..24cda004f14c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -124,23 +124,22 @@ public class LookupCellRenderer implements ListCellRenderer { myIsSelected = isSelected; final LookupElement item = (LookupElement)value; - final boolean dark = UIUtil.isUnderDarcula(); final Color foreground = getForegroundColor(isSelected); - final Color background = isSelected ? SELECTED_BACKGROUND_COLOR : dark ? BACKGROUND_COLOR_DARK_VARIANT : BACKGROUND_COLOR; + final Color background = isSelected ? SELECTED_BACKGROUND_COLOR : new JBColor(BACKGROUND_COLOR, BACKGROUND_COLOR_DARK_VARIANT); int allowedWidth = list.getWidth() - AFTER_TAIL - AFTER_TYPE - getIconIndent(); final LookupElementPresentation presentation = new RealLookupElementPresentation(isSelected ? getMaxWidth() : allowedWidth, myNormalMetrics, myBoldMetrics, myLookup); if (item.isValid()) { item.renderElement(presentation); } else { - presentation.setItemTextForeground(Color.RED); + presentation.setItemTextForeground(JBColor.RED); presentation.setItemText("Invalid"); } myNameComponent.clear(); myNameComponent.setIcon(augmentIcon(presentation.getIcon(), myEmptyIcon)); myNameComponent.setBackground(background); - allowedWidth -= setItemTextLabel(item, dark ? foreground : isSelected ? SELECTED_FOREGROUND_COLOR : presentation.getItemTextForeground(), isSelected, presentation, allowedWidth); + allowedWidth -= setItemTextLabel(item, new JBColor(isSelected ? SELECTED_FOREGROUND_COLOR : presentation.getItemTextForeground(), foreground), isSelected, presentation, allowedWidth); myTypeLabel.clear(); if (allowedWidth > 0) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java index 2781854470f6..a30b7c44ab24 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,10 +35,15 @@ import com.intellij.openapi.command.undo.DocumentReferenceManager; import com.intellij.openapi.command.undo.UndoManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; +import com.intellij.openapi.editor.colors.EditorColors; +import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.event.DocumentAdapter; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.ex.DocumentEx; -import com.intellij.openapi.editor.markup.*; +import com.intellij.openapi.editor.markup.HighlighterLayer; +import com.intellij.openapi.editor.markup.HighlighterTargetArea; +import com.intellij.openapi.editor.markup.RangeHighlighter; +import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; @@ -59,9 +64,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.util.*; -import java.util.List; public class TemplateState implements Disposable { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.template.impl.TemplateState"); @@ -969,7 +972,8 @@ public class TemplateState implements Disposable { } private RangeHighlighter getSegmentHighlighter(int segmentNumber, boolean isSelected, boolean isEnd) { - TextAttributes attributes = isSelected ? new TextAttributes(null, null, Color.red, EffectType.BOXED, Font.PLAIN) : new TextAttributes(); + final TextAttributes lvAttr = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(EditorColors.LIVE_TEMPLATE_ATTRIBUTES); + TextAttributes attributes = isSelected ? lvAttr : new TextAttributes(); TextAttributes endAttributes = new TextAttributes(); int start = mySegments.getSegmentStart(segmentNumber); diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java b/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java index 6e4ab7a0c8e1..66de8a6a09c2 100644 --- a/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java +++ b/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java @@ -22,6 +22,7 @@ import com.intellij.ide.structureView.impl.StructureViewFactoryImpl; import com.intellij.ide.structureView.impl.StructureViewState; import com.intellij.ide.structureView.impl.common.PsiTreeElementBase; import com.intellij.ide.ui.customization.CustomizationUtil; +import com.intellij.ide.util.FileStructurePopup; import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.ide.util.treeView.AbstractTreeStructure; import com.intellij.ide.util.treeView.NodeDescriptorProvidingKey; @@ -52,6 +53,7 @@ import com.intellij.util.Alarm; import com.intellij.util.ArrayUtil; import com.intellij.util.EditSourceOnDoubleClickHandler; import com.intellij.util.OpenSourceUtil; +import com.intellij.util.containers.Convertor; import com.intellij.util.ui.tree.TreeUtil; import gnu.trove.THashSet; import org.jetbrains.annotations.NonNls; @@ -182,7 +184,17 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre myAutoScrollFromSourceHandler.install(); TreeUtil.installActions(getTree()); - new TreeSpeedSearch(getTree()); + + new TreeSpeedSearch(getTree(), new Convertor() { + public String convert(final TreePath treePath) { + final DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent(); + final Object userObject = node.getUserObject(); + if (userObject != null) { + return FileStructurePopup.getSpeedSearchText(userObject); + } + return null; + } + }); addTreeKeyListener(); addTreeMouseListeners(); @@ -626,7 +638,7 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre return myAbstractTreeBuilder.getTreeStructure(); } - public JTree getTree() { + public Tree getTree() { return myTree; } diff --git a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java index 9d350f9b0c3b..ae15cf5cfc03 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java +++ b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java @@ -29,6 +29,7 @@ import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.ide.util.treeView.NodeRenderer; import com.intellij.ide.util.treeView.smartTree.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.navigation.LocationPresentation; import com.intellij.openapi.Disposable; import com.intellij.openapi.MnemonicHelper; import com.intellij.openapi.actionSystem.*; @@ -771,27 +772,38 @@ public class FileStructurePopup implements Disposable { } @Nullable - private static String getText(final Object node) { - String text = String.valueOf(node); + public static String getSpeedSearchText(final Object userObject) { + String text = String.valueOf(userObject); if (text != null) { - if (node instanceof StructureViewComponent.StructureViewTreeElementWrapper) { - final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)node).getValue(); + if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) { + final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)userObject).getValue(); if (value instanceof PsiTreeElementBase && ((PsiTreeElementBase)value).isSearchInLocationString()) { - final String string = ((PsiTreeElementBase)value).getLocationString(); - if (!StringUtil.isEmpty(string)) { - return text + " (" + string + ")"; + final String locationString = ((PsiTreeElementBase)value).getLocationString(); + if (!StringUtil.isEmpty(locationString)) { + String locationPrefix = null; + String locationSuffix = null; + if (value instanceof LocationPresentation) { + locationPrefix = ((LocationPresentation)value).getLocationPrefix(); + locationSuffix = ((LocationPresentation)value).getLocationSuffix(); + } + + return text + + StringUtil.notNullize(locationPrefix, LocationPresentation.DEFAULT_LOCATION_PREFIX) + + locationString + + StringUtil.notNullize(locationSuffix, LocationPresentation.DEFAULT_LOCATION_SUFFIX); } } } return text; } - if (node instanceof StructureViewComponent.StructureViewTreeElementWrapper) { + if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) { return ApplicationManager.getApplication().runReadAction(new Computable() { @Nullable @Override public String compute() { - final ItemPresentation presentation = ((StructureViewComponent.StructureViewTreeElementWrapper)node).getValue().getPresentation(); + final ItemPresentation presentation = + ((StructureViewComponent.StructureViewTreeElementWrapper)userObject).getValue().getPresentation(); return presentation.getPresentableText(); } }); @@ -819,7 +831,7 @@ public class FileStructurePopup implements Disposable { return true; } - final String text = getText(value); + final String text = getSpeedSearchText(value); if (text == null) return false; if (matches(text)) { @@ -863,7 +875,7 @@ public class FileStructurePopup implements Disposable { final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); final Object userObject = node.getUserObject(); if (userObject instanceof FilteringTreeStructure.FilteringNode) { - return getText(((FilteringTreeStructure.FilteringNode)userObject).getDelegate()); + return getSpeedSearchText(((FilteringTreeStructure.FilteringNode)userObject).getDelegate()); } return ""; } diff --git a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java index 50e651ba9a38..b2bb141e9058 100644 --- a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java +++ b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/GeneralColorsPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,6 +80,7 @@ public class GeneralColorsPage implements ColorSettingsPage, InspectionColorSett new AttributesDescriptor(OptionsBundle.message("options.general.attribute.descriptior.identifier.under.caret.write"), EditorColors.WRITE_IDENTIFIER_UNDER_CARET_ATTRIBUTES), new AttributesDescriptor(OptionsBundle.message("options.general.attribute.descriptor.text.search.result"), EditorColors.TEXT_SEARCH_RESULT_ATTRIBUTES), + new AttributesDescriptor(OptionsBundle.message("options.general.attribute.descriptor.live.template"), EditorColors.LIVE_TEMPLATE_ATTRIBUTES), new AttributesDescriptor(OptionsBundle.message("options.general.attribute.descriptor.template.variable"), TemplateColors.TEMPLATE_VARIABLE_ATTRIBUTES), new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.injected.language.fragment"), EditorColors.INJECTED_LANGUAGE_FRAGMENT), diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java b/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java index 97fb02a71e5c..b278b457c811 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java @@ -181,6 +181,14 @@ public class FormatterUtil { return expectedTypes.contains(prevNode.getElementType()); } + public static boolean hasPrecedingSiblingOfType(@Nullable ASTNode node, IElementType expectedSiblingType, IElementType... skipTypes) { + for (ASTNode prevNode = node == null ? null : node.getTreePrev(); prevNode != null; prevNode = prevNode.getTreePrev()) { + if (isWhitespaceOrEmpty(prevNode) || isOneOf(prevNode, skipTypes)) continue; + if (prevNode.getElementType() == expectedSiblingType) return true; + } + return false; + } + public static boolean isFollowedBy(@Nullable ASTNode node, IElementType expectedType) { return isFollowedBy(node, expectedType, IElementType.EMPTY_ARRAY); } diff --git a/platform/platform-api/src/com/intellij/execution/configurations/ParametersList.java b/platform/platform-api/src/com/intellij/execution/configurations/ParametersList.java index 1c22a7e51613..503d217ba1f7 100644 --- a/platform/platform-api/src/com/intellij/execution/configurations/ParametersList.java +++ b/platform/platform-api/src/com/intellij/execution/configurations/ParametersList.java @@ -47,10 +47,7 @@ public class ParametersList implements Cloneable { } public boolean hasProperty(@NonNls final String name) { - for (@NonNls String parameter : myParameters) { - if (parameter.startsWith("-D" + name + '=')) return true; - } - return false; + return getPropertyValue(name) != null; } @Nullable diff --git a/platform/platform-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java b/platform/platform-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java index 9cd6853425dc..847c6817be31 100644 --- a/platform/platform-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java +++ b/platform/platform-api/src/com/intellij/openapi/application/ApplicationNamesInfo.java @@ -17,6 +17,7 @@ package com.intellij.openapi.application; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.PlatformUtils; import org.jdom.Document; import org.jdom.Element; import org.jetbrains.annotations.NonNls; @@ -94,7 +95,7 @@ public class ApplicationNamesInfo { } public static String getComponentName() { - final String prefix = System.getProperty("idea.platform.prefix"); + final String prefix = System.getProperty(PlatformUtils.PLATFORM_PREFIX_KEY); if (prefix != null) { return prefix + COMPONENT_NAME; } diff --git a/platform/platform-api/src/com/intellij/openapi/editor/colors/EditorColors.java b/platform/platform-api/src/com/intellij/openapi/editor/colors/EditorColors.java index a68b1ab19b0a..fe3242e47b44 100644 --- a/platform/platform-api/src/com/intellij/openapi/editor/colors/EditorColors.java +++ b/platform/platform-api/src/com/intellij/openapi/editor/colors/EditorColors.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ public interface EditorColors { TextAttributesKey REFERENCE_HYPERLINK_COLOR = TextAttributesKey.createTextAttributesKey("CTRL_CLICKABLE", new TextAttributes(JBColor.blue, null, JBColor.blue, EffectType.LINE_UNDERSCORE, 0)); TextAttributesKey SEARCH_RESULT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("SEARCH_RESULT_ATTRIBUTES"); + TextAttributesKey LIVE_TEMPLATE_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("LIVE_TEMPLATE_ATTRIBUTES"); TextAttributesKey WRITE_SEARCH_RESULT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("WRITE_SEARCH_RESULT_ATTRIBUTES"); TextAttributesKey IDENTIFIER_UNDER_CARET_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("IDENTIFIER_UNDER_CARET_ATTRIBUTES"); TextAttributesKey WRITE_IDENTIFIER_UNDER_CARET_ATTRIBUTES = diff --git a/platform/platform-api/src/com/intellij/openapi/progress/ProgressManager.java b/platform/platform-api/src/com/intellij/openapi/progress/ProgressManager.java index 3022e37eb153..92582c864141 100644 --- a/platform/platform-api/src/com/intellij/openapi/progress/ProgressManager.java +++ b/platform/platform-api/src/com/intellij/openapi/progress/ProgressManager.java @@ -60,7 +60,7 @@ public abstract class ProgressManager { public abstract ProgressIndicator getProgressIndicator(); - protected static boolean ourNeedToCheckCancel = false; + protected static volatile boolean ourNeedToCheckCancel = false; public static void checkCanceled() throws ProcessCanceledException { // smart optimization! There's a thread started in ProgressManagerImpl, that set's this flag up once in 10 milliseconds if (ourNeedToCheckCancel) { diff --git a/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java b/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java index 33ba62c1dc6f..3b779a15ce5e 100644 --- a/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java +++ b/platform/platform-api/src/com/intellij/ui/components/panels/ValidatingComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package com.intellij.ui.components.panels; +import com.intellij.ui.JBColor; import com.intellij.util.ui.UIUtil; import javax.swing.*; @@ -74,7 +75,7 @@ public abstract class ValidatingComponent extends NonOpaqu protected JLabel createErrorLabel() { final JLabel label = new JLabel(" "); - label.setForeground(Color.red); + label.setForeground(JBColor.red); label.setFont(ERROR_FONT); return label; } diff --git a/platform/platform-api/src/com/intellij/util/PlatformUtils.java b/platform/platform-api/src/com/intellij/util/PlatformUtils.java index 79b69414162f..ad6840591f15 100644 --- a/platform/platform-api/src/com/intellij/util/PlatformUtils.java +++ b/platform/platform-api/src/com/intellij/util/PlatformUtils.java @@ -23,6 +23,8 @@ import org.jetbrains.annotations.Nullable; * @author Konstantin Bulenkov */ public class PlatformUtils { + public static final String PLATFORM_PREFIX_KEY = "idea.platform.prefix"; + public static final String IDEA_PREFIX = "idea"; public static final String COMMUNITY_PREFIX = "Idea"; public static final String APPCODE_PREFIX = "AppCode"; @@ -40,7 +42,7 @@ public class PlatformUtils { } public static String getPlatformPrefix(String defaultPrefix) { - return System.getProperty("idea.platform.prefix", defaultPrefix); + return System.getProperty(PLATFORM_PREFIX_KEY, defaultPrefix); } public static boolean isIdea() { diff --git a/platform/platform-impl/src/com/intellij/concurrency/JobImpl.java b/platform/platform-impl/src/com/intellij/concurrency/JobImpl.java index 20bb2ba0691b..eb2a165a5d97 100644 --- a/platform/platform-impl/src/com/intellij/concurrency/JobImpl.java +++ b/platform/platform-impl/src/com/intellij/concurrency/JobImpl.java @@ -162,6 +162,7 @@ public class JobImpl implements Job { } catch (CancellationException ignore) { // already cancelled + cancel(); } catch (ExecutionException e) { cancel(); diff --git a/platform/platform-impl/src/com/intellij/ide/actions/NewDummyProjectAction.java b/platform/platform-impl/src/com/intellij/ide/actions/NewDummyProjectAction.java index 65f7862db9a3..e7c65bbaf640 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/NewDummyProjectAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/NewDummyProjectAction.java @@ -21,6 +21,7 @@ import com.intellij.openapi.application.PathManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.ex.ProjectManagerEx; +import com.intellij.util.PlatformUtils; /** * @author yole @@ -35,6 +36,6 @@ public class NewDummyProjectAction extends AnAction implements DumbAware { @Override public void update(final AnActionEvent e) { - e.getPresentation().setVisible("Platform".equals(System.getProperty("idea.platform.prefix"))); + e.getPresentation().setVisible("Platform".equals(System.getProperty(PlatformUtils.PLATFORM_PREFIX_KEY))); } } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/ide/actions/SaveAsDirectoryBasedFormatAction.java b/platform/platform-impl/src/com/intellij/ide/actions/SaveAsDirectoryBasedFormatAction.java index 83f3ba480791..c1fa55bbe05b 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/SaveAsDirectoryBasedFormatAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/SaveAsDirectoryBasedFormatAction.java @@ -33,6 +33,8 @@ import com.intellij.openapi.vfs.VirtualFile; import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; /** * @author spleaner @@ -58,7 +60,8 @@ public class SaveAsDirectoryBasedFormatAction extends AnAction implements DumbAw final StateStorageManager storageManager = projectStore.getStateStorageManager(); - for (String file : storageManager.getStorageFileNames()) { + final Collection storageFileNames = new ArrayList(storageManager.getStorageFileNames()); + for (String file : storageFileNames) { storageManager.clearStateStorage(file); } diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java index 739224d9a157..4d156792a1ec 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java @@ -45,6 +45,7 @@ import com.intellij.openapi.wm.IdeFrame; import com.intellij.openapi.wm.ex.WindowManagerEx; import com.intellij.util.ArrayUtil; import com.intellij.util.Function; +import com.intellij.util.PlatformUtils; import com.intellij.util.graph.CachingSemiGraph; import com.intellij.util.graph.DFSTBuilder; import com.intellij.util.graph.Graph; @@ -231,7 +232,7 @@ public class PluginManager { } final IdeaPluginDescriptor corePluginDescriptor = idToDescriptorMap.get(PluginId.getId(CORE_PLUGIN_ID)); - assert corePluginDescriptor != null : CORE_PLUGIN_ID + " not found; platform prefix is " + System.getProperty("idea.platform.prefix"); + assert corePluginDescriptor != null : CORE_PLUGIN_ID + " not found; platform prefix is " + System.getProperty(PlatformUtils.PLATFORM_PREFIX_KEY); for (IdeaPluginDescriptorImpl descriptor : result) { if (descriptor != corePluginDescriptor) { descriptor.insertDependency(corePluginDescriptor); @@ -631,7 +632,7 @@ public class PluginManager { private static void loadDescriptorsFromClassPath(final List result, @Nullable StartupProgress progress) { try { final Collection urls = getClassLoaderUrls(); - final String platformPrefix = System.getProperty("idea.platform.prefix"); + final String platformPrefix = System.getProperty(PlatformUtils.PLATFORM_PREFIX_KEY); int i = 0; for (URL url : urls) { i++; diff --git a/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java index 2ffa08b1f294..a22d746effd1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java @@ -527,12 +527,6 @@ public class ProgressManagerImpl extends ProgressManager implements Disposable{ ((ProgressManagerImpl)getInstance()).dispose(); } - @TestOnly - public static void setNeedToCheckCancel(boolean needToCheckCancel) { - ourNeedToCheckCancel = needToCheckCancel; - ProgressIndicatorProvider.ourNeedToCheckCancel = true; - } - @TestOnly @SuppressWarnings({"UnusedDeclaration"}) public static String isCanceledThread(Thread thread) { diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java index 444f6ce684bf..d23536467b56 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java @@ -176,9 +176,9 @@ public class FileWatcher { private static boolean isUpToDate(File executable) { long length = SystemInfo.isWindows ? 70216 : SystemInfo.isMac ? 13924 : - SystemInfo.isLinux ? SystemInfo.isAMD64 ? 29296 : 22793 : + SystemInfo.isLinux ? SystemInfo.isAMD64 ? 29308 : 22809 : -1; - return length > 0 && length == executable.length(); + return length < 0 || length == executable.length(); } private void notifyOnFailure(final String cause, @Nullable final NotificationListener listener) { @@ -474,7 +474,8 @@ public class FileWatcher { } } else { - processChange(line.replace('\0', '\n'), myLastOp); + String path = line.replace('\0', '\n'); // unescape + processChange(path, myLastOp); myLastOp = null; } } diff --git a/platform/platform-main/src/com/intellij/idea/MainImpl.java b/platform/platform-main/src/com/intellij/idea/MainImpl.java index 4e86563d7da5..41760d6b2d0d 100644 --- a/platform/platform-main/src/com/intellij/idea/MainImpl.java +++ b/platform/platform-main/src/com/intellij/idea/MainImpl.java @@ -22,6 +22,7 @@ import com.intellij.openapi.application.PathManager; import com.intellij.openapi.application.impl.ApplicationInfoImpl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.ui.AppUIUtil; +import com.intellij.util.PlatformUtils; import com.intellij.util.text.DateFormatUtilRt; import com.intellij.util.ui.UIUtil; @@ -37,9 +38,7 @@ public class MainImpl { * Called from PluginManager via reflection. */ protected static void start(final String[] args) { - if (System.getProperty("idea.platform.prefix") == null) { - System.setProperty("idea.platform.prefix", "Idea"); - } + System.setProperty(PlatformUtils.PLATFORM_PREFIX_KEY, PlatformUtils.getPlatformPrefix(PlatformUtils.COMMUNITY_PREFIX)); StartupUtil.isHeadless = Main.isHeadless(args); if (!StartupUtil.isHeadless) { diff --git a/platform/platform-resources-en/src/messages/OptionsBundle.properties b/platform/platform-resources-en/src/messages/OptionsBundle.properties index c3c4cff26eb3..68a92243bd96 100644 --- a/platform/platform-resources-en/src/messages/OptionsBundle.properties +++ b/platform/platform-resources-en/src/messages/OptionsBundle.properties @@ -229,4 +229,5 @@ color.settings.console.yellow=ANSI Yellow color.settings.console.blue=ANSI Blue color.settings.console.magenta=ANSI Magenta color.settings.console.cyan=ANSI Cyan -color.settings.console.gray=ANSI Gray \ No newline at end of file +color.settings.console.gray=ANSI Gray +options.general.attribute.descriptor.live.template=Live Template \ No newline at end of file diff --git a/platform/platform-resources/src/DefaultColorSchemesManager.xml b/platform/platform-resources/src/DefaultColorSchemesManager.xml index 74713cdd0eb8..d7819c5511e7 100644 --- a/platform/platform-resources/src/DefaultColorSchemesManager.xml +++ b/platform/platform-resources/src/DefaultColorSchemesManager.xml @@ -734,6 +734,14 @@ +