diff --git a/build/order.txt b/build/order.txt index f93a7f28e863..ff0a75037144 100644 --- a/build/order.txt +++ b/build/order.txt @@ -4148,7 +4148,6 @@ com/intellij/psi/search/scope/packageSet/ParsingException.class:/lib/openapi.jar com/intellij/packageDependencies/DependencyValidationManagerImpl.class:/lib/idea.jar com/intellij/psi/search/scope/packageSet/NamedScope.class:/lib/openapi.jar com/intellij/psi/search/scope/packageSet/NamedScope$UnnamedScope.class:/lib/openapi.jar -ide/sharedScope.png:/lib/icons.jar com/intellij/packageDependencies/DependencyValidationManagerImpl$1.class:/lib/idea.jar com/intellij/ide/startup/impl/StartupManagerImpl$4.class:/lib/idea.jar com/intellij/psi/search/scope/packageSet/PackageSetFactory.class:/lib/openapi.jar diff --git a/java/java-impl/java-impl.iml b/java/java-impl/java-impl.iml index 688a8d303608..6067c7e0a5ee 100644 --- a/java/java-impl/java-impl.iml +++ b/java/java-impl/java-impl.iml @@ -53,6 +53,7 @@ + diff --git a/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java b/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java index ae45a6f04c87..7affcf4c8b04 100644 --- a/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java +++ b/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java @@ -23,6 +23,8 @@ import com.intellij.codeInsight.NullableNotNullManager; import com.intellij.codeInsight.daemon.QuickFixBundle; import com.intellij.codeInsight.daemon.impl.quickfix.LocateLibraryDialog; import com.intellij.codeInsight.daemon.impl.quickfix.OrderEntryFix; +import com.intellij.history.LocalHistory; +import com.intellij.history.LocalHistoryAction; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.application.Result; @@ -207,17 +209,23 @@ public class InferNullityAnnotationsAction extends BaseAnalysisAction { final Runnable applyRunnable = new Runnable() { @Override public void run() { - new WriteCommandAction(project, INFER_NULLITY_ANNOTATIONS) { - @Override - protected void run(Result result) throws Throwable { - if (!inferrer.nothingFoundMessage(project)) { - final SequentialModalProgressTask progressTask = new SequentialModalProgressTask(project, INFER_NULLITY_ANNOTATIONS, false); - progressTask.setMinIterationTime(200); - progressTask.setTask(new AnnotateTask(project, inferrer, progressTask)); - ProgressManager.getInstance().run(progressTask); + final LocalHistoryAction action = LocalHistory.getInstance().startAction(INFER_NULLITY_ANNOTATIONS); + try { + new WriteCommandAction(project, INFER_NULLITY_ANNOTATIONS) { + @Override + protected void run(Result result) throws Throwable { + if (!inferrer.nothingFoundMessage(project)) { + final SequentialModalProgressTask progressTask = new SequentialModalProgressTask(project, INFER_NULLITY_ANNOTATIONS, false); + progressTask.setMinIterationTime(200); + progressTask.setTask(new AnnotateTask(project, inferrer, progressTask)); + ProgressManager.getInstance().run(progressTask); + } } - } - }.execute(); + }.execute(); + } + finally { + action.finish(); + } } }; SwingUtilities.invokeLater(applyRunnable); diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/DocCommentTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/DocCommentTokenizer.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/DocCommentTokenizer.java rename to java/java-impl/src/com/intellij/spellchecker/DocCommentTokenizer.java diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/JavaSpellcheckingStrategy.java b/java/java-impl/src/com/intellij/spellchecker/JavaSpellcheckingStrategy.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/JavaSpellcheckingStrategy.java rename to java/java-impl/src/com/intellij/spellchecker/JavaSpellcheckingStrategy.java diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java rename to java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/MethodNameTokenizerJava.java b/java/java-impl/src/com/intellij/spellchecker/MethodNameTokenizerJava.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/MethodNameTokenizerJava.java rename to java/java-impl/src/com/intellij/spellchecker/MethodNameTokenizerJava.java diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/NamedElementTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/NamedElementTokenizer.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/NamedElementTokenizer.java rename to java/java-impl/src/com/intellij/spellchecker/NamedElementTokenizer.java diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/PsiIdentifierTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/PsiIdentifierTokenizer.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/PsiIdentifierTokenizer.java rename to java/java-impl/src/com/intellij/spellchecker/PsiIdentifierTokenizer.java diff --git a/plugins/java-i18n/src/com/intellij/spellchecker/PsiTypeTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/PsiTypeTokenizer.java similarity index 100% rename from plugins/java-i18n/src/com/intellij/spellchecker/PsiTypeTokenizer.java rename to java/java-impl/src/com/intellij/spellchecker/PsiTypeTokenizer.java diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/ImplementationsViewTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/ImplementationsViewTest.java index 6e3b0ccdff82..ecb14768b153 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/ImplementationsViewTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/ImplementationsViewTest.java @@ -115,6 +115,9 @@ public class ImplementationsViewTest extends LightCodeInsightFixtureTestCase { new ImplementationViewComponent(all.toArray(new PsiElement[all.size()]), 0); try { final String[] visibleFiles = component.getVisibleFiles(); + assertTrue(visibleFiles.length > 0); + assertEquals(visibleFiles[0], "a.java (AFoo)"); + Arrays.sort(visibleFiles); Assert.assertArrayEquals(Arrays.toString(visibleFiles), new String[]{"a.java (AFoo)", "a.java (AFoo1 in AFoo)", "a.java (AFoo2 in AFoo)", "a.java (AFoo3 in AFoo)"}, visibleFiles); } diff --git a/lib/asm-all.jar b/lib/asm-all.jar index c83fcebb709c..0257ef24af13 100644 Binary files a/lib/asm-all.jar and b/lib/asm-all.jar differ diff --git a/lib/src/asm5-src.zip b/lib/src/asm5-src.zip index c76977dbe561..cf71038f68db 100644 Binary files a/lib/src/asm5-src.zip and b/lib/src/asm5-src.zip differ diff --git a/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java b/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java index 5948e948a86b..0cb4eb11da5e 100644 --- a/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java +++ b/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java @@ -25,6 +25,7 @@ import com.intellij.openapi.util.*; import com.intellij.openapi.util.io.FileUtil; import com.intellij.psi.PsiFile; import com.intellij.psi.search.scope.packageSet.*; +import com.intellij.ui.LayeredIcon; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.text.UniqueNameGenerator; import com.intellij.util.ui.UIUtil; @@ -46,6 +47,7 @@ import java.util.*; ) public class DependencyValidationManagerImpl extends DependencyValidationManager { private static final Logger LOG = Logger.getInstance("#com.intellij.packageDependencies.DependencyValidationManagerImpl"); + public static final Icon SHARED_SCOPE_ICON = new LayeredIcon(AllIcons.Ide.LocalScope, AllIcons.Nodes.Shared); private final List myRules = new ArrayList(); private final NamedScopeManager myNamedScopeManager; @@ -194,7 +196,7 @@ public class DependencyValidationManagerImpl extends DependencyValidationManager @Override public Icon getIcon() { - return AllIcons.Ide.SharedScope; + return SHARED_SCOPE_ICON; } @Override diff --git a/platform/icons/src/ide/sharedScope.png b/platform/icons/src/ide/sharedScope.png deleted file mode 100644 index d80399c64021..000000000000 Binary files a/platform/icons/src/ide/sharedScope.png and /dev/null differ diff --git a/platform/icons/src/ide/sharedScope@2x.png b/platform/icons/src/ide/sharedScope@2x.png deleted file mode 100644 index 940dacd3a88d..000000000000 Binary files a/platform/icons/src/ide/sharedScope@2x.png and /dev/null differ diff --git a/platform/icons/src/ide/sharedScope@2x_dark.png b/platform/icons/src/ide/sharedScope@2x_dark.png deleted file mode 100644 index 775601cec359..000000000000 Binary files a/platform/icons/src/ide/sharedScope@2x_dark.png and /dev/null differ diff --git a/platform/icons/src/ide/sharedScope_dark.png b/platform/icons/src/ide/sharedScope_dark.png deleted file mode 100644 index bce25010a6e3..000000000000 Binary files a/platform/icons/src/ide/sharedScope_dark.png and /dev/null differ diff --git a/platform/icons/src/nodes/shared.png b/platform/icons/src/nodes/shared.png new file mode 100644 index 000000000000..b7c6eb8772c4 Binary files /dev/null and b/platform/icons/src/nodes/shared.png differ diff --git a/platform/icons/src/nodes/shared@2x.png b/platform/icons/src/nodes/shared@2x.png new file mode 100644 index 000000000000..1715515eb082 Binary files /dev/null and b/platform/icons/src/nodes/shared@2x.png differ diff --git a/platform/icons/src/nodes/shared@2x_dark.png b/platform/icons/src/nodes/shared@2x_dark.png new file mode 100644 index 000000000000..850a06d1d940 Binary files /dev/null and b/platform/icons/src/nodes/shared@2x_dark.png differ diff --git a/platform/icons/src/nodes/shared_dark.png b/platform/icons/src/nodes/shared_dark.png new file mode 100644 index 000000000000..6702efd84dce Binary files /dev/null and b/platform/icons/src/nodes/shared_dark.png differ diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java index 867e4ac0b065..b83d832f8348 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java @@ -330,15 +330,6 @@ public class ImplementationViewComponent extends JPanel { names.add(((PsiNamedElement)element).getName()); } } - Arrays.sort(elements, new Comparator() { - @Override - public int compare(PsiElement e1, PsiElement e2) { - if (e1 instanceof PsiNamedElement && e2 instanceof PsiNamedElement) { - return Comparing.compare(((PsiNamedElement)e1).getName(), ((PsiNamedElement)e2).getName()); - } - return e1.hashCode() - e2.hashCode(); - } - }); for (PsiElement element : elements) { PsiFile file = getContainingFile(element); if (file == null) continue; diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java index 1220d5db0df6..44ca0a7fb6e7 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java @@ -33,7 +33,6 @@ import com.intellij.openapi.ui.popup.ListPopupStep; import com.intellij.openapi.ui.popup.PopupStep; import com.intellij.openapi.ui.popup.util.BaseListPopupStep; import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Trinity; import com.intellij.openapi.wm.IdeFocusManager; @@ -77,7 +76,7 @@ class RunConfigurable extends BaseConfigurable { private static final Icon ADD_ICON = IconUtil.getAddIcon(); private static final Icon REMOVE_ICON = IconUtil.getRemoveIcon(); - private static final Icon SHARED_ICON = IconLoader.getTransparentIcon(AllIcons.Nodes.Symlink, .6f); + private static final Icon SHARED_ICON = AllIcons.Nodes.Shared; private static final Icon NON_SHARED_ICON = EmptyIcon.ICON_16; @NonNls private static final String DIVIDER_PROPORTION = "dividerProportion"; @NonNls private static final Object DEFAULTS = new Object() { @@ -203,9 +202,7 @@ class RunConfigurable extends BaseConfigurable { } if (shared != null) { Icon icon = getIcon(); - LayeredIcon layeredIcon = new LayeredIcon(2); - layeredIcon.setIcon(icon, 0, 0, 0); - layeredIcon.setIcon(shared ? SHARED_ICON : NON_SHARED_ICON, 1, 8, 0); + LayeredIcon layeredIcon = new LayeredIcon(icon, shared ? SHARED_ICON : NON_SHARED_ICON); setIcon(layeredIcon); setIconTextGap(0); } else { diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java index ee1fc7ba708d..f632ab9523e1 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java @@ -218,7 +218,7 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { }, ", ") + "."; } } - message += " Disabled plugins and plugins which depends on disabled plugins won't be activated after restart."; + message += " Disabled plugins " + (disabled.isEmpty() ? "and plugins which depend on disabled " :"") + "won't be activated after restart."; int result; if (!disabled.isEmpty() && !disabledDependants.isEmpty()) { @@ -237,8 +237,8 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { //noinspection SpellCheckingInspection message += "plugin dependenc" + (disabledDependants.size() > 1 ? "ies" : "y"); } - message += "?"; - result = Messages.showYesNoDialog(message, CommonBundle.getWarningTitle(), Messages.getQuestionIcon()); + message += "?"; + result = Messages.showYesNoDialog(XmlStringUtil.wrapInHtml(message), CommonBundle.getWarningTitle(), Messages.getQuestionIcon()); if (result == Messages.NO) return false; } diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java index f33434def549..20bba47f98f4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerManagerImpl.java @@ -159,7 +159,7 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp @NotNull private VirtualFilePointer create(@Nullable VirtualFile file, @NotNull String url, - @NotNull final Disposable parentDisposable, + @NotNull Disposable parentDisposable, @Nullable VirtualFilePointerListener listener) { String protocol; VirtualFileSystem fileSystem; @@ -171,11 +171,13 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp protocol = null; fileSystem = file.getFileSystem(); } + if (fileSystem == TEMP_FILE_SYSTEM) { // for tests, recreate always VirtualFile found = file == null ? VirtualFileManager.getInstance().findFileByUrl(url) : file; return new IdentityVirtualFilePointer(found, url); } + if (fileSystem != LOCAL_FILE_SYSTEM && fileSystem != JAR_FILE_SYSTEM) { // we are unable to track alien file systems for now VirtualFile found = fileSystem == null ? null : file != null ? file : VirtualFileManager.getInstance().findFileByUrl(url); @@ -190,14 +192,11 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp url = VirtualFileManager.constructUrl(protocol, path); } else { - path = file.getPath(); - // url has come from VirtualFile.getUrl() and is good enough + path = file.getPath(); // url has come from VirtualFile.getUrl() and is good enough } VirtualFilePointerImpl pointer = getOrCreate(parentDisposable, listener, path, Pair.create(file, url)); - DelegatingDisposable.registerDisposable(parentDisposable, pointer); - return pointer; } @@ -310,13 +309,14 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp } } - private final Set myStoredPointers = ContainerUtil.newIdentityTroveSet(); + private final Set myStoredPointers = ContainerUtil.newIdentityTroveSet(); + @TestOnly public void storePointers() { - //assert myStoredPointers.isEmpty() : myStoredPointers; myStoredPointers.clear(); addAllPointers(myStoredPointers); } + @TestOnly public void assertPointersAreDisposed() { List pointers = new ArrayList(); @@ -422,7 +422,7 @@ public class VirtualFilePointerManagerImpl extends VirtualFilePointerManager imp final VFileMoveEvent moveEvent = (VFileMoveEvent)event; VirtualFile eventFile = moveEvent.getFile(); addPointersUnder(moveEvent.getNewParent().getPath() + "/" + eventFile.getName(), toFireEvents); - + List nodes = new ArrayList(); addPointersUnder(eventFile.getPath(), nodes); for (FilePointerPartNode pair : nodes) { diff --git a/platform/platform-resources-en/src/misc/registry.properties b/platform/platform-resources-en/src/misc/registry.properties index 8a058201206f..f4a8a08dec0a 100644 --- a/platform/platform-resources-en/src/misc/registry.properties +++ b/platform/platform-resources-en/src/misc/registry.properties @@ -133,7 +133,7 @@ ide.mac.message.dialogs.as.sheets=true skip.untitled.windows.for.mac.messages=false skip.untitled.windows.for.mac.messages.description=Temporary key to test a fix for MacMessages ide.mac.mountain.lion.notifications.enabled=true -ide.mac.inplaceDialogMnemonicsFix=true +ide.mac.inplaceDialogMnemonicsFix=false ide.mac.fix.dialog.showing=false ide.mac.hide.cursor.when.typing=true ide.mac.show.native.help=true @@ -380,4 +380,4 @@ ide.scratch.enabled=false editor.injected.highlighting.enabled=true editor.injected.highlighting.enabled.description=Disables injected fragments highlighting (requires project reopening) -run.processes.with.pty=false \ No newline at end of file +run.processes.with.pty=false diff --git a/platform/platform-resources/src/idea/Keymap_MacClassic.xml b/platform/platform-resources/src/idea/Keymap_MacClassic.xml index 6fb8ff90cda4..9baf026dd6ca 100644 --- a/platform/platform-resources/src/idea/Keymap_MacClassic.xml +++ b/platform/platform-resources/src/idea/Keymap_MacClassic.xml @@ -4,6 +4,15 @@ + + + + + + + + + diff --git a/platform/platform-resources/src/idea/Keymap_Xcode.xml b/platform/platform-resources/src/idea/Keymap_Xcode.xml index 9943c7236ee2..058f922c843d 100644 --- a/platform/platform-resources/src/idea/Keymap_Xcode.xml +++ b/platform/platform-resources/src/idea/Keymap_Xcode.xml @@ -69,7 +69,7 @@ - + diff --git a/platform/platform-resources/src/idea/PlatformActions.xml b/platform/platform-resources/src/idea/PlatformActions.xml index a87eed04e140..90dd1404a911 100644 --- a/platform/platform-resources/src/idea/PlatformActions.xml +++ b/platform/platform-resources/src/idea/PlatformActions.xml @@ -139,7 +139,7 @@ - + diff --git a/platform/projectModel-api/src/com/intellij/openapi/roots/ModifiableRootModel.java b/platform/projectModel-api/src/com/intellij/openapi/roots/ModifiableRootModel.java index 193ad029d741..5c1640d9f3e2 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/roots/ModifiableRootModel.java +++ b/platform/projectModel-api/src/com/intellij/openapi/roots/ModifiableRootModel.java @@ -113,11 +113,15 @@ public interface ModifiableRootModel extends ModuleRootModel { * Commits changes to a {@link ModuleRootManager}. * Should be invoked in a write action. After commit(), the model * becomes read-only. + * + * Use of ModuleRootModificationUtil.updateModel() is recommended. */ void commit(); /** - * Must be invoked for uncommited models that are no longer needed. + * Must be invoked for uncommitted models that are no longer needed. + * + * Use of ModuleRootModificationUtil.updateModel() is recommended. */ void dispose(); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java index 550e99d82033..6e49ebead473 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryInfo.java @@ -261,6 +261,7 @@ public class DirectoryInfo { } }; + @Nullable public VirtualFile getSourceRoot() { return sourceRoot; } @@ -273,6 +274,7 @@ public class DirectoryInfo { return getLibraryClassRoot() != null; } + @Nullable public VirtualFile getContentRoot() { return contentRoot; } diff --git a/platform/util/src/com/intellij/icons/AllIcons.java b/platform/util/src/com/intellij/icons/AllIcons.java index efaf45b11ef6..b11ef0de0acb 100644 --- a/platform/util/src/com/intellij/icons/AllIcons.java +++ b/platform/util/src/com/intellij/icons/AllIcons.java @@ -629,7 +629,6 @@ public class AllIcons { public static final Icon Top = IconLoader.getIcon("/ide/shadow/top.png"); // 1x20 } - public static final Icon SharedScope = IconLoader.getIcon("/ide/sharedScope.png"); // 16x16 public static final Icon Statusbar_arrows = IconLoader.getIcon("/ide/statusbar_arrows.png"); // 7x10 public static final Icon UpDown = IconLoader.getIcon("/ide/upDown.png"); // 16x16 public static final Icon Warning_notifications = IconLoader.getIcon("/ide/warning_notifications.png"); // 16x16 @@ -848,6 +847,7 @@ public class AllIcons { public static final Icon Rw_access = IconLoader.getIcon("/nodes/rw-access.png"); // 13x9 public static final Icon SecurityRole = IconLoader.getIcon("/nodes/SecurityRole.png"); // 16x16 public static final Icon Servlet = IconLoader.getIcon("/nodes/servlet.png"); // 16x16 + public static final Icon Shared = IconLoader.getIcon("/nodes/shared.png"); // 16x16 public static final Icon SortBySeverity = IconLoader.getIcon("/nodes/sortBySeverity.png"); // 16x16 public static final Icon SourceFolder = IconLoader.getIcon("/nodes/sourceFolder.png"); // 16x16 public static final Icon Static = IconLoader.getIcon("/nodes/static.png"); // 16x16 diff --git a/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilLightTest.java b/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilLightTest.java index 4b4fef32e01a..b469f8f09b45 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilLightTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilLightTest.java @@ -87,7 +87,7 @@ public class FileUtilLightTest { } @Test - public void isAncestor() throws Exception { + public void isAncestor() { assertTrue(FileUtil.isAncestor("/", "/a/", true)); assertTrue(FileUtil.isAncestor("/a/b/c", "/a/b/c/d/e/f", true)); assertTrue(FileUtil.isAncestor("/a/b/c/", "/a/b/c/d/e/f", true)); @@ -105,7 +105,7 @@ public class FileUtilLightTest { } @Test - public void testRemoveAncestors() throws Exception { + public void testRemoveAncestors() { List data = Arrays.asList("/a/b/c", "/a", "/a/b", "/d/e", "/b/c", "/a/d", "/b/c/ttt", "/a/ewq.euq"); String[] expected = {"/a","/b/c","/d/e"}; @SuppressWarnings("unchecked") Collection result = FileUtil.removeAncestors(data, Convertor.SELF, PairProcessor.TRUE); @@ -113,7 +113,7 @@ public class FileUtilLightTest { } @Test - public void testCheckImmediateChildren() throws Exception { + public void testCheckImmediateChildren() { String root = "/a"; String[] data = {"/a/b/c", "/a", "/a/b", "/d/e", "/b/c", "/a/d", "/a/b/c/d/e"}; ThreeState[] expected1 = {ThreeState.UNSURE, ThreeState.YES, ThreeState.YES, ThreeState.NO, ThreeState.NO, ThreeState.YES, ThreeState.UNSURE}; diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties index 05d62ad3dba4..10c7b3ab268a 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties @@ -797,7 +797,7 @@ teardown.calls.super.teardown.display.name='tearDown()' does not call 'super.tea synchronize.on.lock.display.name=Synchronization on a Lock object synchronized.on.literal.object.name=Synchronization on an object initialized with a literal field.may.be.static.display.name=Field may be 'static' -class.may.be.interface.display.name=Class may be interface +class.may.be.interface.display.name=Abstract class may be interface abstract.class.without.abstract.methods.display.name=Abstract class without abstract methods divide.by.zero.display.name=Divide by zero default.not.last.case.in.switch.display.name='default' not last case in 'switch' statement @@ -902,7 +902,7 @@ anonymous.inner.class.problem.descriptor=Anonymous inner class #ref limited.scope.inner.class.problem.descriptor=Limited-scope inner class #ref #loc final.method.problem.descriptor=Method declared #ref #loc class.initializer.problem.descriptor=Non-'static' initializer #loc -class.may.be.interface.problem.descriptor=#ref may be interface #loc +class.may.be.interface.problem.descriptor=Abstract class #ref may be interface #loc non.protected.constructor.in.abstract.class.problem.descriptor=Constructor #ref() is not declared 'protected' in 'abstract' class #loc class.without.constructor.problem.descriptor=Class #ref has no constructor #loc abstract.class.without.abstract.methods.problem.descriptor=Class #ref is declared 'abstract', and has no 'abstract' methods #loc diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassMayBeInterfaceInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassMayBeInterfaceInspectionTest.java index 28fc863b6fd8..7fbf87c254cd 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassMayBeInterfaceInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassMayBeInterfaceInspectionTest.java @@ -24,7 +24,7 @@ import com.siyeh.ig.LightInspectionTestCase; public class ClassMayBeInterfaceInspectionTest extends LightInspectionTestCase { public void testOne() { - doTest("abstract class /*'ConvertMe' may be interface*/ConvertMe/**/ {\n" + + doTest("abstract class /*Abstract class 'ConvertMe' may be interface*/ConvertMe/**/ {\n" + " public static final String S = \"\";\n" + " public void m() {}\n" + " public static void n() {\n" + diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java index 2976c03f50c0..1f8fa6091678 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java @@ -686,7 +686,7 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider, public RemoveMetaTargetsOrBuildFileAction() { super(AntBundle.message("remove.meta.targets.action.name"), AntBundle.message("remove.meta.targets.action.description"), null); - registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)), myTree); + registerCustomShortcutSet(CommonShortcuts.getDelete(), myTree); Disposer.register(AntExplorer.this, new Disposable() { public void dispose() { RemoveMetaTargetsOrBuildFileAction.this.unregisterCustomShortcutSet(myTree); diff --git a/plugins/devkit/src/dom/Extensions.java b/plugins/devkit/src/dom/Extensions.java index ebf9ef53df82..f07357e56fe4 100644 --- a/plugins/devkit/src/dom/Extensions.java +++ b/plugins/devkit/src/dom/Extensions.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. @@ -26,19 +26,24 @@ import org.jetbrains.idea.devkit.dom.impl.ExtensionNsConverter; import java.util.List; public interface Extensions extends DomElement { + @NotNull @Attribute("defaultExtensionNs") - @Convert(value=ExtensionNsConverter.class, soft=true) + @Convert(value = ExtensionNsConverter.class, soft = true) @Stubbed GenericAttributeValue getDefaultExtensionNs(); @NotNull - @Convert(value=ExtensionNsConverter.class, soft=true) + @Convert(value = ExtensionNsConverter.class, soft = true) @Stubbed GenericAttributeValue getXmlns(); List getExtensions(); + Extension addExtension(); Extension addExtension(String name); + + @NotNull + String getEpPrefix(); } diff --git a/plugins/devkit/src/dom/impl/ExtensionDomExtender.java b/plugins/devkit/src/dom/impl/ExtensionDomExtender.java index cbd621528699..7fdfdeecc632 100644 --- a/plugins/devkit/src/dom/impl/ExtensionDomExtender.java +++ b/plugins/devkit/src/dom/impl/ExtensionDomExtender.java @@ -136,23 +136,17 @@ public class ExtensionDomExtender extends DomExtender { if (ideaPlugin == null) return; - String prefix = getEpPrefix(extensions); + String epPrefix = extensions.getEpPrefix(); for (IdeaPlugin plugin : getVisiblePlugins(ideaPlugin)) { final String pluginId = StringUtil.notNullize(plugin.getPluginId(), "com.intellij"); for (ExtensionPoints points : plugin.getExtensionPoints()) { for (ExtensionPoint point : points.getExtensionPoints()) { - registerExtensionPoint(registrar, point, prefix, pluginId); + registerExtensionPoint(registrar, point, epPrefix, pluginId); } } } } - private static String getEpPrefix(Extensions extensions) { - String prefix = extensions.getDefaultExtensionNs().getStringValue(); - if (prefix == null) prefix = extensions.getXmlns().getStringValue(); - return prefix != null ? prefix + "." : ""; - } - private static Set getVisiblePlugins(IdeaPlugin ideaPlugin) { Set result = ContainerUtil.newHashSet(); MultiMap byId = getPluginMap(ideaPlugin.getManager().getProject()); @@ -184,15 +178,15 @@ public class ExtensionDomExtender extends DomExtender { private static void registerExtensionPoint(final DomExtensionsRegistrar registrar, final ExtensionPoint extensionPoint, - String prefix, + String epPrefix, @Nullable String pluginId) { String epName = extensionPoint.getName().getStringValue(); if (epName != null && StringUtil.isNotEmpty(pluginId)) epName = pluginId + "." + epName; if (epName == null) epName = extensionPoint.getQualifiedName().getStringValue(); if (epName == null) return; - if (!epName.startsWith(prefix)) return; + if (!epName.startsWith(epPrefix)) return; - final DomExtension domExtension = registrar.registerCollectionChildrenExtension(new XmlName(epName.substring(prefix.length())), Extension.class); + final DomExtension domExtension = registrar.registerCollectionChildrenExtension(new XmlName(epName.substring(epPrefix.length())), Extension.class); domExtension.setDeclaringElement(extensionPoint); domExtension.addExtender(EXTENSION_EXTENDER); } diff --git a/plugins/devkit/src/dom/impl/ExtensionImpl.java b/plugins/devkit/src/dom/impl/ExtensionImpl.java index 28ff67f6a504..6fc3e8560c54 100644 --- a/plugins/devkit/src/dom/impl/ExtensionImpl.java +++ b/plugins/devkit/src/dom/impl/ExtensionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 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. @@ -15,10 +15,7 @@ */ package org.jetbrains.idea.devkit.dom.impl; -import com.intellij.pom.PomTarget; -import com.intellij.pom.PomTargetPsiElement; -import com.intellij.psi.PsiElement; -import com.intellij.util.xml.DomTarget; +import com.intellij.util.xml.DomElement; import org.jetbrains.idea.devkit.dom.Extension; import org.jetbrains.idea.devkit.dom.ExtensionPoint; @@ -30,10 +27,9 @@ public abstract class ExtensionImpl implements Extension { @Override public ExtensionPoint getExtensionPoint() { - PsiElement declaration = getChildDescription().getDeclaration(getManager().getProject()); - if (declaration instanceof PomTargetPsiElement) { - PomTarget target = ((PomTargetPsiElement)declaration).getTarget(); - return target instanceof DomTarget ? (ExtensionPoint)((DomTarget)target).getDomElement() : null; + final DomElement domDeclaration = getChildDescription().getDomDeclaration(); + if (domDeclaration instanceof ExtensionPoint) { + return (ExtensionPoint)domDeclaration; } return null; } diff --git a/plugins/devkit/src/dom/impl/ExtensionsImpl.java b/plugins/devkit/src/dom/impl/ExtensionsImpl.java index 2de064052e0b..e52cdca34c2f 100644 --- a/plugins/devkit/src/dom/impl/ExtensionsImpl.java +++ b/plugins/devkit/src/dom/impl/ExtensionsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 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. @@ -16,6 +16,7 @@ package org.jetbrains.idea.devkit.dom.impl; import com.intellij.psi.xml.XmlTag; +import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.devkit.dom.Extension; import org.jetbrains.idea.devkit.dom.Extensions; @@ -32,4 +33,11 @@ public abstract class ExtensionsImpl implements Extensions { tag.setName(name.substring(getDefaultExtensionNs().getStringValue().length() + 1)); return extension; } + + @NotNull + public String getEpPrefix() { + String prefix = getDefaultExtensionNs().getStringValue(); + if (prefix == null) prefix = getXmlns().getStringValue(); + return prefix != null ? prefix + "." : ""; + } } diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java index ddfdbb7f442f..73e353fa47ee 100644 --- a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseClasspathTest.java @@ -20,24 +20,24 @@ */ package org.jetbrains.idea.eclipse; -import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PluginPathManager; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.module.StdModuleTypes; -import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.openapi.roots.ModuleRootManager; import com.intellij.openapi.roots.ModuleRootModel; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.IdeaTestCase; -import junit.framework.Assert; +import com.intellij.util.Consumer; +import com.intellij.util.containers.ContainerUtil; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; @@ -48,8 +48,7 @@ import org.jetbrains.idea.eclipse.conversion.EclipseClasspathWriter; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; +import java.util.Set; public class EclipseClasspathTest extends IdeaTestCase { @Override @@ -73,31 +72,35 @@ public class EclipseClasspathTest extends IdeaTestCase { checkModule(path, setUpModule(path, project)); } - static Module setUpModule(final String path, @NotNull final Project project) - throws IOException, JDOMException, ConversionException, ConfigurationException { + static Module setUpModule(final String path, @NotNull final Project project) throws Exception { final File classpathFile = new File(path, EclipseXml.DOT_CLASSPATH_EXT); String fileText = FileUtil.loadFile(classpathFile).replaceAll("\\$ROOT\\$", project.getBaseDir().getPath()); if (!SystemInfo.isWindows) { fileText = fileText.replaceAll(EclipseXml.FILE_PROTOCOL + "/", EclipseXml.FILE_PROTOCOL); } final Element classpathElement = JDOMUtil.loadDocument(fileText).getRootElement(); + final Module module = WriteCommandAction.runWriteCommandAction(null, new Computable() { @Override public Module compute() { - return ModuleManager.getInstance(project) - .newModule(path + "/" + EclipseProjectFinder.findProjectName(path) + IdeaXml.IML_EXT, StdModuleTypes.JAVA.getId()); + String imlPath = path + "/" + EclipseProjectFinder.findProjectName(path) + IdeaXml.IML_EXT; + return ModuleManager.getInstance(project).newModule(imlPath, StdModuleTypes.JAVA.getId()); } }); - final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); - final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, project, null); - classpathReader.init(rootModel); - classpathReader - .readClasspath(rootModel, new ArrayList(), new ArrayList(), new HashSet(), new HashSet(), null, - classpathElement); - new EclipseClasspathStorageProvider().assertCompatible(rootModel); - ApplicationManager.getApplication().runWriteAction(new Runnable() { - public void run() { - rootModel.commit(); + + ModuleRootModificationUtil.updateModel(module, new Consumer() { + @Override + public void consume(ModifiableRootModel model) { + try { + final Set sink = ContainerUtil.newHashSet(); + final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, project, null); + classpathReader.init(model); + classpathReader.readClasspath(model, sink, sink, sink, sink, null, classpathElement); + new EclipseClasspathStorageProvider().assertCompatible(model); + } + catch (Exception e) { + throw new RuntimeException(e); + } } }); return module; @@ -116,8 +119,8 @@ public class EclipseClasspathTest extends IdeaTestCase { new EclipseClasspathWriter(model).writeClasspath(resultClasspathElement, classpathElement1); String resulted = new String(JDOMUtil.printDocument(new Document(resultClasspathElement), "\n")); - Assert.assertTrue(resulted.replaceAll(StringUtil.escapeToRegexp(module.getProject().getBaseDir().getPath()), "\\$ROOT\\$"), - JDOMUtil.areElementsEqual(classpathElement1, resultClasspathElement)); + assertTrue(resulted.replaceAll(StringUtil.escapeToRegexp(module.getProject().getBaseDir().getPath()), "\\$ROOT\\$"), + JDOMUtil.areElementsEqual(classpathElement1, resultClasspathElement)); } diff --git a/plugins/gradle/tooling-extension/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java b/plugins/gradle/tooling-extension/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java index f5a5dfbc9318..7113725a8092 100644 --- a/plugins/gradle/tooling-extension/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java +++ b/plugins/gradle/tooling-extension/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java @@ -35,6 +35,7 @@ import java.io.File; import java.util.Arrays; import java.util.Collection; import java.util.Set; +import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -114,6 +115,7 @@ public abstract class AbstractModelBuilderTest { DefaultGradleConnector gradleConnector = (DefaultGradleConnector)connector; gradleConnector.useGradleVersion(gradleVersion); gradleConnector.forProjectDirectory(testDir); + gradleConnector.daemonMaxIdleTime(1, TimeUnit.SECONDS); ProjectConnection connection = gradleConnector.connect(); final ProjectImportAction projectImportAction = new ProjectImportAction(false); diff --git a/plugins/java-i18n/src/META-INF/plugin.xml b/plugins/java-i18n/src/META-INF/plugin.xml index ee4e95c9dddb..02c6b05c863b 100644 --- a/plugins/java-i18n/src/META-INF/plugin.xml +++ b/plugins/java-i18n/src/META-INF/plugin.xml @@ -26,7 +26,6 @@ - +