From ac4d93b3bc81c3ddc16de9e4c0c20db0006e9f30 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 20 Jan 2011 13:50:48 +0100 Subject: [PATCH 01/20] additional logging: "at what oint corruption marker is created?" --- .../vfs/newvfs/persistent/FSRecords.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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() { From 96e05be306fa846de425ee434e94915d7e138409 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 20 Jan 2011 12:46:01 +0300 Subject: [PATCH 02/20] test --- .../src/com/intellij/testFramework/LeakedProjectHunter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/LeakedProjectHunter.java b/platform/testFramework/src/com/intellij/testFramework/LeakedProjectHunter.java index e80639064618..e726ef17c497 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LeakedProjectHunter.java +++ b/platform/testFramework/src/com/intellij/testFramework/LeakedProjectHunter.java @@ -89,6 +89,7 @@ public class LeakedProjectHunter { Class rootClass = backLink.aClass; List fields = getAllFields(rootClass); for (Field field : fields) { + if (root instanceof Reference && "referent".equals(field.getName())) continue; // do not follow weak/soft refs Object value = field.get(root); if (value == null) continue; Class valueClass = value.getClass(); @@ -97,7 +98,6 @@ public class LeakedProjectHunter { processor.process(newBackLink); } else { - if (root instanceof Reference && "referent".equals(field.getName())) continue; // do not follow weak/soft refs BackLink newBackLink = new BackLink(valueClass, value, field, backLink); if (toFollow(valueClass)) { toVisit.push(newBackLink); @@ -113,7 +113,7 @@ public class LeakedProjectHunter { toVisit.push(new BackLink(oClass, o, null, backLink)); } } - catch (ClassCastException e) { + catch (ClassCastException ignored) { } } } @@ -133,7 +133,6 @@ public class LeakedProjectHunter { noFollowClasses.add("java.lang.Object"); noFollowClasses.add("java.lang.Short"); noFollowClasses.add("java.lang.String"); - noFollowClasses.add("java.lang.ref.WeakReference"); } private static boolean toFollow(Class oClass) { From 9214ca1cd8df2e9c57797887cbe2506528861d2a Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 20 Jan 2011 16:07:22 +0300 Subject: [PATCH 03/20] IDEA-64148 --- .../src/com/intellij/util/lang/JarLoader.java | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/platform/util/src/com/intellij/util/lang/JarLoader.java b/platform/util/src/com/intellij/util/lang/JarLoader.java index acbb6e069c40..d673049fd3da 100644 --- a/platform/util/src/com/intellij/util/lang/JarLoader.java +++ b/platform/util/src/com/intellij/util/lang/JarLoader.java @@ -34,12 +34,11 @@ class JarLoader extends Loader { private final boolean myCanLockJar; private static final boolean myDebugTime = false; - //private SoftReference myZipFileRef; private final TimedComputable myZipFileRef = new TimedComputable(null) { @NotNull protected ZipFile calc() { try { - final ZipFile zipFile = _getZipFile(); + final ZipFile zipFile = doGetZipFile(); if (zipFile == null) throw new RuntimeException("Can't load zip file"); return zipFile; } @@ -60,20 +59,27 @@ class JarLoader extends Loader { } @Nullable - private ZipFile getZipFile() throws IOException { + private ZipFile acquireZipFile() throws IOException { if (myCanLockJar) { return myZipFileRef.acquire(); } - else { - return _getZipFile(); + return doGetZipFile(); + } + + private void releaseZipFile(final ZipFile zipFile) throws IOException { + if (myCanLockJar) { + myZipFileRef.release(); + } + else if (zipFile != null) { + zipFile.close(); } } @Nullable - private ZipFile _getZipFile() throws IOException { + private ZipFile doGetZipFile() throws IOException { if (FILE_PROTOCOL.equals(myURL.getProtocol())) { String s = FileUtil.unquote(myURL.getFile()); - if (!(new File(s)).exists()) { + if (!new File(s).exists()) { throw new FileNotFoundException(s); } else { @@ -85,48 +91,44 @@ class JarLoader extends Loader { } void buildCache(final ClasspathCache cache) throws IOException { - final ZipFile zipFile = getZipFile(); - if (zipFile == null) return; - final Enumeration entries = zipFile.entries(); + ZipFile zipFile = null; + try { + zipFile = acquireZipFile(); + if (zipFile == null) return; + final Enumeration entries = zipFile.entries(); - while (entries.hasMoreElements()) { - ZipEntry zipEntry = entries.nextElement(); - cache.addResourceEntry(zipEntry.getName(), this); + while (entries.hasMoreElements()) { + ZipEntry zipEntry = entries.nextElement(); + cache.addResourceEntry(zipEntry.getName(), this); + } } - - releaseZipFile(zipFile); - } - - private void releaseZipFile(final ZipFile zipFile) throws IOException { - if (myCanLockJar) { - myZipFileRef.release(); - } - else { - zipFile.close(); + finally { + releaseZipFile(zipFile); } } @Nullable Resource getResource(String name, boolean flag) { final long started = myDebugTime ? System.nanoTime():0; + ZipFile file = null; try { - final ZipFile file = getZipFile(); + file = acquireZipFile(); if (file == null) return null; - - try { - ZipEntry entry = file.getEntry(name); - if (entry != null) return new MyResource(entry, new URL(getBaseURL(), name)); - } - finally { - releaseZipFile(file); - } + ZipEntry entry = file.getEntry(name); + if (entry != null) return new MyResource(entry, new URL(getBaseURL(), name)); } catch (Exception e) { return null; - } finally { - final long doneFor = myDebugTime ? (System.nanoTime() - started):0; + } + finally { + try { + releaseZipFile(file); + } + catch (IOException ignored) { + } + final long doneFor = myDebugTime ? System.nanoTime() - started :0; if (doneFor > NS_THRESHOLD) { - System.out.println((doneFor/1000000) + " ms for jar loader get resource:"+name); + System.out.println(doneFor/1000000 + " ms for jar loader get resource:"+name); } } @@ -156,24 +158,28 @@ class JarLoader extends Loader { @Nullable public InputStream getInputStream() throws IOException { - final ZipFile file = getZipFile(); - if (file == null) return null; - - final boolean[] wasReleased = new boolean[]{false}; + final boolean[] wasReleased = {false}; + ZipFile file = null; try { + file = acquireZipFile(); + if (file == null) { + releaseZipFile(file); + return null; + } final InputStream inputStream = file.getInputStream(myEntry); if (inputStream == null) { + releaseZipFile(file); return null; // if entry was not found } + final ZipFile finalFile = file; return new FilterInputStream(inputStream) { private boolean myClosed = false; - public void close() throws IOException { super.close(); if (!myClosed) { - releaseZipFile(file); + releaseZipFile(finalFile); } myClosed = true; wasReleased[0] = true; @@ -182,8 +188,8 @@ class JarLoader extends Loader { } catch (IOException e) { e.printStackTrace(); - assert !wasReleased[0]; releaseZipFile(file); + assert !wasReleased[0]; return null; } } From 9152e335b40a2c60a726182a837282ec4dec0a0f Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 20 Jan 2011 13:50:08 +0300 Subject: [PATCH 04/20] xdebugger toolwindow: actions for toolbars registered in xml --- .../src/idea/LangActions.xml | 21 +++++++++++ .../impl/actions/XDebuggerActions.java | 2 ++ .../xdebugger/impl/ui/XDebugSessionTab.java | 36 ++++++------------- 3 files changed, 33 insertions(+), 26 deletions(-) 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 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java index 6fe96f9e7525..4819bbe1574d 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java @@ -39,6 +39,8 @@ public interface XDebuggerActions { @NonNls String EVALUATE_EXPRESSION = "EvaluateExpression"; + @NonNls String TOOL_WINDOW_TOP_TOOLBAR_GROUP = "XDebugger.ToolWindow.TopToolbar"; + @NonNls String TOOL_WINDOW_LEFT_TOOLBAR_GROUP = "XDebugger.ToolWindow.LeftToolbar"; @NonNls String EVALUATE_DIALOG_TREE_POPUP_GROUP = "XDebugger.Evaluation.Dialog.Tree.Popup"; @NonNls String INSPECT_TREE_POPUP_GROUP = "XDebugger.Inspect.Tree.Popup"; @NonNls String VARIABLES_TREE_POPUP_GROUP = "XDebugger.Variables.Tree.Popup"; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java index 8a0055867998..0f6c24e823a9 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java @@ -72,7 +72,12 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { myUi = RunnerLayoutUi.Factory.getInstance(project).create("Debug", "unknown!", sessionName, this); myUi.getDefaults().initTabDefaults(0, "Debug", null); - myUi.getOptions().setTopToolbar(createTopToolbar(), ActionPlaces.DEBUGGER_TOOLBAR); + ActionGroup topToolbar = getActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP); + myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR); + } + + private static ActionGroup getActionGroup(final String id) { + return (ActionGroup)ActionManager.getInstance().getAction(id); } private Content createConsoleContent() { @@ -94,7 +99,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { Content watchesContent = myUi.createContent(DebuggerContentInfo.WATCHES_CONTENT, myWatchesView.getMainPanel(), XDebuggerBundle.message("debugger.session.tab.watches.title"), XDebuggerUIConstants.WATCHES_TAB_ICON, null); - ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(XDebuggerActions.WATCHES_TREE_TOOLBAR_GROUP); + ActionGroup group = getActionGroup(XDebuggerActions.WATCHES_TREE_TOOLBAR_GROUP); watchesContent.setActions(group, ActionPlaces.DEBUGGER_TOOLBAR, myWatchesView.getTree()); return watchesContent; } @@ -114,21 +119,6 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { return framesContent; } - private static DefaultActionGroup createTopToolbar() { - DefaultActionGroup group = new DefaultActionGroup(); - ActionManager actionManager = ActionManager.getInstance(); - group.add(actionManager.getAction(XDebuggerActions.SHOW_EXECUTION_POINT)); - group.addSeparator(); - group.add(actionManager.getAction(XDebuggerActions.STEP_OVER)); - group.add(actionManager.getAction(XDebuggerActions.STEP_INTO)); - group.add(actionManager.getAction(XDebuggerActions.FORCE_STEP_INTO)); - group.add(actionManager.getAction(XDebuggerActions.STEP_OUT)); - group.add(actionManager.getAction(XDebuggerActions.RUN_TO_CURSOR)); - group.addSeparator(); - group.add(actionManager.getAction(XDebuggerActions.TOGGLE_SORT_VALUES)); - return group; - } - public XDebugSessionData saveData() { final List watchExpressions = myWatchesView.getWatchExpressions(); return new XDebugSessionData(ArrayUtil.toStringArray(watchExpressions)); @@ -200,16 +190,10 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { restartAction.registerShortcut(myUi.getComponent()); } - addActionToGroup(group, XDebuggerActions.RESUME); - addActionToGroup(group, XDebuggerActions.PAUSE); - addActionToGroup(group, IdeActions.ACTION_STOP_PROGRAM); + final ActionGroup leftToolbar = getActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP); + group.add(leftToolbar); - group.addSeparator(); - - addActionToGroup(group, XDebuggerActions.VIEW_BREAKPOINTS); - addActionToGroup(group, XDebuggerActions.MUTE_BREAKPOINTS); - - group.addSeparator(); + //group.addSeparator(); //addAction(group, DebuggerActions.EXPORT_THREADS); group.addSeparator(); From a6f04e0949044851f7c74c4ef2f9a87d2e1b0cf2 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 20 Jan 2011 16:04:38 +0300 Subject: [PATCH 05/20] content ui: fixed showing tabs & toolbar [rev by kirillk] --- .../execution/ui/layout/impl/RunnerContentUi.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); From 652ed324092efdc3208216d4753b18fb28e507fc Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 20 Jan 2011 16:09:57 +0300 Subject: [PATCH 06/20] xdebugger: allow to show additional actions in debug tool window --- .../com/intellij/xdebugger/XDebugProcess.java | 7 ++++ .../xdebugger/impl/ui/XDebugSessionTab.java | 34 ++++++++----------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java index c9f20b7b408d..267a17a32c92 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java @@ -21,6 +21,7 @@ import com.intellij.execution.filters.TextConsoleBuilderFactory; import com.intellij.execution.process.ProcessHandler; import com.intellij.execution.ui.ExecutionConsole; import com.intellij.execution.ui.RunnerLayoutUi; +import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.xdebugger.breakpoints.XBreakpointHandler; import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider; import com.intellij.xdebugger.stepping.XSmartStepIntoHandler; @@ -158,6 +159,12 @@ public abstract class XDebugProcess { public void registerAdditionalContent(@NotNull RunnerLayoutUi ui) { } + /** + * Override this method to provide additional actions in 'Debug' tool window + */ + public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar) { + } + /** * @return message to show in Variables View when debugger isn't paused */ diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java index 0f6c24e823a9..3adb2a26a7fb 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java @@ -71,9 +71,6 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { myUi = RunnerLayoutUi.Factory.getInstance(project).create("Debug", "unknown!", sessionName, this); myUi.getDefaults().initTabDefaults(0, "Debug", null); - - ActionGroup topToolbar = getActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP); - myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR); } private static ActionGroup getActionGroup(final String id) { @@ -181,31 +178,35 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { return myRunContentDescriptor; } - DefaultActionGroup group = new DefaultActionGroup(); + DefaultActionGroup leftToolbar = new DefaultActionGroup(); final Executor executor = DefaultDebugExecutor.getDebugExecutorInstance(); if (runner != null && environment != null) { RestartAction restartAction = new RestartAction(executor, runner, myRunContentDescriptor.getProcessHandler(), XDebuggerUIConstants.DEBUG_AGAIN_ICON, myRunContentDescriptor, environment); - group.add(restartAction); + leftToolbar.add(restartAction); restartAction.registerShortcut(myUi.getComponent()); } - final ActionGroup leftToolbar = getActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP); - group.add(leftToolbar); + leftToolbar.addAll(getActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP)); //group.addSeparator(); //addAction(group, DebuggerActions.EXPORT_THREADS); - group.addSeparator(); + leftToolbar.addSeparator(); - group.add(myUi.getOptions().getLayoutActions()); + leftToolbar.add(myUi.getOptions().getLayoutActions()); - group.addSeparator(); + leftToolbar.addSeparator(); - group.add(PinToolwindowTabAction.getPinAction()); - group.add(new CloseAction(executor, myRunContentDescriptor, getProject())); - group.add(new ContextHelpAction(executor.getHelpId())); + leftToolbar.add(PinToolwindowTabAction.getPinAction()); + leftToolbar.add(new CloseAction(executor, myRunContentDescriptor, getProject())); + leftToolbar.add(new ContextHelpAction(executor.getHelpId())); - myUi.getOptions().setLeftToolbar(group, ActionPlaces.DEBUGGER_TOOLBAR); + DefaultActionGroup topToolbar = new DefaultActionGroup(); + topToolbar.addAll(getActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP)); + + session.getDebugProcess().registerAdditionalActions(leftToolbar, topToolbar); + myUi.getOptions().setLeftToolbar(leftToolbar, ActionPlaces.DEBUGGER_TOOLBAR); + myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR); if (environment != null) { final RunProfile runConfiguration = environment.getRunProfile(); @@ -218,11 +219,6 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { return myRunContentDescriptor; } - private static void addActionToGroup(final DefaultActionGroup group, final String actionId) { - AnAction action = ActionManager.getInstance().getAction(actionId); - if (action != null) group.add(action); - } - public RunnerLayoutUi getUi() { return myUi; } From 8d19c9a3115f7789870e57b92e5206d766bd9a3f Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 20 Jan 2011 14:16:08 +0100 Subject: [PATCH 07/20] To JB dictionary --- plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic b/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic index bc5f5909efce..b8caf2eba375 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic +++ b/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic @@ -262,6 +262,7 @@ tooltips trinary twitter uncomment +uncommented underwave undofile unhandled From 8642170c6456cd757b32627a5c75c858d450adf5 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 20 Jan 2011 16:41:23 +0300 Subject: [PATCH 08/20] kill process tree under windows using winp library (IDEA-63833) --- lib/winp-1.14.jar | Bin 0 -> 18629 bytes license/winp_license.txt | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lib/winp-1.14.jar create mode 100644 license/winp_license.txt diff --git a/lib/winp-1.14.jar b/lib/winp-1.14.jar new file mode 100644 index 0000000000000000000000000000000000000000..240382c7a4888637c99ada719f1d2a037d83ba4c GIT binary patch literal 18629 zcma)k1z256vhD_gySux)y9RenaCdii5AN=+!8JI+J-EAjaCl_S%w#6#zWZLoVlTc` z_3!Rp-PKjyRV6P4@&O9)t4u1HbN}P!pMN0VKV?Lf1!*N@#pvb#Nd^I!cqdERPq(*! ze;oRLq5LPAjG(N9n5dF6os8JE%;<=;6fNBptQ0NP_~=BPBEu~6#;!e$2 z@SOtH1T^X{64#cD2t{NmMJ2~fs!9|bXry>%MO07Z5yk8GCz8w#l3iPi519Rhi=_y; zC|cDCmN5^;?qHX}WUXdl{iKwo5`~BDn(dl^f7KE2k2=0r>)++W`<;!w$-i6icZy$K z@QcFS+1kkQf1!i_FFF@9YukSl|J60K>;3pJu#(Cg|J3xVk=6SdH88~Cp}>m%$MHG2<6uW6oIAFyS2=15}7&)>7@d@ z>9)JI^WzuqZ+A}|m#aiCntI?&jQME z&1#c$rAtaoEgNw{kPZcJKHRFraP9uEI_2fO-tp`U^x_CY~zf zipN+w8Em={F^CFhCiC=;GzC--Tn7$4u+@^E3D#)F;x*{(O_MS=#;vJtM`;s*sE?yg zXS#M|Y<%Dqc3#~j$kJns#~aYbmdgdkxXPDQe5P-hlY<7bXi1Q(VMh{8?qF?kk|#rg zC3_3eHsG1dVdGh>IS#Zm9Y>{od>k88(Yqxcr}GM*@X*+xJRWnr&&k7B##EI8`}-^I zwFSYvx?m4>(oJLl`uqfrW^5vw(=@$F;gZaQv60oBX-$L*neY=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!Ua0 z1cK@Hq(}=tRp+RY_iG;*9O736f!VC+r(9zbpMT2{h=1g9py`Yt(tV$m#_t#7|Nrc? zwYRY~vUfBya!_)X8+$O5HC}{kfD(p+g605lu@}Dp;uyH0T59e5HKl2K)@+5 zFfr8ZQ2jH<1M4g^%cdm#Fg@*sbnO_uLcu{%XK4o?jfN|K#{r5{chU{FOB07uCPYFWLTA`NfC&zGD92TlxD- z|L3$4|6(uj6MAR^EEj$KT-o<6Zov(Eo|{r$z7^&5Y}BX#d&T{~7L2ZS*%B56|D={;#^} z?@In%O#Sy9_T~K#G4(HP?Y98C?^c(m4yJ-KnVE?Pf{%^Ry*Clx= V(07M)008a%hvWUuMd;Um{|AXjIA8z( literal 0 HcmV?d00001 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 From 824177cc21f35fc21fe95cbb5f4f46908f103a45 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Thu, 20 Jan 2011 16:30:01 +0300 Subject: [PATCH 09/20] fix USE_PROJECT_PROFILE --- .../src/com/intellij/profile/DefaultProjectProfileManager.java | 3 +++ 1 file changed, 3 insertions(+) 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(); From 0f6003cf292ef81dc877187cfc77120954cbb3a1 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 20 Jan 2011 17:09:32 +0300 Subject: [PATCH 10/20] git: removed extra logging --- plugins/git4idea/src/git4idea/commands/GitHandler.java | 2 +- plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/git4idea/src/git4idea/commands/GitHandler.java b/plugins/git4idea/src/git4idea/commands/GitHandler.java index b070e350badb..fc5990cf6707 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitHandler.java @@ -390,11 +390,11 @@ public abstract class GitHandler { } try { - LOG.info(myCommandLine.getCommandLineString()); // setup environment if (!myProject.isDefault() && !mySilent && (myVcs != null)) { myVcs.showCommandLine("cd " + myWorkingDirectory); myVcs.showCommandLine(printableCommandLine()); + LOG.info(myCommandLine.getCommandLineString()); } if (!myNoSSHFlag && myProjectSettings.isIdeaSsh()) { GitSSHService ssh = GitSSHIdeaService.getInstance(); diff --git a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java index a081dbbf72db..d1445dba7bdd 100644 --- a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java @@ -30,7 +30,12 @@ import git4idea.GitBranch; import git4idea.GitRevisionNumber; import git4idea.GitVcs; import git4idea.actions.GitShowAllSubmittedFilesAction; -import git4idea.commands.*; +import git4idea.commands.GitCommand; +import git4idea.commands.GitHandlerUtil; +import git4idea.commands.GitLineHandler; +import git4idea.commands.GitLineHandlerAdapter; +import git4idea.commands.GitSimpleHandler; +import git4idea.commands.StringScanner; import git4idea.config.GitConfigUtil; import git4idea.config.GitVersionSpecialty; import git4idea.i18n.GitBundle; @@ -166,7 +171,6 @@ public class GitUnstashDialog extends DialogWrapper { public void run(@NotNull ProgressIndicator indicator) { GitSimpleHandler h = dropHandler(stash.myStash); try { - h.setSilent(true); h.run(); h.unsilence(); } From a8bc59c904eb212ae8feab393ee0bd9e4be6fdbc Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Thu, 20 Jan 2011 17:19:13 +0300 Subject: [PATCH 11/20] Use GspAttributeValue in pattern instead XmlAttributeValue. (optimization) --- .../com/intellij/patterns/XmlAttributeValuePattern.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java b/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java index aa74e5331307..459b9d36c6e8 100644 --- a/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java +++ b/xml/openapi/src/com/intellij/patterns/XmlAttributeValuePattern.java @@ -32,8 +32,12 @@ public class XmlAttributeValuePattern extends XmlElementPattern condition) { + super(condition); } public XmlAttributeValuePattern withLocalName(@NonNls String... names) { From 7a880e1e06ef33775270836aaba6bec64cee7484 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 20 Jan 2011 17:23:32 +0300 Subject: [PATCH 12/20] Architecture priorities updated according latest Apple guidelines. --- build/conf/mac/Contents/Info.plist | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) 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 From ed23882e57aebc32ba5484681b06adcf1a90e739 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 20 Jan 2011 17:45:13 +0300 Subject: [PATCH 13/20] Hg: renamed *TestCase -> *Test --- .../test/{HgAddTestCase.java => HgAddTest.java} | 2 +- ...ativeTestCase.java => HgCollaborativeTest.java} | 2 +- .../test/{HgCopyTestCase.java => HgCopyTest.java} | 2 +- .../{HgDeleteTestCase.java => HgDeleteTest.java} | 2 +- .../{HgHistoryTestCase.java => HgHistoryTest.java} | 4 ++-- .../test/{HgLogTestCase.java => HgLogTest.java} | 2 +- ...viderTestCase.java => HgMergeProviderTest.java} | 2 +- .../test/{HgMoveTestCase.java => HgMoveTest.java} | 2 +- .../test/{HgPushTestCase.java => HgPushTest.java} | 2 +- .../{HgRenameTestCase.java => HgRenameTest.java} | 2 +- .../{HgRevertTestCase.java => HgRevertTest.java} | 2 +- ...ngleUserTestCase.java => HgSingleUserTest.java} | 4 ++-- .../test/{HgAbstractTestCase.java => HgTest.java} | 2 +- .../org/zmlx/hg4idea/test/HgTestRepository.java | 14 +++++++------- .../{HgUpdateTestCase.java => HgUpdateTest.java} | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgAddTestCase.java => HgAddTest.java} (98%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgCollaborativeTestCase.java => HgCollaborativeTest.java} (95%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgCopyTestCase.java => HgCopyTest.java} (97%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgDeleteTestCase.java => HgDeleteTest.java} (98%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgHistoryTestCase.java => HgHistoryTest.java} (95%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgLogTestCase.java => HgLogTest.java} (96%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgMergeProviderTestCase.java => HgMergeProviderTest.java} (98%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgMoveTestCase.java => HgMoveTest.java} (97%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgPushTestCase.java => HgPushTest.java} (97%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgRenameTestCase.java => HgRenameTest.java} (98%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgRevertTestCase.java => HgRevertTest.java} (96%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgSingleUserTestCase.java => HgSingleUserTest.java} (88%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgAbstractTestCase.java => HgTest.java} (99%) rename plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/{HgUpdateTestCase.java => HgUpdateTest.java} (99%) diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAddTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAddTest.java similarity index 98% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAddTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAddTest.java index 89d36c11f25c..d4941b708a97 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAddTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAddTest.java @@ -22,7 +22,7 @@ import static org.zmlx.hg4idea.test.HgTestOutputParser.added; /** * Tests adding files to the Mercurial repository. */ -public class HgAddTestCase extends HgSingleUserTestCase { +public class HgAddTest extends HgSingleUserTest { @BeforeMethod @Override diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCollaborativeTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCollaborativeTest.java similarity index 95% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCollaborativeTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCollaborativeTest.java index f71095b0dd32..5ba278092d38 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCollaborativeTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCollaborativeTest.java @@ -20,7 +20,7 @@ package org.zmlx.hg4idea.test; * This is used to test collaborative tasks, such as push, pull, merge and others. * @author Kirill Likhodedov */ -public class HgCollaborativeTestCase extends HgAbstractTestCase { +public class HgCollaborativeTest extends HgTest { protected HgTestRepository myParentRepo; protected HgTestRepository myRepo; diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCopyTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCopyTest.java similarity index 97% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCopyTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCopyTest.java index 9dfbab6b8bf3..374a2f7929d6 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCopyTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgCopyTest.java @@ -17,7 +17,7 @@ import org.testng.annotations.Test; import java.io.File; -public class HgCopyTestCase extends HgSingleUserTestCase { +public class HgCopyTest extends HgSingleUserTest { @Test public void testCopyUnmodifiedFile() throws Exception { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java similarity index 98% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java index f75746effe60..f5d2ae3769d1 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java @@ -21,7 +21,7 @@ import java.io.File; import static org.testng.Assert.fail; -public class HgDeleteTestCase extends HgSingleUserTestCase { +public class HgDeleteTest extends HgSingleUserTest { @Test public void testDeleteUnmodifiedFile() throws Exception { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java similarity index 95% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java index cf398c9c4687..f690233dee7e 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java @@ -15,9 +15,9 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; /** - * HgHistoryTestCase tests retrieving file history and specific revisions. + * HgHistoryTest tests retrieving file history and specific revisions. */ -public class HgHistoryTestCase extends HgSingleUserTestCase { +public class HgHistoryTest extends HgSingleUserTest { /** * 1. Make two versions of a file (create, add, commit, modify, commit). diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgLogTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgLogTest.java similarity index 96% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgLogTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgLogTest.java index 65e02297031a..6f9f4576c02c 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgLogTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgLogTest.java @@ -20,7 +20,7 @@ import java.util.List; import static org.testng.Assert.assertEquals; -public class HgLogTestCase extends HgSingleUserTestCase { +public class HgLogTest extends HgSingleUserTest { @Test public void testCommitMessagesWithMultipleLines() throws Exception { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMergeProviderTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMergeProviderTest.java similarity index 98% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMergeProviderTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMergeProviderTest.java index a3d57709b144..3aceb2cfe38d 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMergeProviderTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMergeProviderTest.java @@ -37,7 +37,7 @@ import static org.testng.Assert.fail; * All Mercurial operations are performed natively to test only HgMergeProvider functionality. * @author Kirill Likhodedov */ -public class HgMergeProviderTestCase extends HgCollaborativeTestCase { +public class HgMergeProviderTest extends HgCollaborativeTest { private MergeProvider myMergeProvider; diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMoveTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMoveTest.java similarity index 97% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMoveTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMoveTest.java index 97dfb4a7d82f..7674b6497324 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMoveTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgMoveTest.java @@ -17,7 +17,7 @@ import org.testng.annotations.Test; import java.io.File; -public class HgMoveTestCase extends HgSingleUserTestCase { +public class HgMoveTest extends HgSingleUserTest { @Test public void testMoveNewFile() throws Exception { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgPushTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgPushTest.java similarity index 97% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgPushTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgPushTest.java index af0b06d8133b..8423b3693918 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgPushTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgPushTest.java @@ -27,7 +27,7 @@ import static org.testng.Assert.assertNotNull; /** * @author Kirill Likhodedov */ -public class HgPushTestCase extends HgCollaborativeTestCase { +public class HgPushTest extends HgCollaborativeTest { /** * Tests 'push' using only native commands. diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRenameTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRenameTest.java similarity index 98% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRenameTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRenameTest.java index fb02a4371fa2..210679a1b302 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRenameTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRenameTest.java @@ -17,7 +17,7 @@ import org.testng.annotations.Test; import java.io.File; -public class HgRenameTestCase extends HgSingleUserTestCase { +public class HgRenameTest extends HgSingleUserTest { @Test public void testRenameUnmodifiedFile() throws Exception { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRevertTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRevertTest.java similarity index 96% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRevertTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRevertTest.java index 5450ab4e7c27..451750a649e3 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRevertTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgRevertTest.java @@ -9,7 +9,7 @@ import java.nio.charset.Charset; import static org.testng.Assert.assertEquals; -public class HgRevertTestCase extends HgSingleUserTestCase { +public class HgRevertTest extends HgSingleUserTest { @Test public void testRevertToCurrentRevision() throws Exception { fillFile(myProjectDir, new String[]{"file.txt"}, "initial contents"); diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgSingleUserTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgSingleUserTest.java similarity index 88% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgSingleUserTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgSingleUserTest.java index 52b66ce8ec35..d3443c497a5e 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgSingleUserTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgSingleUserTest.java @@ -16,11 +16,11 @@ package org.zmlx.hg4idea.test; /** - * HgSingleUserTestCase is the parent of test cases for single user workflow. + * HgSingleUserTest is the parent of test cases for single user workflow. * It doesn't include collaborate tasks such as cloning, pushing, etc. * @author Kirill Likhodedov */ -public class HgSingleUserTestCase extends HgAbstractTestCase { +public class HgSingleUserTest extends HgTest { protected HgTestRepository myRepo; diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAbstractTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTest.java similarity index 99% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAbstractTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTest.java index 715e7fd49b2a..7331325d2175 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgAbstractTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTest.java @@ -42,7 +42,7 @@ import static org.testng.Assert.assertTrue; /** * The ancestor of all hg4idea test cases. */ -public abstract class HgAbstractTestCase extends AbstractVcsTestCase { +public abstract class HgTest extends AbstractVcsTestCase { public static final String HG_EXECUTABLE_PATH = "IDEA_TEST_HG_EXECUTABLE_PATH"; public static final String HG_EXECUTABLE = "hg"; diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java index 5b8d14427aa8..6fef1f384c14 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java @@ -33,12 +33,12 @@ import java.io.IOException; * @author Kirill Likhodedov */ public class HgTestRepository { - @NotNull private final HgAbstractTestCase myTest; + @NotNull private final HgTest myTest; @NotNull private final TempDirTestFixture myDirFixture; private VirtualFile myDir; @Nullable private final HgTestRepository myParent; // cloned from - public HgTestRepository(@NotNull HgAbstractTestCase test, @NotNull TempDirTestFixture dir) { + public HgTestRepository(@NotNull HgTest test, @NotNull TempDirTestFixture dir) { this(test, dir, null); } @@ -47,7 +47,7 @@ public class HgTestRepository { * @param dir repository root * @param parent parent repository where this repository is cloned from, if one exists. */ - public HgTestRepository(@NotNull HgAbstractTestCase test, @NotNull TempDirTestFixture dir, @Nullable HgTestRepository parent) { + public HgTestRepository(@NotNull HgTest test, @NotNull TempDirTestFixture dir, @Nullable HgTestRepository parent) { myTest = test; myDirFixture = dir; myParent = parent; @@ -55,15 +55,15 @@ public class HgTestRepository { /** * Creates a new Mercurial repository in a new temporary test directory. - * @param testCase reference to the test case instance. + * @param test reference to the test case instance. * @return created repository. */ - public static HgTestRepository create(HgAbstractTestCase testCase) throws Exception { + public static HgTestRepository create(HgTest test) throws Exception { final TempDirTestFixture dirFixture = createFixtureDir(); final File repo = new File(dirFixture.getTempDirPath()); - final ProcessOutput processOutput = testCase.runHg(repo, "init"); + final ProcessOutput processOutput = test.runHg(repo, "init"); AbstractVcsTestCase.verify(processOutput); - return new HgTestRepository(testCase, dirFixture); + return new HgTestRepository(test, dirFixture); } private static TempDirTestFixture createFixtureDir() throws Exception { diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTestCase.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java similarity index 99% rename from plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTestCase.java rename to plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java index 1620e0ecc7ed..9bcae7a18daa 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTestCase.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgUpdateTest.java @@ -46,7 +46,7 @@ import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; @SuppressWarnings({"ConstantConditions", "ThrowableResultOfMethodCallIgnored"}) -public class HgUpdateTestCase extends HgCollaborativeTestCase { +public class HgUpdateTest extends HgCollaborativeTest { private VirtualFile projectRepoVirtualFile; private File projectRepo; From 13bbfcab2a8cfbc53167975b5c65a8ce7ed5eee2 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 20 Jan 2011 13:40:45 +0100 Subject: [PATCH 14/20] make safe delete aware of multiple roots (IDEA-64409) --- .../refactoring/safeDelete/SafeDeleteProcessor.java | 6 ++++++ 1 file changed, 6 insertions(+) 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); } From e58ea835ecfe23cdc14647d6ac8b5fa1b2b60a54 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 20 Jan 2011 16:22:06 +0100 Subject: [PATCH 15/20] junit pattern: forbid module chooser - use default module, or module containing all tests or project otherwise (IDEA-64384; IDEA-64386; IDEA-64387) --- .../execution/util/JavaParametersUtil.java | 4 +++ .../src/messages/ExecutionBundle.properties | 2 +- .../execution/junit/TestsPattern.java | 23 +++++++++++++---- .../configuration/JUnitConfigurable.java | 25 +++++++++++++++++-- 4 files changed, 46 insertions(+), 8 deletions(-) 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/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/plugins/junit/src/com/intellij/execution/junit/TestsPattern.java b/plugins/junit/src/com/intellij/execution/junit/TestsPattern.java index 47fe6f47d091..344be431e834 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestsPattern.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestsPattern.java @@ -24,6 +24,8 @@ import com.intellij.execution.ExecutionException; import com.intellij.execution.JavaExecutionUtil; import com.intellij.execution.configurations.*; import com.intellij.execution.util.JavaParametersUtil; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleUtil; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; @@ -35,6 +37,7 @@ import com.intellij.util.Function; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; +import java.util.HashSet; import java.util.Set; public class TestsPattern extends TestObject { @@ -49,22 +52,32 @@ public class TestsPattern extends TestObject { protected void initialize() throws ExecutionException { super.initialize(); final JUnitConfiguration.Data data = myConfiguration.getPersistentData(); - RunConfigurationModule module = myConfiguration.getConfigurationModule(); - JavaParametersUtil.configureModule(module, myJavaParameters, JavaParameters.JDK_AND_CLASSES_AND_TESTS, - myConfiguration.isAlternativeJrePathEnabled() ? myConfiguration.getAlternativeJrePath() : null); - - final Project project = module.getProject(); + final Project project = myConfiguration.getProject(); boolean isJUnit4 = false; final ArrayList classNames = new ArrayList(); + final Set modules = new HashSet(); for (String className : data.getPatterns()) { final PsiClass psiClass = JavaExecutionUtil.findMainClass(project, className, GlobalSearchScope.allScope(project)); if (psiClass != null && JUnitUtil.isTestClass(psiClass)) { classNames.add(className); + modules.add(ModuleUtil.findModuleForPsiElement(psiClass)); if (JUnitUtil.isJUnit4TestClass(psiClass)) { isJUnit4 = true; } } } + final String jreHome = myConfiguration.isAlternativeJrePathEnabled() ? myConfiguration.getAlternativeJrePath() : null; + + Module module = myConfiguration.getConfigurationModule().getModule(); + if (module == null && modules.size() == 1 && modules.iterator().next() != null) { + module = modules.iterator().next(); + } + + if (module != null) { + JavaParametersUtil.configureModule(module, myJavaParameters, JavaParameters.JDK_AND_CLASSES_AND_TESTS, jreHome); + } else { + JavaParametersUtil.configureProject(project, myJavaParameters, JavaParameters.JDK_AND_CLASSES_AND_TESTS, jreHome); + } addClassesListToJavaParameters(classNames, new Function.Self(), "", true, isJUnit4); } diff --git a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java index 75c9f6348d6b..1771bab5bfc7 100644 --- a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java +++ b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.java @@ -22,6 +22,7 @@ import com.intellij.execution.junit.JUnitConfiguration; import com.intellij.execution.junit.JUnitConfigurationType; import com.intellij.execution.junit.JUnitUtil; import com.intellij.execution.junit.TestClassFilter; +import com.intellij.execution.testframework.SourceScope; import com.intellij.execution.testframework.TestSearchScope; import com.intellij.execution.ui.AlternativeJREPanel; import com.intellij.execution.ui.ClassBrowser; @@ -36,10 +37,12 @@ import com.intellij.openapi.ui.FixedSizeButton; import com.intellij.openapi.ui.LabeledComponent; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.TextFieldWithBrowseButton; +import com.intellij.openapi.ui.ex.MessagesEx; import com.intellij.openapi.util.IconLoader; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiPackage; +import com.intellij.psi.search.SearchScope; import com.intellij.util.Icons; import gnu.trove.TIntArrayList; import org.jetbrains.annotations.NotNull; @@ -260,8 +263,14 @@ public class JUnitConfigurable extends SettingsEditor { final TIntArrayList enabledFields = ourEnabledFields.get(newType); for (int i = 0; i < myTestLocations.length; i++) getTestLocation(i).setEnabled(enabledFields.contains(i)); - if (newType != JUnitConfigurationModel.ALL_IN_PACKAGE) myModule.setEnabled(true); - else onScopeChanged(); + if (newType == JUnitConfigurationModel.PATTERN) { + myModule.setEnabled(false); + } else if (newType != JUnitConfigurationModel.ALL_IN_PACKAGE) { + myModule.setEnabled(true); + } + else { + onScopeChanged(); + } } private static class PackageChooserActionListener extends BrowseModuleValueActionListener { @@ -287,6 +296,18 @@ public class JUnitConfigurable extends SettingsEditor { textField.setText(text + (text.length() > 0 ? "||" : "") + psiClass.getQualifiedName()); } + @Override + protected ClassFilter.ClassFilterWithScope getFilter() throws NoFilterException { + try { + return TestClassFilter.create(SourceScope.wholeProject(getProject()), null); + } + catch (JUnitUtil.NoJUnitException ignore) { + throw new NoFilterException(new MessagesEx.MessageInfo(getProject(), + ignore.getMessage(), + ExecutionBundle.message("cannot.browse.test.inheritors.dialog.title"))); + } + } + @Override public void actionPerformed(ActionEvent e) { showDialog(); From ff93a1cb3639829430421debd52fe29679ad6493 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 20 Jan 2011 14:23:15 +0100 Subject: [PATCH 16/20] more assertions on completion state --- .../completion/CodeCompletionHandlerBase.java | 2 ++ .../CompletionProgressIndicator.java | 20 +++++++++++-------- .../completion/CompletionState.java | 12 ++++++++--- 3 files changed, 23 insertions(+), 11 deletions(-) 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; } From f0d36a8cbe69e3fbc5ed16b1fea8e8b0930e46c4 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 20 Jan 2011 15:27:34 +0100 Subject: [PATCH 17/20] Collections.emptyList should accept the qualified prefix --- .../completion/JavaMethodCallElement.java | 11 ++++++++++ .../EmptyListWithCollectionsPrefix-out.java | 7 ++++++ .../EmptyListWithCollectionsPrefix.java | 5 +++++ .../completion/SmartTypeCompletionTest.java | 22 ++++++------------- 4 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListWithCollectionsPrefix.java 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(); From a7dcedcc8915b45b5d7b43f02a5f647b9479fb9e Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 20 Jan 2011 19:07:36 +0300 Subject: [PATCH 18/20] endless repaint --- .../openapi/wm/impl/status/EncodingPanel.java | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) 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()); } From e93769d52a967a26755cfd24aef2b609220b843f Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 20 Jan 2011 17:32:12 +0100 Subject: [PATCH 19/20] Another attempt to fix IDEA-26242 (Idea analyzes certain files in our project for a very long time, using tons of memory in the process.) --- .../DeclareCollectionAsInterfaceInspection.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/DeclareCollectionAsInterfaceInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/DeclareCollectionAsInterfaceInspection.java index a69011546188..e4f5ce18ca3b 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/DeclareCollectionAsInterfaceInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/DeclareCollectionAsInterfaceInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Dave Griffith, Bas Leijdekkers + * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -155,8 +155,7 @@ public class DeclareCollectionAsInterfaceInspection extends BaseInspection { extends BaseInspectionVisitor { @Override public void visitVariable(@NotNull PsiVariable variable) { - if (isOnTheFly() && - variable.hasModifierProperty(PsiModifier.PUBLIC)) { + if (isOnTheFly() && !isCheapEnoughToSearch(variable)) { return; } if (ignoreLocalVariables && variable instanceof PsiLocalVariable) { @@ -234,8 +233,7 @@ public class DeclareCollectionAsInterfaceInspection extends BaseInspection { method.hasModifierProperty(PsiModifier.PRIVATE)) { return; } - if (isOnTheFly() && - method.hasModifierProperty(PsiModifier.PUBLIC)) { + if (isOnTheFly() && !isCheapEnoughToSearch(method)) { return; } final PsiType type = method.getReturnType(); From f5b41df13d3147a87ce6437a7725cb2179face8b Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 20 Jan 2011 17:52:13 +0100 Subject: [PATCH 20/20] Test fix for Linux --- ...pplicationNameCompletion.xml => ApplicationNameCompletion.xml} | 0 ...meCompletion_after.xml => ApplicationNameCompletion_after.xml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename plugins/android/testData/dom/manifest/{applicationNameCompletion.xml => ApplicationNameCompletion.xml} (100%) rename plugins/android/testData/dom/manifest/{applicationNameCompletion_after.xml => ApplicationNameCompletion_after.xml} (100%) diff --git a/plugins/android/testData/dom/manifest/applicationNameCompletion.xml b/plugins/android/testData/dom/manifest/ApplicationNameCompletion.xml similarity index 100% rename from plugins/android/testData/dom/manifest/applicationNameCompletion.xml rename to plugins/android/testData/dom/manifest/ApplicationNameCompletion.xml diff --git a/plugins/android/testData/dom/manifest/applicationNameCompletion_after.xml b/plugins/android/testData/dom/manifest/ApplicationNameCompletion_after.xml similarity index 100% rename from plugins/android/testData/dom/manifest/applicationNameCompletion_after.xml rename to plugins/android/testData/dom/manifest/ApplicationNameCompletion_after.xml