Fix for bug 382684 (connection re-use)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / handlers / RefreshHandler.java
index fbb9451085f946efbf38be0fb0dd2b58eb99f974..43eb113170927f7127cc8a3990074ee46d45432a 100644 (file)
@@ -1,12 +1,12 @@
 /**********************************************************************
  * Copyright (c) 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
+ *
+ * Contributors:
  *   Bernd Hufmann - Initial API and implementation
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
@@ -24,10 +24,11 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceC
 import org.eclipse.ui.IWorkbenchPage;
 
 /**
- * <b><u>RefreshHandler</u></b>
  * <p>
  * Command handler implementation to refresh node configuration.
  * </p>
+ *
+ * @author Bernd Hufmann
  */
 public class RefreshHandler extends BaseControlViewHandler {
 
@@ -38,7 +39,7 @@ public class RefreshHandler extends BaseControlViewHandler {
      * The node component reference.
      */
     private TargetNodeComponent fNode;
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -75,10 +76,10 @@ public class RefreshHandler extends BaseControlViewHandler {
         // Check if one or more session are selected
         ISelection selection = page.getSelection(ControlView.ID);
         if (selection instanceof StructuredSelection) {
-            
+
             StructuredSelection structered = ((StructuredSelection) selection);
             for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
-                Object element = (Object) iterator.next();
+                Object element = iterator.next();
                 if (element instanceof TraceControlComponent) {
                     TraceControlComponent component = (TraceControlComponent) element;
                     boolean isConnected = component.getTargetNodeState() == TargetNodeState.CONNECTED;
@@ -93,9 +94,9 @@ public class RefreshHandler extends BaseControlViewHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = node != null;
-        
+
         fLock.lock();
         try {
             fNode = null;
@@ -105,7 +106,7 @@ public class RefreshHandler extends BaseControlViewHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
 }
This page took 0.024201 seconds and 5 git commands to generate.