--- /dev/null
+class java/lang/Class
+getAnnotation
+ <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)TA;
+ <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)T0A;
--- /dev/null
+class org/eclipse/cdt/dsf/service/DsfServicesTracker
+getService
+ <V:Ljava/lang/Object;>(Ljava/lang/Class<TV;>;)TV;
+ <V:Ljava/lang/Object;>(Ljava/lang/Class<TV;>;)T0V;
--- /dev/null
+class org/eclipse/remote/core/IRemoteConnection
+getService
+ <T::Lorg/eclipse/remote/core/IRemoteConnection$Service;>(Ljava/lang/Class<TT;>;)TT;
+ <T::Lorg/eclipse/remote/core/IRemoteConnection$Service;>(Ljava/lang/Class<TT;>;)T0T;
--- /dev/null
+class org/eclipse/remote/core/IRemoteConnectionType
+getService
+ <T::Lorg/eclipse/remote/core/IRemoteConnectionType$Service;>(Ljava/lang/Class<TT;>;)TT;
+ <T::Lorg/eclipse/remote/core/IRemoteConnectionType$Service;>(Ljava/lang/Class<TT;>;)T0T;
IContainerDMContext containerDMC = (IContainerDMContext)(getData()[0]);
IBreakpointsTargetDMContext bpTargetDMC = DMContexts.getAncestorOfType(containerDMC , IBreakpointsTargetDMContext.class);
- CommandFactory cmdFactory = tracker.getService(IMICommandControl.class).getCommandFactory();
+ IMICommandControl commandService = tracker.getService(IMICommandControl.class);
+ if (commandService == null) {
+ drm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Could not find necessary services", null)); //$NON-NLS-1$
+ drm.done();
+ return;
+ }
+
+ CommandFactory cmdFactory = commandService.getCommandFactory();
IBreakpoints bpService = tracker.getService(MIBreakpoints.class);
if (cmdFactory == null || bpService == null) {
drm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Could not find necessary services", null)); //$NON-NLS-1$
final IGDBTraceControl traceControl = tracker
.getService(IGDBTraceControl.class);
- final ICommandControlService commandControl = tracker
- .getService(ICommandControlService.class);
+ final ICommandControlService commandControl = tracker.getService(ICommandControlService.class);
+ if (commandControl == null) {
+ queryRm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Could not find necessary services", null)); //$NON-NLS-1$
+ queryRm.done();
+ return;
+ }
final ITraceTargetDMContext dmc = (ITraceTargetDMContext) commandControl
.getContext();
final IGDBTraceControl traceControl = tracker.getService(IGDBTraceControl.class);
final ICommandControlService commandControl = tracker.getService(ICommandControlService.class);
+ if (commandControl == null) {
+ queryRm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Could not find necessary services", null)); //$NON-NLS-1$
+ queryRm.done();
+ return;
+ }
+
final ITraceTargetDMContext dmc = (ITraceTargetDMContext) commandControl.getContext();
if (traceControl != null) {
final IGDBTraceControl traceControl = tracker.getService(IGDBTraceControl.class);
final ICommandControlService commandControl = tracker.getService(ICommandControlService.class);
+ if (commandControl == null) {
+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Could not find necessary services", null)); //$NON-NLS-1$
+ rm.done();
+ return;
+ }
final ITraceTargetDMContext dmc = (ITraceTargetDMContext) commandControl.getContext();
if (traceControl != null) {
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs;
import static java.text.MessageFormat.format;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
import java.util.ArrayList;
import java.util.Arrays;
StringBuffer label = new StringBuffer();
label.append(rc.getName());
if (rc.hasService(IRemoteConnectionHostService.class)) {
- label.append(format(" [{0}]", rc.getService(IRemoteConnectionHostService.class).getHostname())); //$NON-NLS-1$
+ IRemoteConnectionHostService service = checkNotNull(rc.getService(IRemoteConnectionHostService.class));
+ label.append(format(" [{0}]", service.getHostname())); //$NON-NLS-1$
}
return label.toString();
}
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.handlers;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
}
String scheme = rc.getConnectionType().getScheme();
- IRemoteConnectionHostService hostService = rc.getService(IRemoteConnectionHostService.class);
+ IRemoteConnectionHostService hostService = checkNotNull(rc.getService(IRemoteConnectionHostService.class));
String address = hostService.getHostname();
String user = hostService.getUsername();
int port = hostService.getPort();
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionChangeListener;
}
@Override
- public <T> T getAdapter(Class<T> adapter) {
+ public <T> @Nullable T getAdapter(Class<T> adapter) {
if (adapter == IPropertySource.class) {
return adapter.cast(new TargetNodePropertySource(this));
}
**********************************************************************/
package org.eclipse.tracecompass.internal.lttng2.control.ui.views.property;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionHostService;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
import org.eclipse.tracecompass.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
return fTargetNode.getName();
}
if (TARGET_NODE_ADDRESS_PROPERTY_ID.equals(id)) {
- RemoteSystemProxy proxy = fTargetNode.getRemoteSystemProxy();
- if (proxy.getRemoteConnection().hasService(IRemoteConnectionHostService.class)) {
- return proxy.getRemoteConnection().getService(IRemoteConnectionHostService.class).getHostname();
+ IRemoteConnection connection = fTargetNode.getRemoteSystemProxy().getRemoteConnection();
+ if (connection.hasService(IRemoteConnectionHostService.class)) {
+ IRemoteConnectionHostService service = checkNotNull(connection.getService(IRemoteConnectionHostService.class));
+ return service.getHostname();
}
return LOCAL_CONNECTION_HOST_NAME;
}
plugin.properties,\
about.html
src.includes = about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
public static String RemoteConnection_ExecutionTimeout;
public static String RemoteConnection_ShellNotConnected;
public static String RemoteConnection_CommandShellError;
+ public static String RemoteConnection_ServiceNotDefined;
public static String RemoteConnection_ConnectionError;
public static String RemoteConnection_DuplicateConnectionError;
RemoteConnection_ExecutionTimeout=Command Execution timed-out
RemoteConnection_ShellNotConnected=Command shell not connected
RemoteConnection_CommandShellError=Could not create HostShellProcessAdapter
+RemoteConnection_ServiceNotDefined=Remote process service not defined
RemoteConnection_ConnectionError=Connecting to node failed for ''{0}''
RemoteConnection_DuplicateConnectionError=Node definition for node name ''{0}'' already exist: Address ''{1}'' and port ''{2}''
package org.eclipse.tracecompass.internal.tmf.remote.core.shell;
import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
import java.io.IOException;
import java.util.concurrent.Callable;
monitor = new NullProgressMonitor();
}
if (!monitor.isCanceled()) {
- IRemoteProcess process = fConnection.getService(IRemoteProcessService.class).getProcessBuilder(command.getInput()).start();
+ IRemoteProcessService service = fConnection.getService(IRemoteProcessService.class);
+ if (service == null) {
+ return new CommandResult(1, new @NonNull String[0], new @NonNull String[] { nullToEmptyString(Messages.RemoteConnection_ServiceNotDefined) });
+ }
+ IRemoteProcess process = service.getProcessBuilder(command.getInput()).start();
InputReader stdout = new InputReader(checkNotNull(process.getInputStream()));
InputReader stderr = new InputReader(checkNotNull(process.getErrorStream()));
package org.eclipse.tracecompass.tmf.remote.core.proxy;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.net.URI;
import java.text.MessageFormat;
import java.util.HashMap;
}
if (wc.hasService(IRemoteConnectionHostService.class)) {
- IRemoteConnectionHostService hostService = wc.getService(IRemoteConnectionHostService.class);
+ IRemoteConnectionHostService hostService = checkNotNull(wc.getService(IRemoteConnectionHostService.class));
hostService.setHostname(hostUri.getHost());
hostService.setPort(hostUri.getPort());
String user = hostUri.getUserInfo();