From bd7e5b40f8a6e0546cf7122c468bb9776119e5ef Mon Sep 17 00:00:00 2001 From: Arnaud Fiorini Date: Thu, 24 Oct 2024 10:06:16 -0400 Subject: [PATCH] tmf: remove unnecessary cast Signed-off-by: Arnaud Fiorini --- .../tests/inputoutput/AbstractTestInputOutput.java | 3 +-- .../instrumented/FlameChartDataProviderFactory.java | 4 ++-- .../swtbot/tests/markers/MarkerSetSwtBotTest.java | 3 +-- .../tmf/analysis/xml/ui/views/xychart/XmlXYView.java | 2 +- .../backends/partial/PartialHistoryBackend.java | 11 +++++------ .../tmf/core/trace/experiment/TmfExperiment.java | 4 ++-- .../importexport/ImportTracePackageWizardPage.java | 4 ++-- .../tmf/ui/project/model/TmfAnalysisElement.java | 2 +- .../tmf/ui/viewers/events/TmfEventsCache.java | 5 ++--- .../viewers/xychart/XYChartLegendImageProvider.java | 2 +- .../xychart/linechart/TmfCommonXAxisChartViewer.java | 4 ++-- .../tmf/ui/views/timegraph/TimeGraphFindDialog.java | 2 +- .../tracecompass/tmf/ui/views/uml2sd/SDWidget.java | 2 +- .../tracecompass/tmf/ui/views/uml2sd/ScrollView.java | 2 +- .../tracecompass/tmf/ui/views/uml2sd/core/Frame.java | 10 +++++----- 15 files changed, 28 insertions(+), 32 deletions(-) diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/inputoutput/AbstractTestInputOutput.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/inputoutput/AbstractTestInputOutput.java index 06749a2953..59d59933e6 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/inputoutput/AbstractTestInputOutput.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/inputoutput/AbstractTestInputOutput.java @@ -31,7 +31,6 @@ import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException; import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal; import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; -import org.eclipse.tracecompass.tmf.core.trace.TmfTrace; import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager; import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; @@ -131,7 +130,7 @@ protected void deleteTrace() { } deleteSuppFiles(trace); - ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null)); + trace.traceOpened(new TmfTraceOpenedSignal(this, trace, null)); fTrace = trace; /* Start the kernel analysis module */ diff --git a/analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/internal/analysis/profiling/core/instrumented/FlameChartDataProviderFactory.java b/analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/internal/analysis/profiling/core/instrumented/FlameChartDataProviderFactory.java index 45880d1924..a803208a16 100644 --- a/analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/internal/analysis/profiling/core/instrumented/FlameChartDataProviderFactory.java +++ b/analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/internal/analysis/profiling/core/instrumented/FlameChartDataProviderFactory.java @@ -73,7 +73,7 @@ public class FlameChartDataProviderFactory implements IDataProviderFactory { // The trace can be an experiment, so we need to know if there are // multiple analysis modules with the same ID Iterable modules = TmfTraceUtils.getAnalysisModulesOfClass(trace, IFlameChartProvider.class); - Iterable filteredModules = Iterables.filter(modules, m -> ((IAnalysisModule) m).getId().equals(secondaryId)); + Iterable filteredModules = Iterables.filter(modules, m -> m.getId().equals(secondaryId)); Iterator iterator = filteredModules.iterator(); if (iterator.hasNext()) { IFlameChartProvider module = iterator.next(); @@ -82,7 +82,7 @@ public class FlameChartDataProviderFactory implements IDataProviderFactory { // the factory can try with individual traces return null; } - ((IAnalysisModule) module).schedule(); + module.schedule(); return new FlameChartDataProvider(trace, module, secondaryId); } return null; diff --git a/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/markers/MarkerSetSwtBotTest.java b/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/markers/MarkerSetSwtBotTest.java index 417c5458c4..2437b29288 100644 --- a/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/markers/MarkerSetSwtBotTest.java +++ b/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/markers/MarkerSetSwtBotTest.java @@ -30,7 +30,6 @@ import org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal; import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange; import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers; import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils; import org.eclipse.tracecompass.tmf.ui.tests.shared.WaitUtils; @@ -92,7 +91,7 @@ public static void setUp() { final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE; LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(cygProfile); - fStart = ((CtfTmfTrace) trace).getStartTime().toNanos(); + fStart = trace.getStartTime().toNanos(); fFullRange = new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart + 100l)); final File file = new File(trace.getPath()); LttngUstTestTraceUtils.dispose(cygProfile); diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYView.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYView.java index fac1ed27b3..283067deeb 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYView.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYView.java @@ -68,7 +68,7 @@ public XmlXYView() { TmfXYChartViewer chart = getChartViewer(); if (chart instanceof XmlXYViewer) { - ((XmlXYViewer) chart).reset(); + chart.reset(); } loadTrace(); diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java index 7c204910b2..415c69c358 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java @@ -36,7 +36,6 @@ import org.eclipse.tracecompass.internal.provisional.datastore.core.condition.IntegerRangeCondition; import org.eclipse.tracecompass.internal.provisional.datastore.core.condition.TimeRangeCondition; import org.eclipse.tracecompass.internal.tmf.core.Activator; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; import org.eclipse.tracecompass.statesystem.core.backend.IPartialStateHistoryBackend; import org.eclipse.tracecompass.statesystem.core.backend.IStateHistoryBackend; import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException; @@ -303,7 +302,7 @@ public void doQuery(List<@Nullable ITmfStateInterval> currentStateInfo, long t) * Now, we have the intervals with their real end times written to the * backend, we should be able to get them from there */ - List intervalsList = ((ITmfStateSystem) fPartialSS).queryFullState(t); + List intervalsList = fPartialSS.queryFullState(t); for (int i = 0; i < currentStateInfo.size(); i++) { ITmfStateInterval interval = currentStateInfo.get(i); @@ -320,7 +319,7 @@ public void doQuery(List<@Nullable ITmfStateInterval> currentStateInfo, long t) * upper checkpoint exists */ if (fCheckpoints.ceilingKey(t) != null) { - intervalsList = prepareIntervalList(((ITmfStateSystem) fPartialSS).getNbAttributes()); + intervalsList = prepareIntervalList(fPartialSS.getNbAttributes()); filledStateInfo.clear(); try { fInnerHistory.doQuery(intervalsList, checkpointTime2); @@ -366,7 +365,7 @@ public ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws Time /* Reload the previous checkpoint */ long checkpointTime = fCheckpoints.floorKey(t); - int nbAtributes = ((ITmfStateSystem)fPartialSS).getNbAttributes(); + int nbAtributes = fPartialSS.getNbAttributes(); List intervalsList = prepareIntervalList(nbAtributes); /* Checking if the interval was stored in the real backend */ @@ -416,7 +415,7 @@ public ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws Time } /* Querying the partial history at the lowerCheckpoint */ - List<@Nullable ITmfStateInterval> currentStateInfo = prepareIntervalList(((ITmfStateSystem)fPartialSS).getNbAttributes()); + List<@Nullable ITmfStateInterval> currentStateInfo = prepareIntervalList(fPartialSS.getNbAttributes()); try { fInnerHistory.doQuery(currentStateInfo, lowerCheckpoint); } catch (StateSystemDisposedException e) { @@ -469,7 +468,7 @@ public ITmfStateInterval doSingularQuery(long t, int attributeQuark) throws Time Logger logger = Logger.getAnonymousLogger(); try { synchronized (fPartialSS) { - for (ITmfStateInterval interval : ((ITmfStateSystem) fPartialSS).query2D(quarksColletion, min, max)) { + for (ITmfStateInterval interval : fPartialSS.query2D(quarksColletion, min, max)) { fCurrentIntervals.add(interval); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java index 315f50daa3..c3d92d4b84 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java @@ -481,7 +481,7 @@ public synchronized ITmfContext seekEvent(final ITmfLocation location) { traceContext.setRank(ranks[i]); // update location after seek locations[i] = traceContext.getLocation(); - context.setContent(i, traceContext, ((ITmfTrace) getChild(i)).getNext(traceContext)); + context.setContent(i, traceContext, getChild(i).getNext(traceContext)); rank += ranks[i]; } @@ -627,7 +627,7 @@ public synchronized ITmfEvent getNext(ITmfContext context) { trace, traceContext.getLocation(), traceContext.getRank()); experimentContext.setLocation(new TmfExperimentLocation(locationArray)); // queue the next event - ITmfEvent nextEvent = ((ITmfTrace) getChild(trace)).getNext(traceContext); + ITmfEvent nextEvent = getChild(trace).getNext(traceContext); experimentContext.setContent(trace, traceContext, nextEvent); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/tracepkg/importexport/ImportTracePackageWizardPage.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/tracepkg/importexport/ImportTracePackageWizardPage.java index f26946b224..f834690871 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/tracepkg/importexport/ImportTracePackageWizardPage.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/tracepkg/importexport/ImportTracePackageWizardPage.java @@ -481,7 +481,7 @@ private boolean handleTracesConflict(List traceElement private static void uncheckTraceElement(TracePackageTraceElement traceElement) { for (TracePackageElement e : traceElement.getChildren()) { if (e instanceof TracePackageFilesElement) { - ((TracePackageFilesElement) e).setChecked(false); + e.setChecked(false); } } } @@ -489,7 +489,7 @@ private static void uncheckTraceElement(TracePackageTraceElement traceElement) { private static void uncheckExperimentElement(TracePackageExperimentElement experimentElement, List expTraceElements) { for (TracePackageElement e : experimentElement.getChildren()) { if (e instanceof TracePackageFilesElement) { - ((TracePackageFilesElement) e).setChecked(false); + e.setChecked(false); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfAnalysisElement.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfAnalysisElement.java index c7470c1020..51904be714 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfAnalysisElement.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfAnalysisElement.java @@ -118,7 +118,7 @@ protected synchronized void refreshChildren() { IPath path = tracesFolder.getPath(); IResource resource = getResource(); if (resource instanceof IFolder) { - path = ((IFolder) resource).getFullPath(); + path = resource.getFullPath(); } IAnalysisModule module = getAnalysisModule(); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsCache.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsCache.java index 12c9874029..679b84d97e 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsCache.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsCache.java @@ -25,7 +25,6 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.tracecompass.internal.tmf.core.filter.TmfCollapseFilter; import org.eclipse.tracecompass.internal.tmf.ui.Activator; -import org.eclipse.tracecompass.tmf.core.component.ITmfEventProvider; import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; import org.eclipse.tracecompass.tmf.core.event.ITmfEventField; import org.eclipse.tracecompass.tmf.core.event.ITmfEventType; @@ -354,7 +353,7 @@ public int getFilteredIndex() { } request = new DataRequest(ITmfEvent.class, filter, startRank, ITmfEventRequest.ALL_DATA); - ((ITmfEventProvider) fTrace).sendRequest(request); + fTrace.sendRequest(request); try { request.waitForCompletion(); return ((DataRequest) request).getFilteredIndex(); @@ -461,7 +460,7 @@ public void handleData(ITmfEvent event) { } }; - ((ITmfEventProvider) fTrace).sendRequest(request); + fTrace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/XYChartLegendImageProvider.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/XYChartLegendImageProvider.java index cd78fd499c..36a4bd35b1 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/XYChartLegendImageProvider.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/XYChartLegendImageProvider.java @@ -90,7 +90,7 @@ private void drawStyleLine(GC gc, Color lineColor, int imageWidth, int imageHeig LineStyle lineStyle = LineStyle.valueOf((String) presProvider.getStyleOrDefault(appearance, StyleProperties.SERIES_STYLE, StyleProperties.SeriesStyle.SOLID)); if (lineStyle != LineStyle.NONE) { gc.setForeground(lineColor); - gc.setLineWidth(((Number) presProvider.getFloatStyleOrDefault(appearance, StyleProperties.WIDTH, 1.0f)).intValue()); + gc.setLineWidth(presProvider.getFloatStyleOrDefault(appearance, StyleProperties.WIDTH, 1.0f).intValue()); gc.setLineStyle(lineStyle.ordinal()); gc.drawLine(0, imageHeight / 2, imageWidth, imageHeight / 2); gc.setForeground(prev); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/linechart/TmfCommonXAxisChartViewer.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/linechart/TmfCommonXAxisChartViewer.java index dad7f2384a..2661d00707 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/linechart/TmfCommonXAxisChartViewer.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xychart/linechart/TmfCommonXAxisChartViewer.java @@ -637,7 +637,7 @@ private double[] extractXValuesToDisplay(long[] xValuesRequested) { lineSeries.setLineColor(color); lineSeries.setSymbolColor(color); lineSeries.setVisible(true); - lineSeries.setLineWidth(((Number) presProvider.getFloatStyleOrDefault(appearance, StyleProperties.WIDTH, 1.0f)).intValue()); + lineSeries.setLineWidth(presProvider.getFloatStyleOrDefault(appearance, StyleProperties.WIDTH, 1.0f).intValue()); return lineSeries; } @@ -674,7 +674,7 @@ private double[] extractXValuesToDisplay(long[] xValuesRequested) { lineSeries.setLineColor(color); lineSeries.setSymbolColor(color); lineSeries.setVisible(true); - lineSeries.setLineWidth(((Number) presProvider.getFloatStyleOrDefault(appearance, StyleProperties.WIDTH, 1.0f)).intValue()); + lineSeries.setLineWidth(presProvider.getFloatStyleOrDefault(appearance, StyleProperties.WIDTH, 1.0f).intValue()); return lineSeries; } diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/TimeGraphFindDialog.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/TimeGraphFindDialog.java index dd45462a8b..6698a4d27c 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/TimeGraphFindDialog.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/TimeGraphFindDialog.java @@ -945,7 +945,7 @@ private SearchOptions getSearchOptions(boolean forwardSearch) { */ private static void setGridData(Control component, int horizontalAlignment, boolean grabExcessHorizontalSpace, int verticalAlignment, boolean grabExcessVerticalSpace) { GridData gd; - if (component instanceof Button && (((Button) component).getStyle() & SWT.PUSH) != 0) { + if (component instanceof Button && (component.getStyle() & SWT.PUSH) != 0) { gd = (GridData) component.getLayoutData(); gd.horizontalAlignment = GridData.FILL; gd.widthHint = 100; diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/SDWidget.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/SDWidget.java index b0688be834..ab044f10d5 100755 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/SDWidget.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/SDWidget.java @@ -1936,7 +1936,7 @@ public void widgetDisposed(DisposeEvent e) { if (fSite instanceof SDView) { ((SDView) fSite).resetProviders(); if (lm != null) { - lm.resetLoader(((SDView) fSite).getViewSite().getId()); + lm.resetLoader(fSite.getViewSite().getId()); } } } diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/ScrollView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/ScrollView.java index 6c53f1eb9b..c91645a50b 100755 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/ScrollView.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/ScrollView.java @@ -751,7 +751,7 @@ public void setOverviewSize(int size) { */ public boolean isOverviewEnabled() { if (fCornerControl instanceof Button) { - Object data = ((Button) fCornerControl).getData(); + Object data = fCornerControl.getData(); // overview alreay if (data instanceof Overview) { return true; diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/Frame.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/Frame.java index c06fb13d7d..3d7c7dcf81 100755 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/Frame.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/Frame.java @@ -769,7 +769,7 @@ protected GraphNode getCloserLeavingMessage(Lifeline lifeline, BaseMessage messa int event = getMaxEventOccurrence(); if (message != null) { if (message instanceof AsyncMessage) { - event = ((AsyncMessage) message).getStartOccurrence(); + event = message.getStartOccurrence(); } else { event = message.getEventOccurrence(); } @@ -829,7 +829,7 @@ protected GraphNode getCloserEnteringMessage(Lifeline lifeline, BaseMessage mess int event = getMaxEventOccurrence(); if (message != null) { if (message instanceof AsyncMessage) { - event = ((AsyncMessage) message).getStartOccurrence(); + event = message.getStartOccurrence(); } else { event = message.getEventOccurrence(); } @@ -864,8 +864,8 @@ protected int distanceFromEvent(GraphNode node, int event) { if (node instanceof SyncMessage) { distance = ((SyncMessage) node).getEventOccurrence() - event; } else if (node instanceof AsyncMessage) { - int start = ((AsyncMessage) node).getStartOccurrence(); - int end = ((AsyncMessage) node).getEndOccurrence(); + int start = node.getStartOccurrence(); + int end = node.getEndOccurrence(); if ((start - event) < (end - event)) { distance = start - event; } else { @@ -993,7 +993,7 @@ public GraphNode getPrevLifelineMessage(Lifeline lifeline, BaseMessage startMess int event = getMaxEventOccurrence(); if (startMessage != null) { if (startMessage instanceof AsyncMessage) { - event = ((AsyncMessage) startMessage).getStartOccurrence(); + event = startMessage.getStartOccurrence(); } else { event = startMessage.getEventOccurrence(); }