Skip to content

Commit e751e84

Browse files
tuanvtdeptre199MatthewKhouzam
authored andcommitted
Improve Control Flow view
- Clean code of the class ControlFlowView.java
1 parent 66cc0a0 commit e751e84

File tree

1 file changed

+3
-7
lines changed
  • analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/controlflow

1 file changed

+3
-7
lines changed

analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/controlflow/ControlFlowView.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -849,13 +849,9 @@ private static ActiveThreadsFilter getActiveThreadsFilter(ViewerFilter[] filters
849849
* does not have a thread entry model
850850
*/
851851
public static @Nullable ThreadEntryModel getThreadEntryModel(ITimeGraphEntry entry) {
852-
if (!(entry instanceof TimeGraphEntry)) {
853-
return null;
852+
if (entry instanceof TimeGraphEntry timeGraphEntry && timeGraphEntry.getEntryModel() instanceof ThreadEntryModel threadEntryModel) {
853+
return threadEntryModel;
854854
}
855-
ITmfTreeDataModel model = ((TimeGraphEntry) entry).getEntryModel();
856-
if (!(model instanceof ThreadEntryModel)) {
857-
return null;
858-
}
859-
return (ThreadEntryModel) model;
855+
return null;
860856
}
861857
}

0 commit comments

Comments
 (0)