changeset 6106:d8cb3b571560

6470730: Disconnect button leads to wrong popup message Reviewed-by: mchung, dcubed, sla, egahlin
author nloodin
date Tue, 28 May 2013 14:39:48 +0200
parents 05e7d9925f3e
children d91e77f0de85
files src/share/classes/sun/tools/jconsole/VMPanel.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/tools/jconsole/VMPanel.java	Fri May 24 16:50:36 2013 +0100
+++ b/src/share/classes/sun/tools/jconsole/VMPanel.java	Tue May 28 14:39:48 2013 +0200
@@ -55,6 +55,7 @@
     private VMInternalFrame vmIF = null;
     private static ArrayList<TabInfo> tabInfos = new ArrayList<TabInfo>();
     private boolean wasConnected = false;
+    private boolean userDisconnected = false;
 
     // The everConnected flag keeps track of whether the window can be
     // closed if the user clicks Cancel after a failed connection attempt.
@@ -125,6 +126,7 @@
                 if (connectedIconBounds != null && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && connectedIconBounds.contains(e.getPoint())) {
 
                     if (isConnected()) {
+                        userDisconnected = true;
                         disconnect();
                         wasConnected = false;
                     } else {
@@ -452,6 +454,11 @@
     private void vmPanelDied() {
         disconnect();
 
+        if (userDisconnected) {
+            userDisconnected = false;
+            return;
+        }
+
         JOptionPane optionPane;
         String msgTitle, msgExplanation, buttonStr;