From 2340a50b075769880c4fc471e5f7806909d32e39 Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Thu, 21 May 2015 16:57:01 -0400 Subject: [PATCH] Fix warnings and static method access. Change-Id: Ic3d4eda4ca1e982984787bd638e082489ae3b63b Signed-off-by: Greg Watson --- .../console/TerminalConsoleUtility.java | 12 ++++++---- .../console/TerminalConsoleFactory.java | 23 +++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/TerminalConsoleUtility.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/TerminalConsoleUtility.java index 740c188b518..a9af9f255e6 100644 --- a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/TerminalConsoleUtility.java +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/TerminalConsoleUtility.java @@ -22,8 +22,8 @@ import org.eclipse.ui.console.IConsole; */ public class TerminalConsoleUtility { /** - * Opens a dialog to allow selection of an IRemoteConnection, - * encoding, etc. and then open a console to it. + * Opens a dialog to allow selection of an IRemoteConnection, + * encoding, etc. and then open a console to it. */ public void openConsole() { new TerminalConsoleFactory().openConsole(); @@ -31,19 +31,21 @@ public class TerminalConsoleUtility { /** * Open a specific IRemoteConnection and encoding combination. + * * @param connection * @param encoding */ public static void openConsole(final IRemoteConnection connection, final String encoding) { - new TerminalConsoleFactory().openConsole(connection, encoding); + TerminalConsoleFactory.openConsole(connection, encoding); } - + /** * Find an existing console for the given IRemoteConnection + * * @param connection * @return */ public static List findConsole(IRemoteConnection connection) { - return new TerminalConsoleFactory().findConsole(connection); + return TerminalConsoleFactory.findConsole(connection); } } diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java index 7bb235e9773..478b645aa73 100644 --- a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java @@ -47,25 +47,24 @@ public class TerminalConsoleFactory implements IConsoleFactory { }; j.schedule(); } - - private static IStatus openConsoleImplementation( final IRemoteConnection connection, - final String encoding, IProgressMonitor monitor) { + + private static IStatus openConsoleImplementation(final IRemoteConnection connection, final String encoding, + IProgressMonitor monitor) { IRemoteCommandShellService commandShellService = connection.getService(IRemoteCommandShellService.class); if (commandShellService == null) { return Status.CANCEL_STATUS; } try { - IConsole ret = createConsole(connection, encoding, commandShellService, monitor); + createConsole(connection, encoding, commandShellService, monitor); return Status.OK_STATUS; - } catch(RemoteConnectionException rce) { + } catch (RemoteConnectionException rce) { return rce.getStatus(); } } - - private static IConsole createConsole( final IRemoteConnection connection, - final String encoding, IRemoteCommandShellService service, - IProgressMonitor monitor) throws RemoteConnectionException { + + private static IConsole createConsole(final IRemoteConnection connection, final String encoding, + IRemoteCommandShellService service, IProgressMonitor monitor) throws RemoteConnectionException { if (!connection.isOpen()) { connection.open(monitor); } @@ -81,7 +80,7 @@ public class TerminalConsoleFactory implements IConsoleFactory { consoleManager.showConsoleView(terminalConsole); return terminalConsole; } - + private static int findNextIndex(IConsoleManager consoleManager, IRemoteConnection connection) { IConsole[] consoles = consoleManager.getConsoles(); boolean[] indices = new boolean[consoles.length]; @@ -99,7 +98,7 @@ public class TerminalConsoleFactory implements IConsoleFactory { } return index; } - + public static List findConsole(IRemoteConnection connection) { ArrayList ret = new ArrayList(); IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); @@ -114,5 +113,5 @@ public class TerminalConsoleFactory implements IConsoleFactory { } return ret; } - + } \ No newline at end of file