Source:
public static IApplication getApplication(IServerAttributes server) throws GetApplicationException { final String appName = getApplicationName(server); if (StringUtils.isEmpty(appName)) { throw new GetApplicationException("No application."); } final ConnectionURL connectionUrl = getConnectionUrl(server); if (connectionUrl == null) { throw new GetApplicationException(NLS.bind("Failed to get connection URL from {0}", server.getName())); } ExpressConnection connection = null; String expectedConnectionProblem = NLS.bind("Failed to find connection {0}", connectionUrl.toString()); try { connection = ConnectionsRegistrySingleton.getInstance().getByUrl(connectionUrl, ExpressConnection.class); if (connection != null) { if(!connection.connect()) { throw new GetApplicationException(NLS.bind("Connection {0} is not authenticated.", connectionUrl.toString())); } } else { throw new GetApplicationException(expectedConnectionProblem); } } catch (OpenShiftException e) { ExpressCoreActivator.pluginLog().logError(expectedConnectionProblem, e); throw new GetApplicationException(expectedConnectionProblem); } try { String domainId = getDomainName(server); if(domainId == null) { throw new GetApplicationException(NLS.bind("Failed to find domain id in server {0}", server.getName())); } IDomain domain = connection.getDomain(domainId); if(domain == null) { throw new GetApplicationException(NLS.bind("Failed to find domain {0}", domainId)); } return connection.getApplication(appName, domain); } catch (OpenShiftException e) { String problem = NLS.bind("Failed to retrieve application ''{0}'' at url ''{1}}'", appName, connectionUrl); ExpressCoreActivator.pluginLog().logError(problem, e); throw new GetApplicationException(problem); } }

Target:
public static IApplication getApplication(IServerAttributes server) throws GetApplicationException { final String appName = getApplicationName(server); if (StringUtils.isEmpty(appName)) { throw new GetApplicationException("No application."); } final ConnectionURL connectionUrl = getConnectionUrl(server); if (connectionUrl == null) { throw new GetApplicationException(NLS.bind("Failed to get connection URL from {0}", server.getName())); } ExpressConnection connection = null; String expectedConnectionProblem = NLS.bind("Failed to find connection {0}", connectionUrl.toString()); try { connection = ConnectionsRegistrySingleton.getInstance().getByUrl(connectionUrl, ExpressConnection.class); if (connection != null) { if(!connection.connect()) { throw new GetApplicationException(NLS.bind("Connection {0} is not authenticated.", connectionUrl.toString())); } } else { throw new GetApplicationException(expectedConnectionProblem); } } catch (OpenShiftException e) { throw new GetApplicationException(expectedConnectionProblem, e); } try { String domainId = getDomainName(server); if(domainId == null) { throw new GetApplicationException(NLS.bind("Failed to find domain id in server {0}", server.getName())); } IDomain domain = connection.getDomain(domainId); if(domain == null) { throw new GetApplicationException(NLS.bind("Failed to find domain {0}", domainId)); } return connection.getApplication(appName, domain); } catch (OpenShiftException e) { String problem = NLS.bind("Failed to retrieve application ''{0}'' at url ''{1}}'", appName, connectionUrl); throw new GetApplicationException(problem, e); } }