public void testGetAndSetter() {
ProbeEventInfo fixture = new ProbeEventInfo("event");
- // Make sure that ProbeEventInfo extends EventInfo
- // -> so we don't need to re-test common parts
- assertTrue(fixture instanceof EventInfo);
-
fixture.setAddress("0xc12344321");
String result = fixture.getAddress();
fUstProviderInfo1 = factory.getUstProviderInfo1();
fUstProviderInfo2 = factory.getUstProviderInfo2();
fEventInfo1 = factory.getBaseEventInfo1();
- fEventInfo1 = factory.getBaseEventInfo2();
+ fEventInfo2 = factory.getBaseEventInfo2();
}
/**
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
+import java.util.Arrays;
+
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IGetEventInfoDialog;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
@Override
public void setSessions(TraceSessionComponent[] sessions) {
- fSessions = sessions;
+ if (sessions != null) {
+ fSessions = Arrays.copyOf(sessions, sessions.length);
+ return;
+ }
+ fSessions = null;
}
@Override
* @param scenariofile - path to scenario file
* @throws Exception
*/
- public void loadScenarioFile(String scenariofile) throws Exception {
+ public synchronized void loadScenarioFile(String scenariofile) throws Exception {
fScenariofile = scenariofile;
// clean up map
*/
@SuppressWarnings("nls")
@Override
- public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
+ public synchronized ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
Map<String, ICommandResult> commands = fScenarioMap.get(fScenario);
Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(command);
// Helper methods
// ------------------------------------------------------------------------
private boolean isComment(String line) {
+ if (line == null) {
+ throw new RuntimeException("line is null"); //$NON-NLS-1$
+ }
return line.matches(COMMENT_KEY);
}
}
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
- public static Uml2SDTestFacility getInstance() {
+ public synchronized static Uml2SDTestFacility getInstance() {
if (fInstance == null) {
fInstance = new Uml2SDTestFacility();
fInstance.init();
public SDView v;
public int page;
- protected static URL BASIC_URL = null;
-
private List<GraphNode> findResults = new ArrayList<GraphNode>();
private Criteria findCriteria;
private int currentFindIndex = 0;
private Frame savedFrame = null;
- static {
- try {
- BASIC_URL = new URL("platform", "localhost", "plugin"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- } catch (Exception E) {
- System.err.println(E);
- }
- }
-
public TestLoaders() {
this(""); //$NON-NLS-1$
}
return null;
}
- public class LocalImageImpl implements IImage {
+ public static class LocalImageImpl implements IImage {
protected Image img;
public LocalImageImpl(String file) {
public Image getResourceImage(String _name) {
ImageDescriptor img;
try {
+ URL BASIC_URL = new URL("platform", "localhost", "plugin");
URL url = new URL(BASIC_URL, (new StringBuilder("plugin/org.eclipse.linuxtools.tmf.ui/icons/")).append(_name).toString());
img = ImageDescriptor.createFromURL(url);
return img.createImage();
// Highly inefficient...
RandomAccessFile stream = ((TmfTraceStub) eventStream).getStream();
- String name = eventStream.getName();
- name = name.substring(name.lastIndexOf('/') + 1);
+// String name = eventStream.getName();
+// name = name.substring(name.lastIndexOf('/') + 1);
long location = 0;
if (context != null)
@Override\r
public String getEventName(ITimeEvent event, boolean upper, boolean extInfo) {\r
String name = "Unknown";\r
- name = upper ? name : name;\r
if (event instanceof EventImpl) {\r
EventImpl devent = (EventImpl) event;\r
name = devent.getType().toString();\r
long sTime = i * (long) 1E6;\r
trace = new TraceImpl(i, traceNames[count].name, sTime , sTime + 20000,\r
traceNames[count].groupName, traceNames[count].classNmme);\r
- count = i;\r
create5000Events(trace);\r
traceArr[i] = trace;\r
}\r
// ========================================================================\r
// Inner Class\r
// ========================================================================\r
- private class TraceStrings {\r
+ private static class TraceStrings {\r
public String name = "";\r
public String classNmme = name + " class";\r
public String groupName = "group " + classNmme;\r
}
}
- class ViewLabelProvider extends LabelProvider {
+ static class ViewLabelProvider extends LabelProvider {
@Override
public String getText(Object obj) {
}
}
- class NameSorter extends ViewerSorter {
+ static class NameSorter extends ViewerSorter {
}
// ========================================================================