diff --git a/build/conf/mac/Contents/Info.plist b/build/conf/mac/Contents/Info.plist
index dda036b27022..bcb30bc7b44f 100644
--- a/build/conf/mac/Contents/Info.plist
+++ b/build/conf/mac/Contents/Info.plist
@@ -39,6 +39,13 @@
@@version@@
CFBundleVersion
@@build@@
+ LSArchitecturePriority
+
+ i386
+ x86_64
+ ppc
+
+
Java
ClassPath
@@ -47,20 +54,6 @@
JVMVersion
@@jdk_req@@
- JVMArchs
-
- i386
- x86_64
- ppc
-
-
- LSArchitecturePriority
-
- i386
- x86_64
- ppc
-
-
MainClass
com.intellij.idea.Main
Properties
diff --git a/java/execution/impl/src/com/intellij/execution/util/JavaParametersUtil.java b/java/execution/impl/src/com/intellij/execution/util/JavaParametersUtil.java
index 87461cf49d86..32139d5cb299 100644
--- a/java/execution/impl/src/com/intellij/execution/util/JavaParametersUtil.java
+++ b/java/execution/impl/src/com/intellij/execution/util/JavaParametersUtil.java
@@ -88,6 +88,10 @@ public class JavaParametersUtil {
if (module == null) {
throw CantRunException.noModuleConfigured(runConfigurationModule.getModuleName());
}
+ configureModule(module, parameters, classPathType, jreHome);
+ }
+
+ public static void configureModule(Module module, JavaParameters parameters, int classPathType, String jreHome) throws CantRunException {
parameters.configureByModule(module, classPathType, createModuleJdk(module, jreHome));
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java
index 7e97de0188ce..1cb7537a2901 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java
@@ -212,6 +212,17 @@ public class JavaMethodCallElement extends LookupItem implements Type
return builder.append(">").toString();
}
+ @Override
+ public LookupItem forceQualify() {
+ if (myContainingClass != null) {
+ String className = myContainingClass.getName();
+ if (className != null) {
+ addLookupStrings(className + "." + myMethod.getName());
+ }
+ }
+ return super.forceQualify();
+ }
+
@Override
public void renderElement(LookupElementPresentation presentation) {
final String className = myContainingClass == null ? "???" : myContainingClass.getName();
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix-out.java
new file mode 100644
index 000000000000..197b8d11a2b1
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix-out.java
@@ -0,0 +1,7 @@
+import java.util.Collections;
+
+class Foo {
+ java.util.List foo() {
+ return Collections.emptyList();
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix.java
new file mode 100644
index 000000000000..c77ae8fdb860
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix.java
@@ -0,0 +1,5 @@
+class Foo {
+ java.util.List foo() {
+ return Collect;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
index d38494c77178..61086af10243 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
@@ -884,25 +884,17 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
assertEquals(4, myItems.length);
}
- public void testInsertTypeParametersOnImporting() throws Throwable {
- doTest();
- }
+ public void testInsertTypeParametersOnImporting() throws Throwable { doTest(); }
- public void testEmptyListInReturn() throws Throwable {
- doItemTest();
- }
+ public void testEmptyListInReturn() throws Throwable { doItemTest(); }
- public void testEmptyListInReturn2() throws Throwable {
- doTest();
- }
+ public void testEmptyListInReturn2() throws Throwable { doTest(); }
- public void testEmptyListInReturnTernary() throws Throwable {
- doItemTest();
- }
+ public void testEmptyListInReturnTernary() throws Throwable { doItemTest(); }
- public void testEmptyListBeforeSemicolon() throws Throwable {
- doItemTest();
- }
+ public void testEmptyListBeforeSemicolon() throws Throwable { doItemTest(); }
+
+ public void testEmptyListWithCollectionsPrefix() throws Throwable { doItemTest(); }
public void testStaticallyImportedMagicMethod() throws Throwable {
configureByTestName();
diff --git a/lib/winp-1.14.jar b/lib/winp-1.14.jar
new file mode 100644
index 000000000000..240382c7a488
Binary files /dev/null and b/lib/winp-1.14.jar differ
diff --git a/license/winp_license.txt b/license/winp_license.txt
new file mode 100644
index 000000000000..e9c74d0582e4
--- /dev/null
+++ b/license/winp_license.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/platform/lang-api/src/com/intellij/profile/DefaultProjectProfileManager.java b/platform/lang-api/src/com/intellij/profile/DefaultProjectProfileManager.java
index b6e26fda7987..b45f8ccea686 100644
--- a/platform/lang-api/src/com/intellij/profile/DefaultProjectProfileManager.java
+++ b/platform/lang-api/src/com/intellij/profile/DefaultProjectProfileManager.java
@@ -50,6 +50,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
protected final Project myProject;
public String PROJECT_PROFILE;
+ public boolean USE_PROJECT_PROFILE = true;
private final ApplicationProfileManager myApplicationProfileManager;
@@ -178,6 +179,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
public void setProjectProfile(final String projectProfile) {
final String profileName = PROJECT_PROFILE;
PROJECT_PROFILE = projectProfile;
+ USE_PROJECT_PROFILE = projectProfile != null;
for (ProfileChangeAdapter adapter : myProfilesListener) {
adapter.profileActivated(profileName != null ? getProfile(profileName) : null, projectProfile != null ? getProfile(projectProfile) : null);
}
@@ -185,6 +187,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
@NotNull
public Profile getProjectProfileImpl(){
+ if (!USE_PROJECT_PROFILE) return myApplicationProfileManager.getRootProfile();
if (PROJECT_PROFILE == null || myProfiles.isEmpty()){
setProjectProfile(PROJECT_DEFAULT_PROFILE_NAME);
final Profile projectProfile = myApplicationProfileManager.createProfile();
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
index 5fdad4454373..29cbf4159452 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
@@ -490,6 +490,8 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
// the insert handler may have started a live template with completion
if (CompletionService.getCompletionService().getCurrentCompletion() == null) {
indicator.liveAfterDeath(null);
+ } else {
+ LOG.assertTrue(indicator.isZombie(), indicator);
}
}
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
index c26d7ec94574..e88451ece076 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
@@ -289,7 +289,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
if (code == KeyEvent.VK_CONTROL || code == KeyEvent.VK_META || code == KeyEvent.VK_ALT || code == KeyEvent.VK_SHIFT) {
myState.modifiersChanged();
if (myState.isWaitingAfterAutoInsertion()) {
- unregisterItself();
+ unregisterItself(true);
}
contentComponent.removeKeyListener(this);
}
@@ -297,6 +297,10 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
});
}
+ boolean isZombie() {
+ return myState.isZombie();
+ }
+
private void setMergeCommand() {
CommandProcessor.getInstance().setCurrentCommandGroupId(getCompletionCommandName());
}
@@ -330,23 +334,23 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
final HintListener hintListener = new HintListener() {
public void hintHidden(final EventObject event) {
- unregisterItself();
+ unregisterItself(true);
}
};
final DocumentAdapter documentListener = new DocumentAdapter() {
@Override
public void beforeDocumentChange(DocumentEvent e) {
- unregisterItself();
+ unregisterItself(true);
}
};
final SelectionListener selectionListener = new SelectionListener() {
public void selectionChanged(SelectionEvent e) {
- unregisterItself();
+ unregisterItself(true);
}
};
final CaretListener caretListener = new CaretListener() {
public void caretPositionChanged(CaretEvent e) {
- unregisterItself();
+ unregisterItself(true);
}
};
@@ -475,7 +479,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
ApplicationManager.getApplication().assertIsDispatchThread();
Disposer.dispose(myQueue);
- unregisterItself();
+ unregisterItself(false);
}
@TestOnly
@@ -486,8 +490,8 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
}
}
- private void unregisterItself() {
- myState.handleDeath();
+ private void unregisterItself(boolean afterDeath) {
+ myState.handleDeath(afterDeath);
CompletionProgressIndicator currentCompletion = CompletionServiceImpl.getCompletionService().getCurrentCompletion();
assert currentCompletion == this : currentCompletion + "!=" + this;
CompletionServiceImpl.getCompletionService().setCurrentCompletion(null);
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionState.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionState.java
index 892bf983363e..979b3c76f21c 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionState.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionState.java
@@ -91,7 +91,7 @@ public class CompletionState {
}
public boolean isWaitingAfterAutoInsertion() {
- return myRestorePrefix != null;
+ return myRestorePrefix != null && isZombie();
}
public void setRestorePrefix(Runnable restorePrefix) {
@@ -127,10 +127,12 @@ public class CompletionState {
}
}
- public void handleDeath() {
+ public void handleDeath(boolean afterDeath) {
ApplicationManager.getApplication().assertIsDispatchThread();
+ boolean zombie = isZombie();
+ LOG.assertTrue(afterDeath == zombie, this);
assertDisposed();
- if (myZombieCleanup != null) {
+ if (zombie) {
myZombieCleanup.run();
}
myZombieCleanup = null;
@@ -138,6 +140,10 @@ public class CompletionState {
setRestorePrefix(null);
}
+ public boolean isZombie() {
+ return myZombieCleanup != null;
+ }
+
int incCount() {
return ++myCount;
}
diff --git a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java
index 208a3efcb376..52a483d61463 100644
--- a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java
+++ b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java
@@ -84,7 +84,7 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
Map myMinimizedButtonsPlaceholder = new HashMap();
Map myCommonActionsPlaceholder = new HashMap();
- Map> myContextActions = new HashMap>();
+ Map myContextActions = new HashMap();
boolean myUiLastStateWasRestored;
@@ -447,7 +447,8 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
groupToBuild = group;
}
- if (!contents.equals(myContextActions.get(entry.getKey()))) {
+ final AnAction[] actions = groupToBuild.getChildren(null);
+ if (!Arrays.equals(actions, myContextActions.get(entry.getKey()))) {
ActionToolbar tb = myActionManager.createActionToolbar(myActionsPlace, groupToBuild, true);
tb.setTargetComponent(contextComponent);
eachPlaceholder.setContent(tb.getComponent());
@@ -457,7 +458,7 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
hasToolbarContent = true;
}
- myContextActions.put(entry.getKey(), contents);
+ myContextActions.put(entry.getKey(), actions);
}
return hasToolbarContent;
@@ -486,7 +487,7 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
hasToolbarContent |= updateTabUI(each);
}
- myTabs.getPresentation().setHideTabs(!hasToolbarContent);
+ myTabs.getPresentation().setHideTabs(!hasToolbarContent && tabs.size() <= 1);
myTabs.updateTabActions(validateNow);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteProcessor.java b/platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteProcessor.java
index fd6fc4868897..f811f109b2a3 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteProcessor.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteProcessor.java
@@ -93,6 +93,12 @@ public class SafeDeleteProcessor extends BaseRefactoringProcessor {
}
}
+ if (ancestor instanceof PsiFile) {
+ for (PsiFile file : ((PsiFile)ancestor).getViewProvider().getAllFiles()) {
+ if (PsiTreeUtil.isAncestor(file, place, false)) return true;
+ }
+ }
+
return PsiTreeUtil.isAncestor(ancestor, place, false);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
index 3df42df8e973..480b3a639da5 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
@@ -143,9 +143,20 @@ public class FSRecords implements Forceable {
return myFreeRecords.remove(myFreeRecords.size() - 1);
}
- private static void createBrokenMarkerFile() {
+ private static void createBrokenMarkerFile(Throwable reason) {
File brokenMarker = getCorruptionMarkerFile();
try {
+
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
+ final PrintStream stream = new PrintStream(out);
+ new Exception().printStackTrace(stream);
+ if (reason != null) {
+ stream.print("\nReason:\n");
+ reason.printStackTrace(stream);
+ }
+ stream.close();
+ LOG.info("Creating VFS corruption marker; Trace=\n" + out.toString());
+
final FileWriter writer = new FileWriter(brokenMarker);
writer.write("These files are corrupted and must be rebuilt from the scratch on next startup");
writer.close();
@@ -429,7 +440,7 @@ public class FSRecords implements Forceable {
private static RuntimeException handleError(final Throwable e) {
if (!myCorrupted) {
- createBrokenMarkerFile();
+ createBrokenMarkerFile(e);
myCorrupted = true;
force();
}
@@ -1193,7 +1204,7 @@ public class FSRecords implements Forceable {
}
public static void invalidateCaches() {
- DbConnection.createBrokenMarkerFile();
+ DbConnection.createBrokenMarkerFile(null);
}
public static void checkSanity() {
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/EncodingPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/EncodingPanel.java
index 053397f5e6a2..44214add0686 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/EncodingPanel.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/EncodingPanel.java
@@ -59,16 +59,10 @@ public class EncodingPanel extends EditorBasedWidget implements StatusBarWidget.
@Override
protected void paintComponent(@NotNull final Graphics g) {
super.paintComponent(g);
- if (actionEnabled) {
- setForeground(UIUtil.getActiveTextColor());
- if (getText() != null) {
- final Rectangle r = getBounds();
- final Insets insets = getInsets();
- ARROWS_ICON.paintIcon(this, g, r.width - insets.right - ARROWS_ICON.getIconWidth() - 2, r.height / 2 - ARROWS_ICON.getIconHeight() / 2);
- }
- }
- else {
- setForeground(UIUtil.getInactiveTextColor());
+ if (actionEnabled && getText() != null) {
+ final Rectangle r = getBounds();
+ final Insets insets = getInsets();
+ ARROWS_ICON.paintIcon(this, g, r.width - insets.right - ARROWS_ICON.getIconWidth() - 2, r.height / 2 - ARROWS_ICON.getIconHeight() / 2);
}
}
};
@@ -87,7 +81,6 @@ public class EncodingPanel extends EditorBasedWidget implements StatusBarWidget.
update();
}
-
@Override
public void fileOpened(FileEditorManager source, VirtualFile file) {
update();
@@ -179,6 +172,20 @@ public class EncodingPanel extends EditorBasedWidget implements StatusBarWidget.
}
myComponent.setToolTipText(toolTip);
myComponent.setText(text);
+
+ UIUtil.invokeLaterIfNeeded(new Runnable() {
+ @Override
+ public void run() {
+ if (actionEnabled) {
+ myComponent.setForeground(UIUtil.getActiveTextColor());
+ }
+ else {
+ myComponent.setForeground(UIUtil.getInactiveTextColor());
+ }
+ }
+ });
+
+
myStatusBar.updateWidget(ID());
}
diff --git a/platform/platform-resources-en/src/messages/ExecutionBundle.properties b/platform/platform-resources-en/src/messages/ExecutionBundle.properties
index 261f1cfcc40d..7537fbd31bd7 100644
--- a/platform/platform-resources-en/src/messages/ExecutionBundle.properties
+++ b/platform/platform-resources-en/src/messages/ExecutionBundle.properties
@@ -75,7 +75,7 @@ copy.configuration.action.name=Copy Configuration
junit.configuration.display.name=JUnit
junit.configuration.description=JUnit test configuration
no.junit.error.message=No junit.jar
-no.junit.in.scope.error.message=No junit.jar: {0}
+no.junit.in.scope.error.message=No junit.jar in {0}
junit.not.found.in.module.error.message=JUnit not found in module ''{0}''
cannot.browse.test.inheritors.dialog.title=Can't Browse TestCase Inheritors
seaching.test.progress.title=Searching For Tests...
diff --git a/platform/platform-resources/src/idea/LangActions.xml b/platform/platform-resources/src/idea/LangActions.xml
index a28968da7236..011c1ebe4d55 100644
--- a/platform/platform-resources/src/idea/LangActions.xml
+++ b/platform/platform-resources/src/idea/LangActions.xml
@@ -671,6 +671,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+