lttng: Fix most compiler warnings as per the new settings
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 16 Jul 2012 18:46:14 +0000 (14:46 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 24 Jul 2012 15:34:26 +0000 (11:34 -0400)
Change-Id: I056b02cd61daa38e8d19f2e36a49f3015bc08263
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/6864
Reviewed-by: Bernd Hufmann <bhufmann@gmail.com>
28 files changed:
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/ActivatorTest.java
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/DomainInfoTest.java
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/SessionInfoTest.java
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/UstProviderInfoTest.java
org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java
org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/ActivatorTest.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlComponentTest.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/GetEventInfoDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/AssignEventHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseAddContextHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/ChangeEventStateHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/NewConnectionHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/BaseEventComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/KernelProviderComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceChannelComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceControlComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceDomainComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceEventComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceProbeEventComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceSessionComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/UstProviderComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java

index bd6c1f2effcb3609e24df94c5b805a3cb1d4abfa..1d87f386d7690513dba4e19d73e8c58074996b0f 100644 (file)
@@ -33,18 +33,12 @@ public class ActivatorTest extends TestCase {
     // JUnit
     // ------------------------------------------------------------------------
 
-    /**
-     * @throws java.lang.Exception
-     */
     @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
+    public static void setUpBeforeClass() {
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @AfterClass
-    public static void tearDownAfterClass() throws Exception {
+    public static void tearDownAfterClass() {
     }
 
     /**
index 4e9597e8ef223ef96fffd82c7e6892a9bd7dd97a..2c0d7c0aaf71f39eecfe1233240460ffdd7adba3 100644 (file)
@@ -305,7 +305,7 @@ public class ChannelInfoTest extends TestCase {
         assertTrue("equals", channel1.equals(channel3));
     }
 
-    public void testEqualsNull() throws Exception {
+    public void testEqualsNull() {
         assertTrue("equals", !fChannelInfo1.equals(null));
         assertTrue("equals", !fChannelInfo2.equals(null));
     }
index 012c786eb6bb86992eaafc7e620146d1992deaa2..9f213b87f2622472104faf74679759b5aa2d5412 100644 (file)
@@ -181,7 +181,7 @@ public class DomainInfoTest extends TestCase {
         assertTrue("equals", channel1.equals(channel3));
     }
 
-    public void testEqualsNull() throws Exception {
+    public void testEqualsNull() {
         assertTrue("equals", !fDomainInfo1.equals(null));
         assertTrue("equals", !fDomainInfo2.equals(null));
     }
index 69f937ef71145071acec4305a3f8577fe7297e33..bfa65991055e26f452ce5219790209860ec4a3e5 100644 (file)
@@ -234,7 +234,7 @@ public class SessionInfoTest extends TestCase {
         assertTrue("equals", channel1.equals(channel3));
     }
 
-    public void testEqualsNull() throws Exception {
+    public void testEqualsNull() {
         assertTrue("equals", !fSessionInfo1.equals(null));
         assertTrue("equals", !fSessionInfo2.equals(null));
     }
index ada9f1ceac0935b8b8018aa66bc85887c1c04482..9cec2bf8a27285cee390d49e38f4dcf303f487a9 100644 (file)
@@ -207,7 +207,7 @@ public class UstProviderInfoTest extends TestCase {
         assertTrue("equals", UstProvider1.equals(UstProvider3));
     }
 
-    public void testEqualsNull() throws Exception {
+    public void testEqualsNull() {
         assertTrue("equals", !fUstProviderInfo1.equals(null));
         assertTrue("equals", !fUstProviderInfo2.equals(null));
     }
index 89da0ab2edaa141e73256b8ac66dc9b1e6d113fe..e1af96c5f6cf6ca7743530284df9a4092e3efe46 100644 (file)
@@ -33,18 +33,12 @@ public class ActivatorTest extends TestCase {
     // JUnit
     // ------------------------------------------------------------------------
 
-    /**
-     * @throws java.lang.Exception
-     */
     @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
+    public static void setUpBeforeClass() {
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @AfterClass
-    public static void tearDownAfterClass() throws Exception {
+    public static void tearDownAfterClass() {
     }
 
     /**
index 6f9a0866d8eed39c960c8a2a77192d965878439a..295f0e180af32dc57ffd103b6700eff294fc0840 100644 (file)
@@ -33,18 +33,12 @@ public class ActivatorTest extends TestCase {
     // JUnit
     // ------------------------------------------------------------------------
 
-    /**
-     * @throws java.lang.Exception
-     */
     @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
+    public static void setUpBeforeClass() {
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @AfterClass
-    public static void tearDownAfterClass() throws Exception {
+    public static void tearDownAfterClass() {
     }
 
     /**
index fe9cb3f4c6736fdb9254eea479c5da549d8a7f20..03d2c4f94dfd5f9ac7b8c7f1dbcb542e5fc2cc05 100644 (file)
@@ -105,7 +105,7 @@ public class ControlFlowView extends TmfView {
     /**\r
      * Redraw state enum\r
      */\r
-    private enum State { IDLE, BUSY, PENDING };\r
+    private enum State { IDLE, BUSY, PENDING }\r
 \r
     // ------------------------------------------------------------------------\r
     // Fields\r
index b17f5c066fa7da43816f936f1c67d19ca2f76971..4dca24190cd3a45aff584771417d58aaa2bf1fac 100644 (file)
@@ -79,7 +79,7 @@ public class ResourcesView extends TmfView {
     /**\r
      * Redraw state enum\r
      */\r
-    private enum State { IDLE, BUSY, PENDING };\r
+    private enum State { IDLE, BUSY, PENDING }\r
 \r
     // ------------------------------------------------------------------------\r
     // Fields\r
index a43bcf679efa78df271c9c016e67bf5cf7874637..058fc71f9f2523fa2bde2bf315f2d37f7cd45b3d 100644 (file)
@@ -33,18 +33,12 @@ public class ActivatorTest extends TestCase {
     // JUnit
     // ------------------------------------------------------------------------
 
-    /**
-     * @throws java.lang.Exception
-     */
     @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
+    public static void setUpBeforeClass() {
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @AfterClass
-    public static void tearDownAfterClass() throws Exception {
+    public static void tearDownAfterClass() {
     }
 
     /**
index bf453acb14fa00bf421b81ab59f327f4847b5d3f..d25c80baa8673a9a4c9fb7e98f26ec7be43c325c 100644 (file)
@@ -18,6 +18,7 @@ import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
 import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
@@ -37,7 +38,7 @@ import org.junit.Before;
  * The class <code>TraceControlComponentTest</code> contains tests for the class <code>{@link TraceControlComponent}</code>.
  *
  */
-@SuppressWarnings({"nls", "javadoc"})
+@SuppressWarnings("nls")
 public class TraceControlComponentTest extends TestCase {
 
     // ------------------------------------------------------------------------
@@ -87,8 +88,7 @@ public class TraceControlComponentTest extends TestCase {
     /**
      * Run the TraceControlComponent(String) constructor test.
      */
-    public void testTraceControlComponent_1()
-        throws Exception {
+    public void testTraceControlComponent_1() {
 
         String name = "node";
 
@@ -105,10 +105,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the TraceControlComponent(String,ITraceControlComponent) constructor test.
-     *
      */
-    public void testTraceControlComponent_2()
-        throws Exception {
+    public void testTraceControlComponent_2() {
         String name = "node";
 
         ITraceControlComponent parent = new TraceControlRoot();
@@ -124,12 +122,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void addChild(ITraceControlComponent) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testAddAndGetChild1()
-        throws Exception {
+    public void testAddAndGetChild1() {
         TraceControlComponent fixture = new TraceControlComponent("node", new TraceControlRoot());
         fixture.setToolTip("This is the test node");
         fixture.addChild(new TraceControlRoot());
@@ -143,12 +137,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void addChild(ITraceControlComponent) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testAddAndGetChild2()
-        throws Exception {
+    public void testAddAndGetChild2() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         ITraceControlComponent component = null;
@@ -159,13 +149,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void addComponentListener(ITraceControlComponentChangedListener) method test.
-     *
-     * @throws Exception
-     *
      */
-
-    public void testAddComponentListener_1()
-        throws Exception {
+    public void testAddComponentListener_1() {
         TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null);
         fixture.setToolTip("");
 
@@ -185,12 +170,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the boolean containsChild(String) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testContainsChild_1()
-        throws Exception {
+    public void testContainsChild_1() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -203,12 +184,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the boolean containsChild(String) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testContainsChild_2()
-        throws Exception {
+    public void testContainsChild_2() {
         TraceControlComponent fixture = new TraceControlComponent("name", new TraceControlRoot());
         fixture.setToolTip("");
 
@@ -221,13 +198,8 @@ public class TraceControlComponentTest extends TestCase {
      * Run the void fireCompenentAdded(ITraceControlComponent,ITraceControlComponent) method test.
      * Run the void fireCompenentRemoved(ITraceControlComponent,ITraceControlComponent) method test.
      * Run the void fireCompenentChanged(ITraceControlComponent) method test
-     *
-     * @throws Exception
-     *
      */
-
-    public void testFireCompenentUpdated()
-        throws Exception {
+    public void testFireCompenentUpdated() {
         ITraceControlComponent parent = new TraceControlRoot();
 
         TraceControlComponent fixture = new TraceControlComponent("node", parent);
@@ -259,13 +231,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the Object getAdapter(Class) method test.
-     *
-     * @throws Exception
-     *
      */
-
-    public void testGetAdapter()
-        throws Exception {
+    public void testGetAdapter() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -278,12 +245,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the ITraceControlComponent[] getChildren() method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testGetChildren_1()
-        throws Exception {
+    public void testGetChildren_1() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -302,13 +265,13 @@ public class TraceControlComponentTest extends TestCase {
     }
 
     /**
-     * Run the ILttngControlService getControlService()/setControlService() method test.
-     *
-     * @throws Exception
+     * Run the ILttngControlService getControlService()/setControlService()
+     * method test.
      *
+     * @throws ExecutionException
+     *             Would fail the test
      */
-    public void testGetAndSetControlService_1()
-        throws Exception {
+    public void testGetAndSetControlService_1() throws ExecutionException {
 
         TraceControlComponent parent = new TraceControlComponent("parent") {
             ILttngControlService fService = null;
@@ -347,12 +310,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the Image getImage() method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testGetImage_1()
-        throws Exception {
+    public void testGetImage_1() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -366,12 +325,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the boolean hasChildren() method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testHasChildren_1()
-        throws Exception {
+    public void testHasChildren_1() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -383,12 +338,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the boolean hasChildren() method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testHasChildren_2()
-        throws Exception {
+    public void testHasChildren_2() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
 
@@ -399,12 +350,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void removeAllChildren() method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testRemoveAllChildren_2()
-        throws Exception {
+    public void testRemoveAllChildren_2() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
 
@@ -417,12 +364,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void removeChild(ITraceControlComponent) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testRemoveChild_1()
-        throws Exception {
+    public void testRemoveChild_1() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         TraceControlComponent child = new TraceControlComponent("child", fixture);
@@ -434,13 +377,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void removeChild(ITraceControlComponent) method test.
-     *
-     * @throws Exception
-     *
      */
-
-    public void testRemoveChild_2()
-        throws Exception {
+    public void testRemoveChild_2() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -452,12 +390,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void removeComponentListener(ITraceControlComponentChangedListener) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testRemoveComponentListener_1()
-        throws Exception {
+    public void testRemoveComponentListener_1() {
         TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null);
         fixture.setToolTip("");
 
@@ -480,12 +414,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void removeComponentListener(ITraceControlComponentChangedListener) method test.
-     *
-     * @throws Exception
-     *
      */
-    public void testRemoveComponentListener_2()
-        throws Exception {
+    public void testRemoveComponentListener_2() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -497,13 +427,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void setChildren(List<ITraceControlComponent>)/ITraceControlComponent[] getChildren() method test.
-     *
-     *
-     * @throws Exception
-     *
      */
-    public void testGetAndSetChildren()
-        throws Exception {
+    public void testGetAndSetChildren() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         List<ITraceControlComponent> children = new LinkedList<ITraceControlComponent>();
@@ -520,12 +445,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void String getName()/setName(String) method tests.
-     *
-     * @throws Exception
-     *
      */
-    public void testGetAndSetName()
-        throws Exception {
+    public void testGetAndSetName() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -538,12 +459,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void ITraceControlComponent getParent()/setParent(ITraceControlComponent) method tests.
-     *
-     * @throws Exception
-     *
      */
-    public void testGetAndSetParent()
-        throws Exception {
+    public void testGetAndSetParent() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         fixture.addChild(new TraceControlRoot());
@@ -561,13 +478,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void TargetNodeState getTargetNodeState()/etTargetNodeState(TargetNodeState) method tests.
-     *
-     * @throws Exception
-     *
      */
-    public void testGetAndSetTargetNodeState_1()
-        throws Exception {
-
+    public void testGetAndSetTargetNodeState_1() {
         TraceControlComponent parent = new TraceControlComponent("parent") {
             private TargetNodeState fState;
 
@@ -626,14 +538,8 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void setToolTip(String) method test.
-     *
-     * @throws Exception
-     *
-
      */
-
-    public void testGetSndSetToolTip()
-        throws Exception {
+    public void testGetSndSetToolTip() {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("This is a tooltip");
         fixture.addChild(new TraceControlRoot());
index eb3e8677c551797dc5436eb6489cae2a7707acdd..9410c2d596880345a3edbd3a0a0869ad29edbb3a 100644 (file)
@@ -221,11 +221,11 @@ public class GetEventInfoDialog extends Dialog implements IGetEventInfoDialog {
 
                     if (domain != null) {
                         fChannels = domain.getChannels();
-                        String items[] = new String[fChannels.length];
-                        for (int i = 0; i < items.length; i++) {
-                            items[i] = String.valueOf(fChannels[i].getName());
+                        String selectionItems[] = new String[fChannels.length];
+                        for (int i = 0; i < selectionItems.length; i++) {
+                            selectionItems[i] = String.valueOf(fChannels[i].getName());
                         }
-                        fChannelsCombo.setItems(items);
+                        fChannelsCombo.setItems(selectionItems);
                         fChannelsCombo.setEnabled(fChannels.length > 0);
                     } else { 
                         fChannelsCombo.setItems(new String[0]);
index eea654058a6f2d97be250463bb8322d9cb0facae..027f9c773fba3d56a141b1d2e542f3c17fd9227f 100644 (file)
@@ -93,8 +93,8 @@ public class AssignEventHandler extends BaseControlViewHandler {
                         List<BaseEventComponent> events = param.getEvents();
                         // Create list of event names
                         for (Iterator<BaseEventComponent> iterator = events.iterator(); iterator.hasNext();) {
-                            BaseEventComponent event = iterator.next();
-                            eventNames.add(event.getName());
+                            BaseEventComponent baseEvent = iterator.next();
+                            eventNames.add(baseEvent.getName());
                         }
 
                         TraceChannelComponent channel = dialog.getChannel();
index 155aadb81bef1f470b440cce3e4b7c6ef064fe77..04633e118c387a8638e807b3c03d3c11e65433a8 100644 (file)
@@ -95,12 +95,12 @@ abstract public class BaseAddContextHandler extends BaseControlViewHandler {
 
                         Job addJob = new Job(Messages.TraceControl_AddContextJob) {
                             @Override
-                            protected IStatus run(IProgressMonitor monitor) {
+                            protected IStatus run(IProgressMonitor monitor2) {
                                 Exception error = null;
 
                                 try {
                                     List<String> contextNames = dialog.getContexts();
-                                    addContexts(param, contextNames, monitor);
+                                    addContexts(param, contextNames, monitor2);
 
                                 } catch (ExecutionException e) {
                                     error = e;
index 7ec0916be81fb4cb8ddf63d5f935042a7d1b2878..d6a6f17011f8d509a9c13211c5e4fc6457277c1b 100644 (file)
@@ -105,13 +105,13 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
 
                             for (Iterator<TraceEventComponent> iterator = events.iterator(); iterator.hasNext();) {
                                 // Enable/disable all selected channels which are disabled
-                                TraceEventComponent event = iterator.next();
+                                TraceEventComponent traceEvent = iterator.next();
 
                                 // Workaround for wildcard handling in lttng-tools
-                                if ("*".equals(event.getName())) { //$NON-NLS-1$
+                                if ("*".equals(traceEvent.getName())) { //$NON-NLS-1$
                                     isAll = true;
                                 } else {
-                                    eventNames.add(event.getName());
+                                    eventNames.add(traceEvent.getName());
                                 }
                             }
                             if (isAll) {
index 6e478f9144f20af50f04cc5d13e9e253af56bfa0..e0ae88f94e457310693e34b1ca8fabf2afdc591c 100644 (file)
@@ -1,12 +1,12 @@
 /**********************************************************************
  * Copyright (c) 2012 Ericsson and others
- * 
+ *
  * 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
  *   Anna Dushistova(Montavista) - [382684] Allow reusing already defined connections that have Files and Shells subsystems
  **********************************************************************/
@@ -40,7 +40,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Command handler for creation new connection for trace control.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class NewConnectionHandler extends BaseControlViewHandler {
@@ -49,7 +49,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
     // Constants
     // ------------------------------------------------------------------------
     /**
-     * The trace control system type defined for LTTng version 2.0 and later. 
+     * The trace control system type defined for LTTng version 2.0 and later.
      */
     public final static String TRACE_CONTROL_SYSTEM_TYPE = "org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"; //$NON-NLS-1$
 
@@ -57,7 +57,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The parent trace control component the new node will be added to. 
+     * The parent trace control component the new node will be added to.
      */
     private ITraceControlComponent fRoot = null;
 
@@ -75,10 +75,10 @@ public class NewConnectionHandler extends BaseControlViewHandler {
         }
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
-        
+
         // get system type definition for LTTng 2.x connection
         IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(TRACE_CONTROL_SYSTEM_TYPE);
-        
+
         // get all hosts for this system type
         IHost[] hosts = getSuitableHosts();
 
@@ -91,7 +91,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
             return null;
         }
 
-        String hostName = dialog.getConnectionName(); 
+        String hostName = dialog.getConnectionName();
         String hostAddress = dialog.getHostName();
 
         // get the singleton RSE registry
@@ -111,7 +111,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
                 host = registry.createHost(
                         sysType,       //System Type Name
                         hostName,      //Connection name
-                        hostAddress,   //IP Address        
+                        hostAddress,   //IP Address
                         "Connection to Host"); //description //$NON-NLS-1$
             }
             catch (Exception e) {
@@ -121,7 +121,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
                 return null;
             }
         }
-        
+
         if (host != null) {
             fLock.lock();
             try {
@@ -143,28 +143,27 @@ public class NewConnectionHandler extends BaseControlViewHandler {
         return null;
     }
 
+    private static IHost[] getSuitableHosts() {
+        // need shells and files
+        ArrayList<IHost> result = new ArrayList<IHost>();
+        ArrayList<IHost> shellConnections = new ArrayList<IHost>(
+                Arrays.asList(RSECorePlugin.getTheSystemRegistry()
+                        .getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$
+
+        for (IHost connection : shellConnections) {
+            if (!connection.getSystemType().isLocal()) {
+                ISubSystem[] subSystems = connection.getSubSystems();
+                for (int i = 0; i < subSystems.length; i++) {
+                    if (subSystems[i] instanceof IFileServiceSubSystem) {
+                        result.add(connection);
+                        break;
+                    }
+                }
+            }
+        }
 
-       private IHost[] getSuitableHosts() {
-               //need shells and files
-               ArrayList<IHost> result = new ArrayList<IHost>();
-               ArrayList<IHost> shellConnections = new ArrayList<IHost>(Arrays.asList(RSECorePlugin.getTheSystemRegistry()
-                               .getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$
-
-               for(IHost connection:shellConnections){
-                       if(!connection.getSystemType().isLocal()){
-                               ISubSystem[] subSystems = connection.getSubSystems();
-                               for (int i = 0; i < subSystems.length; i++) {
-                                       if (subSystems[i] instanceof IFileServiceSubSystem){
-                                               result.add(connection);
-                                               break;
-                                       }
-                               }
-                       }
-               }
-               
-               return (IHost[]) result.toArray(new IHost[result.size()]);
-       }
-
+        return result.toArray(new IHost[result.size()]);
+    }
 
     /*
      * (non-Javadoc)
@@ -172,7 +171,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
      */
     @Override
     public boolean isEnabled() {
-        
+
         // Get workbench page for the Control View
         IWorkbenchPage page = getWorkbenchPage();
         if (page == null) {
@@ -182,11 +181,11 @@ public class NewConnectionHandler extends BaseControlViewHandler {
         ITraceControlComponent root = null;
 
         // no need to verify part because it has been already done in getWorkbenchPage()
-        IWorkbenchPart part = page.getActivePart(); 
+        IWorkbenchPart part = page.getActivePart();
         root = ((ControlView) part).getTraceControlRoot();
-        
+
         boolean isEnabled = root != null;
-        
+
         fLock.lock();
         try {
             fRoot = null;
@@ -196,7 +195,7 @@ public class NewConnectionHandler extends BaseControlViewHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
 }
index b90ea3910ce1747e4f578c33538aa0a042d2ec9f..a3a34f93af6078606fd0bea9962400ec3bce2bb3 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.model.impl;
@@ -23,7 +23,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the base trace event component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class BaseEventComponent extends TraceControlComponent {
@@ -34,21 +34,21 @@ public class BaseEventComponent extends TraceControlComponent {
      * Path to icon file for this component.
      */
     public static final String TRACE_EVENT_ICON_FILE_ENABLED = "icons/obj16/event_enabled.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The Event information implementation. 
+     * The Event information implementation.
      */
     private IBaseEventInfo fEventInfo;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
-    
+
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
      */
@@ -57,7 +57,7 @@ public class BaseEventComponent extends TraceControlComponent {
         setImage(TRACE_EVENT_ICON_FILE_ENABLED);
         fEventInfo = new EventInfo(name);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -68,14 +68,14 @@ public class BaseEventComponent extends TraceControlComponent {
     public void setEventInfo(IBaseEventInfo eventInfo) {
         fEventInfo = eventInfo;
     }
-    
+
     /**
      * @return the event type.
      */
     public TraceEventType getEventType() {
         return fEventInfo.getEventType();
     }
-    
+
     /**
      * Sets the event type to the given value.
      * @param type - type to set.
@@ -83,7 +83,7 @@ public class BaseEventComponent extends TraceControlComponent {
     public void setEventType(TraceEventType type) {
         fEventInfo.setEventType(type);
     }
-    
+
     /**
      * Sets the event type to the value specified by the give name.
      * @param typeName - the type name.
@@ -98,15 +98,15 @@ public class BaseEventComponent extends TraceControlComponent {
     public TraceLogLevel getLogLevel() {
         return fEventInfo.getLogLevel();
     }
-    
+
     /**
-     * Sets the trace event log level to the given level 
+     * Sets the trace event log level to the given level
      * @param level - event log level to set
      */
     public void setLogLevel(TraceLogLevel level) {
         fEventInfo.setLogLevel(level);
     }
-    
+
     /**
      * Sets the trace event log level to the level specified by the given name.
      * @param levelName - event log level name
@@ -119,17 +119,16 @@ public class BaseEventComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
             return new BaseEventPropertySource(this);
         }
         return null;
-    } 
+    }
 
     /**
-     * @return target node component. 
+     * @return target node component.
      */
     public TargetNodeComponent getTargetNode() {
         return (TargetNodeComponent) getParent().getParent();
index 284552862030541b502e67117924188c5bf20c5e..3c0b342b38c3b824033fcccd1f7182dbd91e4c8a 100644 (file)
@@ -76,7 +76,6 @@ public class KernelProviderComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
index a5d1a0018f8e4d9904a2dd0caab34c311982220b..5ce40f940aa6ab15ab7aff9874eed2a40968f40c 100644 (file)
@@ -171,7 +171,6 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
index 57ad4c3315d45b7f3786354bcca5305b2d8bd4aa..39ae17e0bc079711a7ac5f4f9e5cfdf36209cf03 100644 (file)
@@ -224,7 +224,6 @@ public class TraceChannelComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
index efbd56e4401fe2c71948fce9456f5e581f3d53ff..5154d4b01006f52ab2716cf246c72b138099bea8 100644 (file)
@@ -438,7 +438,6 @@ public class TraceControlComponent implements ITraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         return null;
index fbb9231bb1050e5272af10402ff9ece3b85931ae..7c01dd77df36828cbf5193c4b73262abeb8d39ab 100644 (file)
@@ -86,7 +86,6 @@ public class TraceDomainComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
index ffea65de4924ebbd19841eaa642c2a3880a6db70..14d3930126c5cfa59a6cdce1a250ea9e204824b8 100644 (file)
@@ -173,7 +173,6 @@ public class TraceEventComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
index ef8a6d9f1b959f278c91e7afc95160823054c23c..b6c2028350afb890e4b7e673cea1ce020d2679d5 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.model.impl;
@@ -22,31 +22,31 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the trace channel component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceProbeEventComponent extends TraceEventComponent {
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
-     */    
+     */
     public TraceProbeEventComponent(String name, ITraceControlComponent parent) {
         super(name, parent);
         fEventInfo = new ProbeEventInfo(name);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -63,12 +63,11 @@ public class TraceProbeEventComponent extends TraceEventComponent {
         }
         throw new IllegalArgumentException("Invalid type passed. Only class of type ProbeEventInfo allowed:\n" + eventInfo.getClass()); //$NON-NLS-1$
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
@@ -115,7 +114,7 @@ public class TraceProbeEventComponent extends TraceEventComponent {
     public void setSymbol(String symbol) {
         getEventInfo().setSymbol(symbol);
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
index 753faac1db76055845eae97e352a0093c860ee37..4a95cd934c8fdc8a4abb8b1c5cbf387037a5f05e 100644 (file)
@@ -169,7 +169,6 @@ public class TraceSessionComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
index f509a61fb89aa70cb2bf0a60fba512e56ede3199..86f2ea0ab5d825f997a88d7b835d41d425bdabf9 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
  **********************************************************************/
 
@@ -24,11 +24,11 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the UST provider component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class UstProviderComponent extends TraceControlComponent {
-    
+
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
@@ -36,7 +36,7 @@ public class UstProviderComponent extends TraceControlComponent {
      * Path to icon file for this component.
      */
     public static final String USTL_PROVIDER_ICON_FILE = "icons/obj16/targets.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -44,15 +44,15 @@ public class UstProviderComponent extends TraceControlComponent {
      * The UST provider information.
      */
     private IUstProviderInfo fProviderInfo = null;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
-     */    
+     */
     public UstProviderComponent(String name, ITraceControlComponent parent) {
         super(name, parent);
         setImage(USTL_PROVIDER_ICON_FILE);
@@ -64,7 +64,7 @@ public class UstProviderComponent extends TraceControlComponent {
     // Accessors
     // ------------------------------------------------------------------------
     /**
-     * Sets the UST provider information to the given value. 
+     * Sets the UST provider information to the given value.
      * @param providerInfo - the provider information to set
      */
     public void setUstProvider(IUstProviderInfo providerInfo) {
@@ -77,7 +77,7 @@ public class UstProviderComponent extends TraceControlComponent {
         }
         setName(getName() + " [PID=" + fProviderInfo.getPid() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
     }
-    
+
     /**
      * @return the process ID of the UST provider.
      */
@@ -97,19 +97,18 @@ public class UstProviderComponent extends TraceControlComponent {
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
      */
-    @SuppressWarnings("rawtypes")
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
             return new UstProviderPropertySource(this);
         }
         return null;
-    } 
+    }
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
 }
 
 
index 88e58e1509bd72bb6d95c3820c752991e417b381..c2559d194df174d5f059020f6ddb73bbb9a6f73c 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:
  *   Patrick Tasse - Initial API and implementation
  *   Bernd Hufmann - Updated using Executor Framework
  **********************************************************************/
@@ -35,7 +35,7 @@ import org.eclipse.rse.services.shells.IShellService;
 
 /**
  * <p>
- * Implementation of remote command execution using RSE's shell service. 
+ * Implementation of remote command execution using RSE's shell service.
  * </p>
  *
  * @author Patrick Tasse
@@ -49,16 +49,16 @@ public class CommandShell implements ICommandShell {
 
     /** Sub-string to be echo'ed when running command in shell, used to indicate that the command has finished running */
     public final static String DONE_MARKUP_STRING = "--RSE:donedonedone:--"; //$NON-NLS-1$
-    
-    /** Sub-string to be echoed when running a command in shell. */ 
+
+    /** Sub-string to be echoed when running a command in shell. */
     public final static String BEGIN_END_TAG = "BEGIN-END-TAG:"; //$NON-NLS-1$
-    
+
     /** Command delimiter for shell */
     public final static String CMD_DELIMITER = "\n"; //$NON-NLS-1$
 
     /** Shell "echo" command */
     public final static String SHELL_ECHO_CMD = " echo "; //$NON-NLS-1$
-    
+
     /** Default command separator */
     public final static char CMD_SEPARATOR = ';';
 
@@ -72,14 +72,21 @@ public class CommandShell implements ICommandShell {
     private IHostShell fHostShell = null;
     private BufferedReader fInputBufferReader = null;
     private BufferedReader fErrorBufferReader = null;
-    private ExecutorService fExecutor = Executors.newFixedThreadPool(1);
+    private final ExecutorService fExecutor = Executors.newFixedThreadPool(1);
     private boolean fIsConnected = false;
-    private Random fRandom = new Random(System.currentTimeMillis());;
+    private final Random fRandom = new Random(System.currentTimeMillis());
     private int fReturnValue;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
+
+    /**
+     * Create a new command shell
+     *
+     * @param proxy
+     *            The RSE proxy for this shell
+     */
     public CommandShell(IRemoteSystemProxy proxy) {
         fProxy = proxy;
     }
@@ -141,7 +148,7 @@ public class CommandShell implements ICommandShell {
                 @Override
                 public CommandResult call() throws IOException, CancellationException {
                     final ArrayList<String> result = new ArrayList<String>();
-                    
+
                     synchronized (fHostShell) {
                         // Initialize return value which will be updated in isAliasEchoResult()
                         fReturnValue = 0;
@@ -149,24 +156,24 @@ public class CommandShell implements ICommandShell {
                         int startAlias = fRandom.nextInt();
                         int endAlias = fRandom.nextInt();
                         fHostShell.writeToShell(formatShellCommand(command, startAlias, endAlias));
-                        
+
                         String nextLine;
                         boolean isStartFound = false;
                         while ((nextLine = fInputBufferReader.readLine()) != null) {
 
                             if (monitor.isCanceled()) {
                                 flushInput();
-                                throw new CancellationException(); 
+                                throw new CancellationException();
                             }
 
-                            // check if line contains echoed start alias 
+                            // check if line contains echoed start alias
                             if (isAliasEchoResult(nextLine, startAlias, true)) {
                                 isStartFound = true;
                                 continue;
                             }
 
-                            // check if line contains is the end mark-up. This will retrieve also 
-                            // the return value of the actual command. 
+                            // check if line contains is the end mark-up. This will retrieve also
+                            // the return value of the actual command.
                             if (isAliasEchoResult(nextLine, endAlias, false)) {
                                 break;
                             }
@@ -186,11 +193,11 @@ public class CommandShell implements ICommandShell {
                             result.add(nextLine);
                         }
 
-                        // Read any left over output 
+                        // Read any left over output
                         flushInput();
-                        
+
                         // Read error stream output when command failed.
-                        if (fReturnValue != 0) { 
+                        if (fReturnValue != 0) {
                             while(fErrorBufferReader.ready()) {
                                 if ((nextLine = fErrorBufferReader.readLine()) != null)  {
                                     result.add(nextLine);
@@ -235,20 +242,20 @@ public class CommandShell implements ICommandShell {
 
     /**
      * Format the command to be sent into the shell command with start and end marker strings.
-     * The start marker is need to know when the actual command output starts. The end marker 
+     * The start marker is need to know when the actual command output starts. The end marker
      * string is needed so we can tell that end of output has been reached.
-     * 
-     * @param cmd The actual command 
+     *
+     * @param cmd The actual command
      * @param startAlias The command alias for start marker
      * @param endAlias The command alias for end marker
      * @return formatted command string
      */
-    private String formatShellCommand(String cmd, int startAlias, int endAlias) {
+    private static String formatShellCommand(String cmd, int startAlias, int endAlias) {
         if (cmd == null || cmd.equals("")) { //$NON-NLS-1$
             return cmd;
         }
         StringBuffer formattedCommand = new StringBuffer();
-        // Make multi-line command. 
+        // Make multi-line command.
         // Wrap actual command with start marker and end marker to wrap actual command.
         formattedCommand.append(getEchoCmd(startAlias));
         formattedCommand.append(CMD_DELIMITER);
@@ -258,31 +265,31 @@ public class CommandShell implements ICommandShell {
         formattedCommand.append(CMD_DELIMITER);
         return formattedCommand.toString();
     }
-    
+
     /**
      * Creates a echo command line in the format: echo <start tag> <alias> <end tag> $?
-     * 
+     *
      * @param alias The command alias integer to be included in the echoed message.
      * @return the echo command line
      */
-    private String getEchoCmd(int alias) {
+    private static String getEchoCmd(int alias) {
         return SHELL_ECHO_CMD + getEchoResult(alias) + "$?"; //$NON-NLS-1$
     }
 
     /**
-     * Creates the expected result for a given command alias: 
+     * Creates the expected result for a given command alias:
      * <start tag> <alias> <end tag> $?
-     * 
+     *
      * @param alias The command alias integer to be included in the echoed message.
      * @return the expected echo result
      */
-    private String getEchoResult(int alias) {
+    private static String getEchoResult(int alias) {
         return BEGIN_END_TAG + String.valueOf(alias) + DONE_MARKUP_STRING;
     }
-    
+
     /**
      * Verifies if given command line contains a command alias echo result.
-     *  
+     *
      * @param line The output line to test.
      * @param alias The command alias
      * @param checkReturnValue <code>true</code> to retrieve command result (previous command) <code>false</code>
@@ -300,32 +307,35 @@ public class CommandShell implements ICommandShell {
                 }
             }
             return true;
-        } else {
-            int index = line.indexOf(expected);
-            if (index > 0) {
-                if (line.indexOf(SHELL_ECHO_CMD) == -1) {
-                    return true;
-                }
+        }
+        int index = line.indexOf(expected);
+        if (index > 0) {
+            if (line.indexOf(SHELL_ECHO_CMD) == -1) {
+                return true;
             }
         }
 
         return false;
     }
-    
+
     /**
-     * Verifies if output line is an echo of the given command line. If the output line is longer then
-     * the maximum line lengths (e.g. for ssh), the shell adds a line break character. This
-     * method takes this in consideration by comparing the command line without any whitespaces. 
-     * 
-     * @param line The output line to verify
-     * @param cmd The command executed
-     * @return <code>true</code> if it's an echoed command line else <code>false</code>
+     * Verifies if output line is an echo of the given command line. If the
+     * output line is longer then the maximum line lengths (e.g. for ssh), the
+     * shell adds a line break character. This method takes this in
+     * consideration by comparing the command line without any whitespaces.
+     *
+     * @param line
+     *            The output line to verify
+     * @param cmd
+     *            The command executed
+     * @return <code>true</code> if it's an echoed command line else
+     *         <code>false</code>
      */
     @SuppressWarnings("nls")
-    private boolean isCommandEcho(String line, String cmd) {
+    private static boolean isCommandEcho(String line, String cmd) {
         String s1 = line.replaceAll("\\s","");
         String s2 = cmd.replaceAll("\\s","");
-        s2 = s2.replaceAll("(\\*)", "(\\\\*)"); 
+        s2 = s2.replaceAll("(\\*)", "(\\\\*)");
         String patternStr = ".*(" + s2 +")$";
         return s1.matches(patternStr);
     }
index fce82526eaa0217b17559a3f7b0a72f03919da49..96887147327562a3ee5b51ce0e20754e1cf7efad 100644 (file)
@@ -811,7 +811,7 @@ public class LTTngControlService implements ILttngControlService {
     /**
      * Formats the output string as single string.
      *
-     * @param output
+     * @param result
      *            - output array
      * @return - the formatted output
      */
This page took 0.050635 seconds and 5 git commands to generate.