lttng: Add a diagram showing the dependencies between plugins
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / remote / CommandShell.java
index 16fb5fadaf90a7b809307b958c7e9db9366f0816..dcc17c726b3d6fcd766261a196cb2feb3fd94a73 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -49,19 +49,19 @@ 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$
+    public static final String DONE_MARKUP_STRING = "--RSE:donedonedone:--"; //$NON-NLS-1$
 
     /** Sub-string to be echoed when running a command in shell. */
-    public final static String BEGIN_END_TAG = "BEGIN-END-TAG:"; //$NON-NLS-1$
+    public static final String BEGIN_END_TAG = "BEGIN-END-TAG:"; //$NON-NLS-1$
 
     /** Command delimiter for shell */
-    public final static String CMD_DELIMITER = "\n"; //$NON-NLS-1$
+    public static final String CMD_DELIMITER = "\n"; //$NON-NLS-1$
 
     /** Shell "echo" command */
-    public final static String SHELL_ECHO_CMD = " echo "; //$NON-NLS-1$
+    public static final String SHELL_ECHO_CMD = " echo "; //$NON-NLS-1$
 
     /** Default command separator */
-    public final static char CMD_SEPARATOR = ';';
+    public static final char CMD_SEPARATOR = ';';
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -92,10 +92,7 @@ public class CommandShell implements ICommandShell {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandShell#connect()
-     */
+
     @Override
     public void connect() throws ExecutionException {
         IShellService shellService = fProxy.getShellService();
@@ -111,10 +108,6 @@ public class CommandShell implements ICommandShell {
         fIsConnected = true;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandShell#disconnect()
-     */
     @Override
     public void disconnect() {
         fIsConnected = false;
@@ -126,26 +119,18 @@ public class CommandShell implements ICommandShell {
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandShell#executeCommand(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
         return executeCommand(command, monitor, true);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandShell#executeCommand(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean)
-     */
     @Override
     public ICommandResult executeCommand(final String command, final IProgressMonitor monitor, final boolean checkReturnValue) throws ExecutionException {
         if (fIsConnected) {
-            FutureTask<CommandResult> future = new FutureTask<CommandResult>(new Callable<CommandResult>() {
+            FutureTask<CommandResult> future = new FutureTask<>(new Callable<CommandResult>() {
                 @Override
                 public CommandResult call() throws IOException, CancellationException {
-                    final ArrayList<String> result = new ArrayList<String>();
+                    final ArrayList<String> result = new ArrayList<>();
 
                     synchronized (fHostShell) {
                         // Initialize return value which will be updated in isAliasEchoResult()
@@ -307,10 +292,8 @@ public class CommandShell implements ICommandShell {
             return true;
         }
         int index = line.indexOf(expected);
-        if (index > 0) {
-            if (line.indexOf(SHELL_ECHO_CMD) == -1) {
-                return true;
-            }
+        if ((index > 0) && (line.indexOf(SHELL_ECHO_CMD) == -1)) {
+            return true;
         }
 
         return false;
This page took 0.026591 seconds and 5 git commands to generate.