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 / AddContextOnEventHandler.java
index ffea402da93f347526384cbbbf444ecb63b858f6..63a38398f8705700a49e9d91278fd3737e75945a 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;
@@ -28,7 +28,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to add contexts to a given event.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class AddContextOnEventHandler extends BaseAddContextHandler {
@@ -36,7 +36,7 @@ public class AddContextOnEventHandler extends BaseAddContextHandler {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -70,10 +70,10 @@ public class AddContextOnEventHandler extends BaseAddContextHandler {
         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 TraceEventComponent) {
                     // Add only if corresponding TraceSessionComponents is inactive and not destroyed
-                    TraceEventComponent tmpEvent = (TraceEventComponent) element; 
+                    TraceEventComponent tmpEvent = (TraceEventComponent) element;
                     session = tmpEvent.getSession();
                     if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) {
                         event = tmpEvent;
@@ -81,7 +81,7 @@ public class AddContextOnEventHandler extends BaseAddContextHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (event != null);
         fLock.lock();
         try {
This page took 0.024544 seconds and 5 git commands to generate.