diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java index 0f813d0bf167..e570b642b2bd 100644 --- a/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java +++ b/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java @@ -25,12 +25,14 @@ import com.intellij.debugger.impl.DebuggerUtilsEx; import com.intellij.debugger.ui.DebuggerExpressionTextField; import com.intellij.debugger.ui.JavaDebuggerSupport; import com.intellij.debugger.ui.tree.render.*; +import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.editor.Document; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.UnnamedConfigurable; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.Pair; import com.intellij.psi.*; import com.intellij.psi.search.GlobalSearchScope; @@ -141,10 +143,17 @@ public class CompoundRendererConfigurable implements UnnamedConfigurable { } } }, myProject); - myClassNameField.getEditorTextField().addFocusListener(new FocusAdapter() { + final EditorTextField textField = myClassNameField.getEditorTextField(); + final FocusAdapter updateContextListener = new FocusAdapter() { public void focusLost(FocusEvent e) { - final String qName = myClassNameField.getText(); - updateContext(qName); + updateContext(myClassNameField.getText()); + } + }; + textField.addFocusListener(updateContextListener); + Disposer.register(myClassNameField, new Disposable() { + @Override + public void dispose() { + textField.removeFocusListener(updateContextListener); } }); @@ -388,10 +397,12 @@ public class CompoundRendererConfigurable implements UnnamedConfigurable { myChildrenEditor.dispose(); myChildrenExpandedEditor.dispose(); myListChildrenEditor.dispose(); + Disposer.dispose(myClassNameField); myLabelEditor = null; myChildrenEditor = null; myChildrenExpandedEditor = null; myListChildrenEditor = null; + myClassNameField = null; myProject = null; } diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java index 4afaad08b5ba..0b83da74e9f5 100644 --- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java +++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java @@ -154,6 +154,11 @@ public abstract class AbstractProjectWizard extends AbstractWizard findReferencesToHighlight(@NotNull final PsiElement target, @NotNull final SearchScope searchScope) { if (target instanceof PsiMethod) { diff --git a/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java b/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java index 2050b01ccbb2..25751535842a 100644 --- a/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java +++ b/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java @@ -58,7 +58,6 @@ import java.util.List; */ @SuppressWarnings("unchecked") public abstract class ProjectWizardTestCase extends PlatformTestCase { - protected static final String DEFAULT_SDK = "default"; protected final List mySdks = new ArrayList(); protected T myWizard; @@ -133,6 +132,7 @@ public abstract class ProjectWizardTestCase ext throw new RuntimeException(currentStep + " is not validated"); } } + myWizard.doFinishAction(); } protected void createWizard(Project project) throws IOException { diff --git a/platform/bootstrap/src/com/intellij/idea/Main.java b/platform/bootstrap/src/com/intellij/idea/Main.java index 7c328536d678..ce8a2d0f14e9 100644 --- a/platform/bootstrap/src/com/intellij/idea/Main.java +++ b/platform/bootstrap/src/com/intellij/idea/Main.java @@ -29,6 +29,7 @@ import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Locale; @SuppressWarnings({"UseOfSystemOutOrSystemErr", "MethodNamesDifferingOnlyByCase"}) public class Main { @@ -122,7 +123,7 @@ public class Main { private static void installPatch() throws IOException { String platform = System.getProperty(PLATFORM_PREFIX_PROPERTY, "idea"); - String patchFileName = ("jetbrains.patch.jar." + platform).toLowerCase(); + String patchFileName = ("jetbrains.patch.jar." + platform).toLowerCase(Locale.US); String tempDir = System.getProperty("java.io.tmpdir"); // always delete previous patch copy @@ -148,6 +149,7 @@ public class Main { args.add(Restarter.createTempExecutable(launcher).getPath()); } + //noinspection SpellCheckingInspection Collections.addAll(args, System.getProperty("java.home") + "/bin/java", "-Xmx500m", diff --git a/platform/core-impl/src/com/intellij/openapi/progress/util/TooManyUsagesStatus.java b/platform/core-impl/src/com/intellij/openapi/progress/util/TooManyUsagesStatus.java index 74d7bf36b911..f44d497edefa 100644 --- a/platform/core-impl/src/com/intellij/openapi/progress/util/TooManyUsagesStatus.java +++ b/platform/core-impl/src/com/intellij/openapi/progress/util/TooManyUsagesStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -27,17 +27,14 @@ import java.util.concurrent.atomic.AtomicReference; public class TooManyUsagesStatus { private static final Key KEY = Key.create("TooManyUsagesStatus"); - private static final Null NULL = new Null(); + private static final NullStatus NULL_STATUS = new NullStatus(); @NotNull public static TooManyUsagesStatus getFrom(@Nullable ProgressIndicator indicator) { - TooManyUsagesStatus data = null; - if (indicator instanceof UserDataHolder) { - data = ((UserDataHolder)indicator).getUserData(KEY); - } - if (data == null) data = NULL; - return data; + TooManyUsagesStatus data = indicator instanceof UserDataHolder ? ((UserDataHolder)indicator).getUserData(KEY) : null; + return data == null ? NULL_STATUS : data; } + public static TooManyUsagesStatus createFor(@NotNull ProgressIndicator indicator) { TooManyUsagesStatus data = null; if (indicator instanceof UserDataHolder) { @@ -76,7 +73,7 @@ public class TooManyUsagesStatus { } } - private static class Null extends TooManyUsagesStatus { + private static class NullStatus extends TooManyUsagesStatus { @Override public boolean switchTooManyUsagesStatus() { return false; diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/AbstractFindUsagesDialog.java b/platform/lang-impl/src/com/intellij/find/findUsages/AbstractFindUsagesDialog.java index d1bae2c48f57..ee76d0ee4cc2 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/AbstractFindUsagesDialog.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/AbstractFindUsagesDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -143,6 +143,7 @@ public abstract class AbstractFindUsagesDialog extends DialogWrapper { return panel; } + @NotNull public final FindUsagesOptions calcFindUsagesOptions() { calcFindUsagesOptions(myFindUsagesOptions); return myFindUsagesOptions; diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java index c98f179aaa82..889855d66c79 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java @@ -47,6 +47,7 @@ import java.util.Collections; */ public abstract class FindUsagesHandler { // return this handler if you want to cancel the search + @NotNull public static final FindUsagesHandler NULL_HANDLER = new FindUsagesHandler(PsiUtilCore.NULL_PSI_ELEMENT){}; private final PsiElement myPsiElement; @@ -204,6 +205,7 @@ public abstract class FindUsagesHandler { return false; } + @NotNull public Collection findReferencesToHighlight(@NotNull PsiElement target, @NotNull SearchScope searchScope) { return ReferencesSearch.search(target, searchScope, false).findAll(); } diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/PsiElement2UsageTargetAdapter.java b/platform/lang-impl/src/com/intellij/find/findUsages/PsiElement2UsageTargetAdapter.java index e5119f26d088..355224f4a9b5 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/PsiElement2UsageTargetAdapter.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/PsiElement2UsageTargetAdapter.java @@ -116,6 +116,7 @@ public class PsiElement2UsageTargetAdapter return getElement(); } + @Override public String toString() { return getPresentableText(); } @@ -209,7 +210,7 @@ public class PsiElement2UsageTargetAdapter @Override public String getLongDescriptiveName() { SearchScope searchScope = myOptions.searchScope; - String scopeString = searchScope == null ? null : searchScope.getDisplayName(); + String scopeString = searchScope.getDisplayName(); PsiElement psiElement = getElement(); return psiElement == null ? UsageViewBundle.message("node.invalid") : diff --git a/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java b/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java index 432fcb975812..94b25a1b3c94 100644 --- a/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java +++ b/platform/platform-impl/src/com/intellij/idea/IdeaApplication.java @@ -218,7 +218,13 @@ public class IdeaApplication { @Nullable private SplashScreen getSplashScreen() { - return SplashScreen.getSplashScreen(); + try { + return SplashScreen.getSplashScreen(); + } + catch (Throwable t) { + LOG.warn(t); + return null; + } } @Override diff --git a/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java b/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java index 30ddb76d1f5f..5b06c79a3ad2 100644 --- a/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java +++ b/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -55,10 +55,12 @@ public class BackgroundableProcessIndicator extends ProgressWindow { if (myDumbModeAction == DumbModeAction.CANCEL) { task.getProject().getMessageBus().connect(this).subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() { + @Override public void enteredDumbMode() { cancel(); } + @Override public void exitDumbMode() { } }); @@ -69,6 +71,7 @@ public class BackgroundableProcessIndicator extends ProgressWindow { super(info.isCancellable(), true, project, info.getCancelText()); if (project != null) { final ProjectManagerAdapter myListener = new ProjectManagerAdapter() { + @Override public void projectClosing(Project closingProject) { if (isRunning()) { cancel(); @@ -107,23 +110,28 @@ public class BackgroundableProcessIndicator extends ProgressWindow { @Nls final String cancelButtonText, @Nls final String backgroundStopTooltip, final boolean cancellable) { this(project, new TaskInfo() { + @Override public String getProcessId() { return ""; } + @Override @NotNull public String getTitle() { return progressTitle; } + @Override public String getCancelText() { return cancelButtonText; } + @Override public String getCancelTooltipText() { return backgroundStopTooltip; } + @Override public boolean isCancellable() { return cancellable; } @@ -134,6 +142,7 @@ public class BackgroundableProcessIndicator extends ProgressWindow { return myDumbModeAction; } + @Override protected void showDialog() { if (myDisposed) return; @@ -144,6 +153,7 @@ public class BackgroundableProcessIndicator extends ProgressWindow { super.showDialog(); } + @Override public void background() { if (myDisposed) return; @@ -158,6 +168,7 @@ public class BackgroundableProcessIndicator extends ProgressWindow { } } + @Override public void dispose() { super.dispose(); myDisposed = true; diff --git a/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/ServerRuntimeInstance.java b/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/ServerRuntimeInstance.java index b057fb30a7fa..b43598945b40 100644 --- a/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/ServerRuntimeInstance.java +++ b/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/ServerRuntimeInstance.java @@ -15,6 +15,11 @@ public abstract class ServerRuntimeInstance { public abstract void computeDeployments(@NotNull ComputeDeploymentsCallback callback); + @NotNull + public String getDeploymentName(@NotNull DeploymentSource source, D configuration) { + return getDeploymentName(source); + } + @NotNull public String getDeploymentName(@NotNull DeploymentSource source) { return source.getPresentableName(); diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ServerConnectionImpl.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ServerConnectionImpl.java index fe43f2aa4f4d..da16b9e72609 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ServerConnectionImpl.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ServerConnectionImpl.java @@ -110,7 +110,7 @@ public class ServerConnectionImpl implements @Override public void connected(@NotNull ServerRuntimeInstance instance) { DeploymentSource source = task.getSource(); - String deploymentName = instance.getDeploymentName(source); + String deploymentName = instance.getDeploymentName(source, task.getConfiguration()); DeploymentImpl deployment; synchronized (myLocalDeployments) { deployment = new DeploymentImpl(deploymentName, DeploymentStatus.DEPLOYING, null, null, task); diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java index 0e7bae22d452..055414932b33 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java @@ -174,7 +174,7 @@ public class UsageViewManagerImpl extends UsageViewManager { final SearchForUsagesRunnable runnable = new SearchForUsagesRunnable(myProject, usageView, presentation, searchFor, searcherFactory, processPresentation, listener); final Factory progressIndicatorFactory = processPresentation.getProgressIndicatorFactory(); - final ProgressIndicator progressIndicator = progressIndicatorFactory != null ? progressIndicatorFactory.create() : null; + final ProgressIndicator progressIndicator = progressIndicatorFactory == null ? null : progressIndicatorFactory.create(); final AtomicBoolean findUsagesStartedShown = new AtomicBoolean(); ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java index 15fbbe5a07c0..c60e46c63ced 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java @@ -25,6 +25,7 @@ import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.changes.ChangeList; import com.intellij.openapi.vcs.changes.ContentRevision; +import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; import com.intellij.openapi.vcs.checkin.CheckinEnvironment; import com.intellij.openapi.vcs.ui.RefreshableOnComponent; import com.intellij.openapi.vfs.VirtualFile; @@ -109,6 +110,11 @@ public class HgCheckinEnvironment implements CheckinEnvironment { //abort return exceptions; } + //firstly selected changes marked dirty in CommitHelper -> postRefresh, so we need to mark others + VcsDirtyScopeManager dirtyManager = VcsDirtyScopeManager.getInstance(myProject); + for (HgFile hgFile : changedFilesNotInCommit) { + dirtyManager.fileDirty(hgFile.toFilePath()); + } } // else : all was included, or it was OK to commit everything, // so no need to set the files on the command, because then mercurial will complain diff --git a/python/src/com/jetbrains/python/findUsages/PyModuleFindUsagesHandler.java b/python/src/com/jetbrains/python/findUsages/PyModuleFindUsagesHandler.java index 6588d2d389a6..fd0eef003d6f 100644 --- a/python/src/com/jetbrains/python/findUsages/PyModuleFindUsagesHandler.java +++ b/python/src/com/jetbrains/python/findUsages/PyModuleFindUsagesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -72,6 +72,7 @@ public class PyModuleFindUsagesHandler extends FindUsagesHandler { }; } + @NotNull @Override public Collection findReferencesToHighlight(@NotNull PsiElement target, @NotNull SearchScope searchScope) { if (target instanceof PyImportedModule) {