diff --git a/.idea/libraries/pty4j.xml b/.idea/libraries/pty4j.xml index 6431fb7438c6..41ce767cdbf6 100644 --- a/.idea/libraries/pty4j.xml +++ b/.idea/libraries/pty4j.xml @@ -1,11 +1,11 @@ - + - + diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java index a35f008e6f31..96e837559c38 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java @@ -148,10 +148,6 @@ public class VariablesPanel extends DebuggerTreePanel implements DataProvider { } } - @Override - protected void clear() { - } - @Override public void processSessionEvent(@NotNull SessionEvent event) { } diff --git a/lib/libpty/win/win10_x86/libwinpty.dll b/lib/libpty/win/win10_x86/libwinpty.dll deleted file mode 100644 index e1644b8ee80d..000000000000 Binary files a/lib/libpty/win/win10_x86/libwinpty.dll and /dev/null differ diff --git a/lib/libpty/win/win10_x86/winpty-agent.exe b/lib/libpty/win/win10_x86/winpty-agent.exe deleted file mode 100644 index c818ddf39149..000000000000 Binary files a/lib/libpty/win/win10_x86/winpty-agent.exe and /dev/null differ diff --git a/lib/libpty/win/win10_x86_64/cyglaunch.exe b/lib/libpty/win/win10_x86_64/cyglaunch.exe deleted file mode 100644 index 8e8a1c843e15..000000000000 Binary files a/lib/libpty/win/win10_x86_64/cyglaunch.exe and /dev/null differ diff --git a/lib/libpty/win/win10_x86_64/libwinpty.dll b/lib/libpty/win/win10_x86_64/libwinpty.dll deleted file mode 100644 index ada906c40611..000000000000 Binary files a/lib/libpty/win/win10_x86_64/libwinpty.dll and /dev/null differ diff --git a/lib/libpty/win/win10_x86_64/winpty-agent.exe b/lib/libpty/win/win10_x86_64/winpty-agent.exe deleted file mode 100644 index 3f0fa6dc9250..000000000000 Binary files a/lib/libpty/win/win10_x86_64/winpty-agent.exe and /dev/null differ diff --git a/lib/libpty/win/x86/libwinpty.dll b/lib/libpty/win/x86/libwinpty.dll old mode 100755 new mode 100644 index ac067161d3f1..e1644b8ee80d Binary files a/lib/libpty/win/x86/libwinpty.dll and b/lib/libpty/win/x86/libwinpty.dll differ diff --git a/lib/libpty/win/x86/winpty-agent.exe b/lib/libpty/win/x86/winpty-agent.exe old mode 100755 new mode 100644 index 52238a735b14..c818ddf39149 Binary files a/lib/libpty/win/x86/winpty-agent.exe and b/lib/libpty/win/x86/winpty-agent.exe differ diff --git a/lib/libpty/win/x86_64/cyglaunch.exe b/lib/libpty/win/x86_64/cyglaunch.exe old mode 100755 new mode 100644 diff --git a/lib/libpty/win/x86_64/libwinpty.dll b/lib/libpty/win/x86_64/libwinpty.dll old mode 100755 new mode 100644 index 903171cb3964..ada906c40611 Binary files a/lib/libpty/win/x86_64/libwinpty.dll and b/lib/libpty/win/x86_64/libwinpty.dll differ diff --git a/lib/libpty/win/x86_64/winpty-agent.exe b/lib/libpty/win/x86_64/winpty-agent.exe old mode 100755 new mode 100644 index 94e65bc26e0f..3f0fa6dc9250 Binary files a/lib/libpty/win/x86_64/winpty-agent.exe and b/lib/libpty/win/x86_64/winpty-agent.exe differ diff --git a/lib/pty4j-0.4.21.jar b/lib/pty4j-0.4.21.jar deleted file mode 100644 index 0547b1ba6610..000000000000 Binary files a/lib/pty4j-0.4.21.jar and /dev/null differ diff --git a/lib/pty4j-0.4.22.jar b/lib/pty4j-0.4.22.jar new file mode 100644 index 000000000000..1c3cbc5efe71 Binary files /dev/null and b/lib/pty4j-0.4.22.jar differ diff --git a/lib/required_for_dist.txt b/lib/required_for_dist.txt index a88f708114dd..d76b0574dd4d 100644 --- a/lib/required_for_dist.txt +++ b/lib/required_for_dist.txt @@ -55,7 +55,7 @@ oromatcher.jar picocontainer.jar protobuf-2.5.0.jar proxy-vole_20131209.jar -pty4j-0.4.21.jar +pty4j-0.4.22.jar purejavacomm.jar resolver.jar rhino-js-1_7R4.jar diff --git a/lib/src/pty4j-0.4.21-src.jar b/lib/src/pty4j-0.4.22-src.jar similarity index 83% rename from lib/src/pty4j-0.4.21-src.jar rename to lib/src/pty4j-0.4.22-src.jar index 53c0ff9441d7..a025cbc13890 100644 Binary files a/lib/src/pty4j-0.4.21-src.jar and b/lib/src/pty4j-0.4.22-src.jar differ diff --git a/platform/core-api/src/com/intellij/openapi/application/WriteAction.java b/platform/core-api/src/com/intellij/openapi/application/WriteAction.java index e2e70b0b0a85..f544448f6f67 100644 --- a/platform/core-api/src/com/intellij/openapi/application/WriteAction.java +++ b/platform/core-api/src/com/intellij/openapi/application/WriteAction.java @@ -45,22 +45,13 @@ public abstract class WriteAction extends BaseActionRunnable { application.runWriteAction(new Runnable() { @Override public void run() { - try { - result.run(); - } - catch (RuntimeException e) { - result.setThrowable(e); - } + result.run(); } }); } }, ModalityState.defaultModalityState()); - final Throwable throwable = result.getThrowable(); - if (throwable != null && !isSilentExecution()) { - throw (RuntimeException)throwable; - } - + result.throwException(); return result; } diff --git a/platform/platform-impl/src/com/intellij/internal/DebugAttachDetector.java b/platform/platform-impl/src/com/intellij/internal/DebugAttachDetector.java index 97e541921945..fa26c56b806b 100644 --- a/platform/platform-impl/src/com/intellij/internal/DebugAttachDetector.java +++ b/platform/platform-impl/src/com/intellij/internal/DebugAttachDetector.java @@ -15,15 +15,16 @@ */ package com.intellij.internal; -import com.intellij.notification.*; +import com.intellij.notification.Notification; +import com.intellij.notification.NotificationType; +import com.intellij.notification.Notifications; import com.intellij.openapi.application.ex.ApplicationManagerEx; import com.intellij.openapi.diagnostic.Logger; import com.intellij.util.Alarm; import com.intellij.util.SingleAlarm; +import com.intellij.util.net.NetUtils; -import java.io.IOException; import java.lang.management.ManagementFactory; -import java.net.Socket; /** * @author egor @@ -31,7 +32,7 @@ import java.net.Socket; public class DebugAttachDetector { private static final Logger LOG = Logger.getInstance(DebugAttachDetector.class); - private String myHost; + private String myHost = null; private int myPort = -1; private SingleAlarm myAlarm; private boolean myAttached; @@ -48,7 +49,6 @@ public class DebugAttachDetector { try { String[] address = param.split("=")[1].split(":"); if (address.length == 1) { - myHost = "127.0.0.1"; myPort = Integer.parseInt(address[0]); } else { @@ -72,7 +72,7 @@ public class DebugAttachDetector { myAlarm = new SingleAlarm(new Runnable() { @Override public void run() { - boolean attached = checkAttached(); + boolean attached = !NetUtils.canConnectToRemoteSocket(myHost, myPort); if (!myReady) { myAttached = attached; myReady = true; @@ -89,15 +89,4 @@ public class DebugAttachDetector { }, 5000, Alarm.ThreadToUse.POOLED_THREAD, null); myAlarm.request(); } - - private boolean checkAttached() { - try { - Socket socket = new Socket(myHost, myPort); - socket.close(); - return false; - } - catch (IOException e) { - return true; - } - } } diff --git a/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressDialog.java b/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressDialog.java index ac3cd0066991..3acd43910217 100644 --- a/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressDialog.java @@ -190,10 +190,8 @@ class ProgressDialog implements Disposable { public void dispose() { UIUtil.disposeProgress(myProgressBar); UIUtil.dispose(myTitlePanel); - final ActionListener[] listeners = myCancelButton.getActionListeners(); - for (ActionListener listener : listeners) { - myCancelButton.removeActionListener(listener); - } + UIUtil.dispose(myBackgroundButton); + UIUtil.dispose(myCancelButton); } JPanel getPanel() { diff --git a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java index 465b24e30a75..ddad7ecc36f6 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java +++ b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java @@ -139,12 +139,12 @@ public class SwingHelper { } public static void setPreferredWidthToFitText(@NotNull TextFieldWithHistoryWithBrowseButton component) { - int childWidth = calcWidthToFitText(component.getChildComponent().getTextEditor(), 35); + int childWidth = calcWidthToFitText(component.getChildComponent().getTextEditor(), JBUI.scale(32)); setPreferredWidthForComponentWithBrowseButton(component, childWidth); } public static void setPreferredWidthToFitText(@NotNull TextFieldWithBrowseButton component) { - int childWidth = calcWidthToFitText(component.getChildComponent(), 20); + int childWidth = calcWidthToFitText(component.getChildComponent(), JBUI.scale(20)); setPreferredWidthForComponentWithBrowseButton(component, childWidth); } @@ -155,7 +155,7 @@ public class SwingHelper { } public static void setPreferredWidthToFitText(@NotNull JTextField textField) { - setPreferredWidthToFitText(textField, 15); + setPreferredWidthToFitText(textField, JBUI.scale(15)); } public static void setPreferredWidthToFitText(@NotNull JTextField textField, int additionalWidth) { @@ -163,7 +163,7 @@ public class SwingHelper { } public static void setPreferredWidthToFitText(@NotNull JTextField textField, @NotNull String text) { - setPreferredSizeToFitText(textField, text, 15); + setPreferredSizeToFitText(textField, text, JBUI.scale(15)); } private static void setPreferredSizeToFitText(@NotNull JTextField textField, @NotNull String text, int additionalWidth) { diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 6a230522f78e..6555ca82a7ab 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -2054,6 +2054,13 @@ public class UIUtil { for (MouseWheelListener each : mouseWheelListeners) { c.removeMouseWheelListener(each); } + + if (c instanceof AbstractButton) { + final ActionListener[] listeners = ((AbstractButton)c).getActionListeners(); + for (ActionListener listener : listeners) { + ((AbstractButton)c).removeActionListener(listener); + } + } } public static void disposeProgress(final JProgressBar progress) { @@ -2563,7 +2570,7 @@ public class UIUtil { * @param parent parent component * @return true if parent if a top parent of child, false otherwise * - * @see javax.swing.SwingUtilities#isDescendingFrom(java.awt.Component, java.awt.Component) + * @see SwingUtilities#isDescendingFrom(Component, Component) */ public static boolean isDescendingFrom(@Nullable Component child, @NotNull Component parent) { while (child != null && child != parent) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XStandaloneVariablesView.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XStandaloneVariablesView.java index f91146426878..1cf2283c240a 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XStandaloneVariablesView.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XStandaloneVariablesView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -46,8 +46,4 @@ public class XStandaloneVariablesView extends XVariablesViewBase { @Override public void processSessionEvent(@NotNull SessionEvent event) { } - - @Override - protected void clear() { - } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java index 2f8bdb668e9c..464951acf272 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java @@ -103,6 +103,7 @@ public class XVariablesView extends XVariablesViewBase { node = createInfoMessage(tree, debugProcess.getCurrentStateMessage(), debugProcess.getCurrentStateHyperlinkListener()); } tree.setRoot(node, true); + super.clear(); } public static class InlineVariablesInfo { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesViewBase.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesViewBase.java index 7b5fba1ad192..2d3116192cdc 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesViewBase.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesViewBase.java @@ -112,6 +112,11 @@ public abstract class XVariablesViewBase extends XDebugView { } } + @Override + protected void clear() { + removeSelectionListener(); + } + private void disposeTreeRestorer() { if (myTreeRestorer != null) { myTreeRestorer.dispose(); diff --git a/plugins/devkit/src/dom/Group.java b/plugins/devkit/src/dom/Group.java index 5cf7a5430f40..1f2489b3e1e5 100644 --- a/plugins/devkit/src/dom/Group.java +++ b/plugins/devkit/src/dom/Group.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ public interface Group extends Actions { * @return the value of the class child. */ @NotNull - @com.intellij.util.xml.Attribute ("class") + @Attribute ("class") @ExtendClass(value = "com.intellij.openapi.actionSystem.ActionGroup", instantiatable = true, allowAbstract = false, allowInterface = false) @Convert(PluginPsiClassConverter.class) @@ -103,19 +103,6 @@ public interface Group extends Actions { //@NotNull //GenericAttributeValue getOverrides(); - /** - * Returns the list of reference children. - * @return the list of reference children. - */ - @NotNull - List getReferences(); - /** - * Adds new child to the list of reference children. - * @return created child - */ - Reference addReference(); - - /** * Returns the value of the separator child. * @return the value of the separator child. @@ -124,19 +111,6 @@ public interface Group extends Actions { List> getSeparators(); - /** - * Returns the list of action children. - * @return the list of action children. - */ - @NotNull - List getActions(); - /** - * Adds new child to the list of action children. - * @return created child - */ - Action addAction(); - - /** * Returns the list of add-to-group children. * @return the list of add-to-group children. diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyClass.java b/python/psi-api/src/com/jetbrains/python/psi/PyClass.java index bc89a0de1ef7..59505738f1ec 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/PyClass.java +++ b/python/psi-api/src/com/jetbrains/python/psi/PyClass.java @@ -160,15 +160,28 @@ public interface PyClass extends PsiNameIdentifierOwner, PyStatement, NameDefine */ boolean visitMethods(Processor processor, boolean inherited); - boolean visitClassAttributes(Processor processor, boolean inherited); + boolean visitClassAttributes(Processor processor, boolean inherited, TypeEvalContext context); /** * Effectively collects assignments inside the class body. *

* This method does not access AST if underlying PSI is stub based. + * Note that only own attrs are fetched, not parent attrs. + * If you need parent attributes, consider using {@link #getClassAttributesInherited(TypeEvalContext)} + * @see #getClassAttributesInherited(TypeEvalContext) */ List getClassAttributes(); + + /** + * Returns all class attributes this class class contains, including inherited one. + * Process may be heavy, depending or your context. + * @param context context to use for this process + * @return list of attrs. + */ + @NotNull + List getClassAttributesInherited(@NotNull TypeEvalContext context); + @Nullable PyTargetExpression findClassAttribute(@NotNull String name, boolean inherited); diff --git a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java index 3ac39612cc39..0ff40fc7f636 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java @@ -955,12 +955,13 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla return true; } - public boolean visitClassAttributes(Processor processor, boolean inherited) { + public boolean visitClassAttributes(Processor processor, boolean inherited, @Nullable final TypeEvalContext context) { List methods = getClassAttributes(); if (!ContainerUtil.process(methods, processor)) return false; if (inherited) { - for (PyClass ancestor : getAncestorClasses(null)) { - if (!ancestor.visitClassAttributes(processor, false)) { + for (PyClass ancestor : getAncestorClasses(context)) { + // TODO: Why there is FALSE here? We support only one level of inheritance? + if (!ancestor.visitClassAttributes(processor, false, context)) { return false; } } @@ -969,6 +970,14 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla // NOTE: sorry, not enough metaprogramming to generalize visitMethods and visitClassAttributes } + @NotNull + @Override + public final List getClassAttributesInherited(@NotNull final TypeEvalContext context) { + final MyAttributesCollector attributesCollector = new MyAttributesCollector(); + visitClassAttributes(attributesCollector, true, context); + return attributesCollector.getAttributes(); + } + public List getClassAttributes() { PyClassStub stub = getStub(); if (stub != null) { @@ -993,7 +1002,7 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla @Override public PyTargetExpression findClassAttribute(@NotNull String name, boolean inherited) { final NameFinder processor = new NameFinder(name); - visitClassAttributes(processor, inherited); + visitClassAttributes(processor, inherited, null); return processor.getResult(); } @@ -1525,4 +1534,17 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla public PyClassLikeType getType(@NotNull TypeEvalContext context) { return PyUtil.as(context.getType(this), PyClassLikeType.class); } + + private static final class MyAttributesCollector implements Processor { + private final List myAttributes = new ArrayList(); + @Override + public boolean process(final PyTargetExpression expression) { + myAttributes.add(expression); + return true; + } + @NotNull + List getAttributes() { + return Collections.unmodifiableList(myAttributes); + } + } }