auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private IRegisterGroupDescriptor createGroupDescriptor(final String groupName, final IRegisterDescriptor[] iSelectedRegisters) { IRegisterGroupDescriptor groupDescriptor = new IRegisterGroupDescriptor() { @Override public boolean isEnabled() { return true; } @Override public String getName() { return groupName; } @Override public String getContainerId() { return null; // Not used } @Override public IRegisterDescriptor[] getChildren() throws CoreException { return iSelectedRegisters; } }; return groupDescriptor; }

Target:
private IRegisterGroupDescriptor createGroupDescriptor(final String groupName, final IRegisterDescriptor[] iSelectedRegisters) { IRegisterGroupDescriptor groupDescriptor = new IRegisterGroupDescriptor() { @Override public boolean isEnabled() { return true; } @Override public String getName() { return groupName; } @Override public IRegisterDescriptor[] getChildren() throws CoreException { return iSelectedRegisters; } }; return groupDescriptor; }
Source:
private boolean isOrphan(File file) { String fileName = file.getName(); return fileName.startsWith("pack") && //$NON-NLS-1$ (fileName.endsWith(PackExt.BITMAP_INDEX.getExtension()) || fileName.endsWith(PackExt.INDEX.getExtension())) && !new File(file.getParentFile(), fileName.substring(0, fileName.lastIndexOf(".") + 1) //$NON-NLS-1$ + PackExt.PACK.getExtension()).exists(); }

Target:
private boolean isOrphan(File file) { String fileName = file.getName(); return fileName.startsWith("pack") && //$NON-NLS-1$ (fileName.endsWith("." + PackExt.BITMAP_INDEX.getExtension()) //$NON-NLS-1$ || fileName .endsWith("." + PackExt.INDEX.getExtension())) //$NON-NLS-1$ && !new File(file.getParentFile(), fileName.substring(0, fileName.lastIndexOf(".") + 1) //$NON-NLS-1$ + PackExt.PACK.getExtension()).exists(); }
Source:
public void testCall() { GetDiffCommand diff = new GetDiffCommand(fGerrit.getRepository(), change_id, commit_id, "/COMMIT_MSG"); try { DiffInfo di = diff.call(); System.out.println(di); } catch (EGerritException e) { // TODO Auto-generated catch block e.printStackTrace(); } }

Target:
public void testCall() throws EGerritException { GetDiffCommand diff = new GetDiffCommand(fGerrit.getRepository(), change_id, commit_id, "/COMMIT_MSG", 2); diff.call(); }
Source:
public void setUp() throws IOException { DfsRepositoryDescription desc = new DfsRepositoryDescription("test"); git = new TestRepository<>(new InMemoryRepository(desc)); repo = git.getRepository(); odb = repo.getObjectDatabase(); ticks = 0; mockSystemReader = new MockSystemReader() { @Override public long getCurrentTime() { // move forward time with every call return super.getCurrentTime() + ticks++; } }; SystemReader.setInstance(mockSystemReader); }

Target:
public void setUp() throws IOException { DfsRepositoryDescription desc = new DfsRepositoryDescription("test"); git = new TestRepository<>(new InMemoryRepository(desc)); repo = git.getRepository(); odb = repo.getObjectDatabase(); mockSystemReader = new MockSystemReader(); SystemReader.setInstance(mockSystemReader); }
Source:
public AboutInfo[] getFeatureInfos() { // cannot be cached since bundle groups come and go List infos = new ArrayList(); // add an entry for each bundle group IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); if (providers != null) { for (IBundleGroupProvider provider : providers) { IBundleGroup[] bundleGroups = provider.getBundleGroups(); for (IBundleGroup bundleGroup : bundleGroups) { infos.add(new AboutInfo(bundleGroup)); } } } return (AboutInfo[]) infos.toArray(new AboutInfo[infos.size()]); }

Target:
public AboutInfo[] getFeatureInfos() { // cannot be cached since bundle groups come and go List infos = new ArrayList(); // add an entry for each bundle group IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); if (providers != null) { for (IBundleGroupProvider provider : providers) { for (IBundleGroup bundleGroup : provider.getBundleGroups()) { infos.add(new AboutInfo(bundleGroup)); } } } return (AboutInfo[]) infos.toArray(new AboutInfo[infos.size()]); }
Source:
public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { Browser browser = new Browser(shell, SWT.NONE); browser.dispose(); browser = new Browser(shell, SWT.BORDER); // System.out.println("Test_org_eclipse_swt_browser_Browser#test_Constructor*#getBrowserType(): " + browser.getBrowserType()); browser.dispose(); browser = new Browser(null, SWT.NONE); // Should throw. fail("No exception thrown for parent == null"); }

Target:
public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { Browser browser = new Browser(shell, SWT.NONE); browser.dispose(); browser = new Browser(shell, SWT.BORDER); // System.out.println("Test_org_eclipse_swt_browser_Browser#test_Constructor*#getBrowserType(): " + browser.getBrowserType()); browser.dispose(); browser = new Browser(null, SWT.NONE); // Should throw. }
Source:
public ISearchResultPage getCurrentPage() { IViewPart view = super.getPartForAction(); return ((SearchView) view).getActivePage(); }

Target:
private ISearchResultPage getCurrentPage() { IViewPart view = super.getPartForAction(); return ((SearchView) view).getActivePage(); }
Source:
public synchronized void dispose() { /* Clean up the index if applicable */ if (getIndexer() != null) { getIndexer().dispose(); } /* Clean up the analysis modules */ @NonNull Iterable<IAnalysisModule> analysisModules = getAnalysisModules(); for (IAnalysisModule module : analysisModules) { module.dispose(); } fAnalysisModules.clear(); super.dispose(); }

Target:
public synchronized void dispose() { /* Clean up the index if applicable */ if (getIndexer() != null) { getIndexer().dispose(); } /* Clean up the analysis modules */ Iterable<IAnalysisModule> analysisModules = getAnalysisModules(); for (IAnalysisModule module : analysisModules) { module.dispose(); } fAnalysisModules.clear(); super.dispose(); }
Source:
protected T doGetValue() { // The value is not kept up to date when we are not listening. if (isListening) { return value; } return calculate(); }

Target:
protected final T doGetValue() { // The value is not kept up to date when we are not listening. if (isListening) { return value; } return calculate(); }
Source:
public void createPartControl(@Nullable Composite parent) { super.createPartControl(parent); String name = getViewSite().getSecondaryId(); if (name != null) { fViewInfo.setName(name); } setViewTitle(); }

Target:
public void createPartControl(@Nullable Composite parent) { String name = getViewSite().getSecondaryId(); if (name != null) { /* must initialize view info before calling super */ fViewInfo.setName(name); } super.createPartControl(parent); setViewTitle(); }
Source:
protected void appendName(ActivityPartition activitypartition, Collection<String> displayValue, StringBuilder sb) { Element represents = activitypartition.getRepresents(); String activitypartitionName = UMLLabelInternationalization.getInstance().getLabel(activitypartition); if (represents != null) { if (represents instanceof NamedElement) { activitypartitionName = ((NamedElement) represents).getName() ; } } appendString(sb, activitypartitionName, UNNAMED); return; }

Target:
protected void appendName(ActivityPartition activitypartition, Collection<String> displayValue, StringBuilder sb) { Element represents = activitypartition.getRepresents(); String activitypartitionName = UMLLabelInternationalization.getInstance().getLabel(activitypartition); if (represents instanceof NamedElement) { activitypartitionName = ((NamedElement) represents).getName() ; } appendString(sb, activitypartitionName, UNNAMED); return; }
Source:
public void notifyChanged(Notification notification) { // Handle when a port is defined as conjugated if ((notification.getFeatureID(Property.class) == UMLPackage.PORT__IS_CONJUGATED)) { refreshDisplay(); } else { super.notifyChanged(notification); Object object = notification.getNotifier(); Property property = getUMLElement(); if ((object != null) && (property != null)) { // Handle also the case of opaque expression bodies changing if (notification.getFeature() == UMLPackage.Literals.OPAQUE_EXPRESSION__BODY) { refreshDisplay(); } } } }

Target:
public void notifyChanged(Notification notification) { // Handle when a port is defined as conjugated if (notification.getFeature() == UMLPackage.Literals.PORT__IS_CONJUGATED) { refreshDisplay(); } else { super.notifyChanged(notification); Object object = notification.getNotifier(); Property property = getUMLElement(); if ((object != null) && (property != null)) { // Handle also the case of opaque expression bodies changing if (notification.getFeature() == UMLPackage.Literals.OPAQUE_EXPRESSION__BODY) { refreshDisplay(); } } } }
Source:
private void initialize() { project = (IProject) getElement().getAdapter(IResource.class); if (project == null) { throw new RuntimeException( TasksUiPlugin.ID_PLUGIN + ": Can not get the project of " + getElement().toString()); //$NON-NLS-1$ } noDefaultAndApplyButton(); setDescription( Messages.ProjectTaskRepositoryPage_Select_a_task_repository_to_associate_with_this_project_below); }

Target:
private void initialize() { project = (IProject) getElement().getAdapter(IResource.class); if (project == null) { throw new RuntimeException( TasksUiPlugin.ID_PLUGIN + ": Can not get the project of " + getElement()); //$NON-NLS-1$ } noDefaultAndApplyButton(); setDescription( Messages.ProjectTaskRepositoryPage_Select_a_task_repository_to_associate_with_this_project_below); }
Source:
protected IEclipseContext createContext(final Event trigger) { final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); //$NON-NLS-1$ staticContext.set(Event.class, trigger); return staticContext; }

Target:
private IEclipseContext createContext(final Event trigger) { final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); //$NON-NLS-1$ staticContext.set(Event.class, trigger); return staticContext; }
Source:
public BasicSymbolProviderPreferencePage(@NonNull BasicSymbolProvider provider) { super(provider); setDescription(MessageFormat.format(Messages.BasicSymbolProviderPrefPage_description, provider.getTrace().getName())); setValid(true); setTitle(MessageFormat.format(Messages.BasicSymbolProviderPrefPage_tabTitle, "GNU nm", provider.getTrace().getName())); //$NON-NLS-1$ }

Target:
public BasicSymbolProviderPreferencePage(@NonNull BasicSymbolProvider provider) { super(provider); setDescription(MessageFormat.format(Messages.BasicSymbolProviderPrefPage_description, provider.getTrace().getName())); setValid(true); setTitle(MessageFormat.format(Messages.BasicSymbolProviderPrefPage_tabTitle, provider.getTrace().getName())); }
Source:
public Collection<CallStackSeries> getCallStackSeries() { Collection<CallStackSeries> callstacks = fCallStacks; if (callstacks == null) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Objects.requireNonNull(Collections.emptyList()); } callstacks = Collections.singleton(new CallStackSeries(ss, PATTERNS, 0, "", getHostId(), new CallStackSeries.AttributeValueThreadResolver(1))); //$NON-NLS-1$ fCallStacks = callstacks; } return callstacks; }

Target:
public Collection<CallStackSeries> getCallStackSeries() { Collection<CallStackSeries> callstacks = fCallStacks; if (callstacks == null) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } callstacks = Collections.singleton(new CallStackSeries(ss, PATTERNS, 0, "", getHostId(), new CallStackSeries.AttributeValueThreadResolver(1))); //$NON-NLS-1$ fCallStacks = callstacks; } return callstacks; }
Source:
public void testMigrationIsNeededOnData() { Version migrationVersion = new SnapBackDistantLabelsMigrationParticipant().getMigrationVersion(); // Check that the migration of the session resource is needed. Version loadedVersion = checkRepresentationFileMigrationStatus(URI.createPlatformResourceURI(SiriusTestCase.TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), true); assertTrue("The migration must be required on test data.", loadedVersion == null || migrationVersion.compareTo(loadedVersion) > 0); }

Target:
public void testMigrationIsNeededOnData() { Version migrationVersion = new SnapBackDistantLabelsMigrationParticipant().getMigrationVersion(); // Check that the migration of the session resource is needed. Version loadedVersion = checkRepresentationFileMigrationStatus(URI.createPlatformResourceURI(SiriusTestCase.TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), true); assertTrue("The migration must be required on test data.", migrationVersion.compareTo(loadedVersion) > 0); }
Source:
protected @NonNull TmfViewer createLeftChildViewer(Composite parent) { CounterTreeViewer treeViewer = new CounterTreeViewer(parent); treeViewer.addSelectionChangeListener(new SelectionChangeListener()); // Initialize the viewers with the currently selected trace ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace); treeViewer.traceSelected(signal); setTrace(trace); } return treeViewer; }

Target:
protected @NonNull TmfViewer createLeftChildViewer(Composite parent) { CounterTreeViewer treeViewer = new CounterTreeViewer(parent); treeViewer.addSelectionChangeListener(new SelectionChangeListener()); // Initialize the viewers with the currently selected trace ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace); treeViewer.traceSelected(signal); } return treeViewer; }
Source:
public CommonXAxisModelBuilder addYSeries(IYSeries ySeries) { if (fXValues.length == 0) { throw new IllegalStateException("X values must be set before setting Y values"); //$NON-NLS-1$ } if (fXValues.length != ySeries.getDatapoints().length) { throw new IllegalStateException("All series in list must be of length : " + fXValues.length); //$NON-NLS-1$ } fYSeries.put(ySeries.getLabel(), ySeries); fModel = null; return this; }

Target:
public CommonXAxisModelBuilder addYSeries(IYSeries ySeries) { if (fXValues.length != ySeries.getDatapoints().length) { throw new IllegalStateException("All series in list must be of length : " + fXValues.length); //$NON-NLS-1$ } fYSeries.put(ySeries.getLabel(), ySeries); fModel = null; return this; }
Source:
public void setClosestMatch(String text) { System.out.println("matching text " + text); //$NON-NLS-1$ final boolean matchFound = ComboUtil.setClosestMatch(getCCombo(), text); // if no literal matches, reset to initial state if (!matchFound) { reset(); } }

Target:
public void setClosestMatch(String text) { final boolean matchFound = ComboUtil.setClosestMatch(getCCombo(), text); // if no literal matches, reset to initial state if (!matchFound) { reset(); } }
Source:
public void goToLastEvent() throws CTFException { long endTime = Long.MIN_VALUE; for (CTFStreamInputReader sir : fPrio) { sir.goToLastEvent(); IEventDefinition currentEvent = sir.getCurrentEvent(); if (currentEvent != null) { endTime = Math.max(currentEvent.getTimestamp(), endTime); } } setEndTime(fTrace.timestampCyclesToNanos(endTime)); // Go right before the end time, may be several events before the end but they // would all be the "last" event occurring at the same time seek(fTrace.timestampNanoToCycles(getEndTime())); }

Target:
public void goToLastEvent() throws CTFException { long endTime = Long.MIN_VALUE; for (CTFStreamInputReader sir : fPrio) { sir.goToLastEvent(); IEventDefinition currentEvent = sir.getCurrentEvent(); if (currentEvent != null) { endTime = Math.max(currentEvent.getTimestamp(), endTime); } } setEndTime(fTrace.timestampCyclesToNanos(endTime)); // Go right before the end time, may be several events before the end but they // would all be the "last" event occurring at the same time seek(endTime); }
Source:
public IPluginBase createPluginBase(boolean isFragment) { if (fPluginBase != null) return fPluginBase; if (isFragment) { fPluginBase = new FragmentNode(); fPluginBase.setXMLTagName("fragment"); //$NON-NLS-1$ } else { fPluginBase = new PluginNode(); fPluginBase.setXMLTagName("plugin"); //$NON-NLS-1$ } fPluginBase.setInTheModel(true); fPluginBase.setModel(this); return fPluginBase; }

Target:
public IPluginBase createPluginBase(boolean isFragment) { if (fPluginBase != null) { return fPluginBase; } if (isFragment) { fPluginBase = new FragmentNode(); fPluginBase.setXMLTagName("fragment"); //$NON-NLS-1$ } else { fPluginBase = new PluginNode(); fPluginBase.setXMLTagName("plugin"); //$NON-NLS-1$ } fPluginBase.setInTheModel(true); fPluginBase.setModel(this); return fPluginBase; }
Source:
public void registerHandler(ITraceEventHandler handler) { int pos = Collections.binarySearch(fHandlers, handler, HANDLER_COMPARATOR); if (pos < 0) { fHandlers.add(-pos - 1, handler); } else { fHandlers.add(handler); } }

Target:
public void registerHandler(ITraceEventHandler handler) { int pos = Collections.binarySearch(fHandlers, handler, HANDLER_COMPARATOR); if (pos < 0) { fHandlers.add(-pos - 1, handler); } // If pos >= 0, the handler is already in the list }
Source:
public static void incrementAttributeLong(ITmfStateSystemBuilder ssb, long t, int attributeQuark, long increment) { @Nullable Object stateValue = ssb.queryOngoing(attributeQuark); /* if the attribute was previously null, start counting at 0 */ long prevValue = 0; if (stateValue != null && stateValue instanceof Long) { prevValue = (long) stateValue; } ssb.modifyAttribute(t, prevValue + increment, attributeQuark); }

Target:
public static void incrementAttributeLong(ITmfStateSystemBuilder ssb, long t, int attributeQuark, long increment) { Object stateValue = ssb.queryOngoing(attributeQuark); /* if the attribute was previously null, start counting at 0 */ long prevValue = 0; if (stateValue != null && stateValue instanceof Long) { prevValue = (long) stateValue; } ssb.modifyAttribute(t, prevValue + increment, attributeQuark); }
Source:
public static void incrementAttributeInt(ITmfStateSystemBuilder ssb, long t, int attributeQuark, int increment) throws StateValueTypeException, AttributeNotFoundException { Object stateValue = ssb.queryOngoing(attributeQuark); /* if the attribute was previously null, start counting at 0 */ int prevValue = 0; if (stateValue != null && stateValue instanceof Integer) { prevValue = (int) stateValue; } ssb.modifyAttribute(t, prevValue + increment, attributeQuark); }

Target:
public static void incrementAttributeInt(ITmfStateSystemBuilder ssb, long t, int attributeQuark, int increment) { Object stateValue = ssb.queryOngoing(attributeQuark); /* if the attribute was previously null, start counting at 0 */ int prevValue = 0; if (stateValue instanceof Integer) { prevValue = (int) stateValue; } ssb.modifyAttribute(t, prevValue + increment, attributeQuark); }
Source:
public void setExecuteOnKeyRelease(boolean executeOnKeyRelease) { this.executeOnKeyRelease = executeOnKeyRelease; }

Target:
protected void setExecuteOnKeyRelease(boolean executeOnKeyRelease) { this.executeOnKeyRelease = executeOnKeyRelease; }
Source:
public boolean handles(final Table table, final Object axisElement) { final String id = AxisUtils.getPropertyId(axisElement); // Handle only the Requirement::text column in Requirement table return (null != id && id.equals(SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID)); }

Target:
public boolean handles(final Table table, final Object axisElement) { // Handle only the Requirement::text column in Requirement table return (SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID.equals(AxisUtils.getPropertyId(axisElement))); }
Source:
public TmfResolvedSymbol getSymbolEntry(long address) { Entry<Long, TmfResolvedSymbol> floorEntry = fSymbolMapping.floorEntry(address); if (floorEntry == null) { return null; } // See if the symbol returned is the end of a block, in this case, don't // use the floor unless it hits the exact address TmfResolvedSymbol symbol = floorEntry.getValue(); long floorValue = symbol.getBaseAddress(); if (symbol.getSymbolName().endsWith(getEndSuffix()) && floorValue != address) { return null; } return symbol; }

Target:
public TmfResolvedSymbol getSymbolEntry(long address) { Entry<Long, TmfResolvedSymbol> floorEntry = fSymbolMapping.floorEntry(address); if (floorEntry == null) { return null; } // See if the symbol returned is the end of a block, in this case, don't // use the floor unless it hits the exact address TmfResolvedSymbol symbol = floorEntry.getValue(); long floorValue = symbol.getBaseAddress(); return (symbol.getSymbolName().endsWith(getEndSuffix()) && floorValue != address) ? null : symbol; }
Source:
private boolean userRequestedSpecificFile(MIBreakpoint miBpt) { assert isFunctionBreakpoint(miBpt); String originalLocation = miBpt.getOriginalLocation(); boolean userRequestedSpecificFile = originalLocation != null && originalLocation.contains(":"); //$NON-NLS-1$ return userRequestedSpecificFile; }

Target:
private boolean userRequestedSpecificFile(MIBreakpoint miBpt) { assert isFunctionBreakpoint(miBpt); String originalLocation = miBpt.getOriginalLocation(); return originalLocation != null && originalLocation.contains(":"); //$NON-NLS-1$ }
Source:
protected void selectCellToFillToDown(final TreeNattableModelManager treeManager) { System.out.println(treeManager.getBodyLayerStack().getSelectionLayer().getCellByPosition(0, 0).getDataValue().toString()); treeManager.getBodyLayerStack().getSelectionLayer().setSelectedCell(0, 0); }

Target:
protected void selectCellToFillToDown(final TreeNattableModelManager treeManager) { treeManager.getBodyLayerStack().getSelectionLayer().setSelectedCell(0, 0); }
Source:
private static boolean isEntry(ITmfEvent event) { String phase = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); return "B" == phase || phase == "s"; //$NON-NLS-1$ //$NON-NLS-2$ }

Target:
private static boolean isEntry(ITmfEvent event) { String phase = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); return "B".equals(phase) || "s".equals(phase); //$NON-NLS-1$ //$NON-NLS-2$ }
Source:
protected boolean isExitState(EObject model) { if (currentModel == null) { return false; } if (model == null) { return true; } if (model != currentModel) { // return true; } return false; }

Target:
protected boolean isExitState(EObject model) { return currentModel != null && model == null; }
Source:
public Collection<Tuple> get(Tuple signature) { Object bucket = matchings.get(signature); if (bucket instanceof MarkedSet<?>) { return (Collection<Tuple>) bucket; } else { // singleton or empty if (bucket == null) return null; return Collections.singleton((Tuple)bucket); } }

Target:
public Collection<Tuple> get(Tuple signature) { Object bucket = matchings.get(signature); if (bucket instanceof MarkedSet<?>) { return (MarkedSet<Tuple>) bucket; } else { // singleton or empty if (bucket == null) return null; return Collections.singleton((Tuple)bucket); } }
Source:
static URI getStereotypeURI(EObject stereotypeApplication) { return EcoreUtil.getURI(stereotypeApplication.eClass()); }

Target:
private static URI getStereotypeURI(EObject stereotypeApplication) { return EcoreUtil.getURI(stereotypeApplication.eClass()); }
Source:
static <K, L, V> V put(Map<K, Map<L, V>> mapOfMaps, K key1, L key2, V value) { Map<L, V> map = mapOfMaps.get(key1); if (map == null) { map = Maps.newHashMap(); mapOfMaps.put(key1, map); } return map.put(key2, value); }

Target:
private static <K, L, V> V put(Map<K, Map<L, V>> mapOfMaps, K key1, L key2, V value) { Map<L, V> map = mapOfMaps.get(key1); if (map == null) { map = new HashMap<>(); mapOfMaps.put(key1, map); } return map.put(key2, value); }
Source:
public void enterModule(ModuleInfo moduleInfo) { this.indexer.addModuleDeclaration(moduleInfo.moduleName); if (moduleInfo.requires != null) { for (ISourceElementRequestor.RequiresInfo req : moduleInfo.requires) { if (req == null || req.moduleName == null || req.moduleName == CharOperation.NO_CHAR) { continue; } this.indexer.addModuleReference(req.moduleName); } } enterPackageVisibilityInfo(moduleInfo.exports); enterPackageVisibilityInfo(moduleInfo.opens); /* note: provides and uses directives processed automatically on IParser (SEParser) */ }

Target:
public void enterModule(ModuleInfo moduleInfo) { this.indexer.addModuleDeclaration(moduleInfo.moduleName); if (moduleInfo.requires != null) { for (ISourceElementRequestor.RequiresInfo req : moduleInfo.requires) { if (req == null || req.moduleName == null || req.moduleName == CharOperation.NO_CHAR) continue; this.indexer.addModuleReference(req.moduleName); } } enterPackageVisibilityInfo(moduleInfo.exports); enterPackageVisibilityInfo(moduleInfo.opens); /* note: provides and uses directives processed automatically on IParser (SEParser) */ }
Source:
private void updateExportDialogAutoScaleSettings(boolean value) { IDialogSettings settings = getExportDialogSettings(); settings.put(AbstractExportRepresentationsAsImagesDialog.AUTO_SCALE_SETTING_PROPERTY, value); if (value) { // full autoScale used settings.put(AbstractExportRepresentationsAsImagesDialog.SCALE_LEVEL_SETTING_PROPERTY, 100); } else { // no autoScale used settings.put(AbstractExportRepresentationsAsImagesDialog.SCALE_LEVEL_SETTING_PROPERTY, 0); } }

Target:
private void updateExportDialogAutoScaleSettings(boolean value) { IDialogSettings settings = getExportDialogSettings(); settings.put(AbstractExportRepresentationsAsImagesDialog.AUTO_SCALE_SETTING_PROPERTY, value); if (value) { // full autoScale used settings.put(AbstractExportRepresentationsAsImagesDialog.SCALE_LEVEL_SETTING_PROPERTY, 10); } else { // no autoScale used settings.put(AbstractExportRepresentationsAsImagesDialog.SCALE_LEVEL_SETTING_PROPERTY, 0); } }
Source:
public static LocalFile cleanLfsBlob(Repository db, InputStream originalContent) throws IOException { LocalFile buffer = new TemporaryBuffer.LocalFile(null); CleanFilter f = new CleanFilter(db, originalContent, buffer); while (f.run() != -1) { // loop as long as command.run() tells there is work to do } return buffer; }

Target:
public static TemporaryBuffer cleanLfsBlob(Repository db, InputStream originalContent) throws IOException { LocalFile buffer = new TemporaryBuffer.LocalFile(null); CleanFilter f = new CleanFilter(db, originalContent, buffer); try { while (f.run() != -1) { // loop as long as f.run() tells there is work to do } } catch (IOException e) { buffer.close(); throw e; } return buffer; }
Source:
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainerMappingFontColor() { selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class); bot.viewByTitle("Properties").setFocus(); SWTBotSiriusHelper.selectPropertyTabItem("Appearance"); try { bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR); fail(); } catch (WidgetNotFoundException e) { assertTrue(true); } }

Target:
public void testNoDefaulColortMenuInAppearancePropertyViewFromContainerMappingFontColor() { selectAndCheckEditPart(NODE_CONTAINER, DNodeContainerEditPart.class); bot.viewByTitle("Properties").setFocus(); SWTBotSiriusHelper.selectPropertyTabItem("Appearance"); try { bot.viewByTitle("Properties").bot().buttonInGroup("Fonts and Colors:", 0).click().contextMenu(DEFAULT_COLOR); fail(); } catch (WidgetNotFoundException e) { // Expected exception, do nothing. } }
Source:
public void setStatusLineManager(IStatusLineManager statusLineManager) { if (fStatusLineManager != null && statusLineManager == null) { fStatusLineManager.setMessage(""); //$NON-NLS-1$ } fStatusLineManager = statusLineManager; }

Target:
public void setStatusLineManager(IStatusLineManager statusLineManager) { if (fStatusLineManager != null && statusLineManager == null) { fStatusLineManager.setMessage(null); } fStatusLineManager = statusLineManager; }
Source:
public Object addInheritableProperty(String key, Object value) { if (getNonInheritableProperties().containsKey(key)) { final Object oldValue = getNonInheritableProperties().get(key); getNonInheritableProperties().removeKey(key); getInheritableProperties().put(key, value); return oldValue; } return getInheritableProperties().put(key, value); }

Target:
public Object addInheritableProperty(String key, Object value) { if (getNonInheritableProperties().containsKey(key)) { // removes the entry with the given key (due to EMap interface instead of Map) final Object oldValue = getNonInheritableProperties().removeKey(key); getInheritableProperties().put(key, value); return oldValue; } return getInheritableProperties().put(key, value); }
Source:
public String getName() { // String name = ""; //$NON-NLS-1$ StringBuilder name = new StringBuilder(); for (int i = 0; i < (input.length - 1); i++) { name.append(input[i].getName() + "/"); //$NON-NLS-1$ } name.append(input[input.length - 1].getName()); return name.toString(); }

Target:
public String getName() { StringBuilder name = new StringBuilder(); for (int i = 0; i < (input.length - 1); i++) { name.append(input[i].getName()).append("/"); //$NON-NLS-1$ } name.append(input[input.length - 1].getName()); return name.toString(); }
Source:
public boolean setSubtreeChecked(Object element, boolean state) { IPreCheckStateListener preCheckStateListener = fPreCheckStateListener; if (preCheckStateListener != null && preCheckStateListener.setSubtreeChecked(element, state)) { // uncheck the root element setChecked(element, false); return false; } checkSubtree(element, state); return fCheckboxTreeViewer.setSubtreeChecked(element, state); }

Target:
public boolean setSubtreeChecked(Object element, boolean state) { checkSubtree(element, state); return fCheckboxTreeViewer.setSubtreeChecked(element, state); }
Source:
public @NonNull String getPresetFilterName(String presetFilterId) { String presetFilterName = null; if (fPresetFilterName != null) { presetFilterName = fPresetFilterName.get(presetFilterId); } if (presetFilterName == null && fPresetFilter != null) { presetFilterName = fPresetFilter.get(fPresetFilter.indexOf(presetFilterId)); } return presetFilterName == null ? "" : presetFilterName; //$NON-NLS-1$ }

Target:
public @NonNull String getPresetFilterName(String presetFilterId) { String presetFilterName = presetFilterId; if (fPresetFilterName != null) { presetFilterName = fPresetFilterName.get(presetFilterId); } return presetFilterName == null ? "" : presetFilterName; //$NON-NLS-1$ }
Source:
private static final HostThread readHostThread(ISafeByteBufferReader buffer) { /* the first short = the size to read */ short valueSize = buffer.getShort(); byte[] array = new byte[valueSize]; buffer.get(array); String host = new String(array, CHARSET); /* Confirm the 0'ed byte at the end */ if (buffer.get() != 0) { throw new IllegalStateException("Host thread's host could not be correctly serialized / deserialized"); //$NON-NLS-1$ } int tid = buffer.getInt(); return new HostThread(host, tid); }

Target:
private static final HostThread readHostThread(ISafeByteBufferReader buffer) { String host = buffer.getString(); int tid = buffer.getInt(); return new HostThread(host, tid); }
Source:
static void flushUIEvents() { final Display display = Display.getCurrent(); for (;;) { if (!display.readAndDispatch()) { break; } } }

Target:
static void flushUIEvents() { final Display display = Display.getCurrent(); while (display.readAndDispatch()) { // Nothing to do } }
Source:
public void bundleChanged(BundleEvent event) { int eventType = event.getType(); // Note: no calls to any non-trivial Eclipse code outside this class // should be made inside the synchronized block below. Such calls // can cause deadlocks on startup, see bug 502095. // Progress monitor calls *are* non-trivial. synchronized (this) { if (eventType == BundleEvent.STARTED) { progressMonitor.split(4); String symbolicName = event.getBundle().getSymbolicName(); String taskName = NLS.bind(WorkbenchMessages.Startup_Loading, symbolicName); progressMonitor.subTask(taskName); } } }

Target:
public void bundleChanged(BundleEvent event) { int eventType = event.getType(); // Note: no calls to any non-trivial Eclipse code outside this class // should be made inside the synchronized block below. Such calls // can cause deadlocks on startup, see bug 502095. // Progress monitor calls *are* non-trivial. if (eventType == BundleEvent.STARTED) { progressMonitor.split(10); String symbolicName = event.getBundle().getSymbolicName(); String taskName = NLS.bind(WorkbenchMessages.Startup_Loading, symbolicName); progressMonitor.subTask(taskName); } }
Source:
private static void appendBodyColorsRule(StringBuilder buffer, RGB fgRGB, RGB bgRGB) { StringBuilder fg= new StringBuilder(); appendColor(fg, fgRGB); StringBuilder bg= new StringBuilder(); appendColor(bg, bgRGB); buffer.append("body {color:"); //$NON-NLS-1$ appendColor(buffer, fgRGB); buffer.append("; background-color:"); //$NON-NLS-1$ appendColor(buffer, bgRGB); buffer.append(";}"); //$NON-NLS-1$ }

Target:
private static void appendBodyColorsRule(StringBuilder buffer, RGB fgRGB, RGB bgRGB) { buffer.append("body {color:"); //$NON-NLS-1$ appendColor(buffer, fgRGB); buffer.append("; background-color:"); //$NON-NLS-1$ appendColor(buffer, bgRGB); buffer.append(";}"); //$NON-NLS-1$ }
Source:
private String insanelyHugeCommitMessage() { StringBuilder b = new StringBuilder(HUGE_SIZE); // Give the message a real header; otherwise even writing the reflog // message may run into troubles because RevCommit.getShortMessage() // will return the whole message. b.append("An insanely huge commit message\n\n"); String oneLine = "012345678901234567890123456789012345678901234567890123456789\n"; while (b.length() < HUGE_SIZE) { b.append(oneLine); } return b.toString(); }

Target:
private String insanelyHugeCommitMessage() { final String oneLine = "012345678901234567890123456789012345678901234567890123456789\n"; StringBuilder b = new StringBuilder(HUGE_SIZE + oneLine.length()); // Give the message a real header; otherwise even writing the reflog // message may run into troubles because RevCommit.getShortMessage() // will return the whole message. b.append("An insanely huge commit message\n\n"); while (b.length() < HUGE_SIZE) { b.append(oneLine); } return b.toString(); }
Source:
public static boolean isInvalidBranchName(String branchName) { if (HEAD.equals(branchName)) { return true; } if ((R_HEADS + HEAD).equals(branchName)) { return true; } return branchName.startsWith("-"); //$NON-NLS-1$ }

Target:
public static boolean isInvalidBranchName(String branchName) { if (HEAD.equals(branchName)) { return true; } return branchName.startsWith("-"); //$NON-NLS-1$ }
Source:
private void setNormalBackgroundColor() { if (noResults) { Color currentColor = patternField.getBackground(); patternField.setData(CCS_CLASS_KEY, null); patternField.reskin(SWT.ALL); patternField.update(); if (currentColor.equals(patternField.getBackground())) { // If the theme has no definition for the text field's // background, it remains unchanged. Reset it to the SWT default // in that case. patternField.setBackground(null); } noResults = false; } }

Target:
private void setNormalBackgroundColor() { if (noResults) { Color currentColor = patternField.getBackground(); patternField.setData(CCS_CLASS_KEY, null); patternField.reskin(SWT.ALL); if (currentColor.equals(patternField.getBackground())) { // If the theme has no definition for the text field's // background, it remains unchanged. Reset it to the SWT default // in that case. patternField.setBackground(null); } noResults = false; } }
Source:
private boolean checkAppElementByBundleSymbolicNameAndClass(String bundleSymbolicName, String className) { Collection<BundleWiring> wirings = findWirings(bundleSymbolicName, bundleContext); if (!isBundleClassAvailable(wirings, className)) { // remove application element, if there is not wiring available // or if the class cannot be found return false; } return true; }

Target:
private boolean checkAppElementByBundleSymbolicNameAndClass(String bundleSymbolicName, String className) { Collection<BundleWiring> wirings = findWirings(bundleSymbolicName, bundleContext); // remove application element, if there is not wiring available // or if the class cannot be found return isBundleClassAvailable(wirings, className); }
Source:
public void addControl(String id, Control control) { if (controls.containsKey(id)) { throw new IllegalArgumentException( MessageFormat.format("A control with id {0} already exists", id)); //$NON-NLS-1$ } controls.put(id, control); }

Target:
protected void addControl(String id, Control control) { if (controls.containsKey(id)) { throw new IllegalArgumentException( MessageFormat.format("A control with id {0} already exists", id)); //$NON-NLS-1$ } controls.put(id, control); }
Source:
private void createShallowFile(ObjectId... shallowCommits) throws IOException { // Reset the RevWalk since the new shallow file invalidates the existing // RevWalk's shallow state. rw = createRevWalk(); StringBuilder builder = new StringBuilder(); for (ObjectId commit : shallowCommits) { builder.append(commit.getName() + "\n"); } JGitTestUtil.write(new File(db.getDirectory(), "shallow"), builder.toString()); }

Target:
private void createShallowFile(ObjectId... shallowCommits) throws IOException { // Reset the RevWalk since the new shallow file invalidates the existing // RevWalk's shallow state. rw.close(); rw = createRevWalk(); StringBuilder builder = new StringBuilder(); for (ObjectId commit : shallowCommits) { builder.append(commit.getName() + "\n"); } JGitTestUtil.write(new File(db.getDirectory(), "shallow"), builder.toString()); }
Source:
public SiriusGraphQLPlugin() { super(new ResourceLocator[0]); }

Target:
private SiriusGraphQLPlugin() { super(new ResourceLocator[0]); }
Source:
public void suspendedLineDifferStaysSuspendedAfterDocumentRewriteSession() throws Exception { // given fLineDiffer.connect(fDocument); fLineDiffer.suspend(); // when fDocument.startRewriteSession(SEQUENTIAL); fDocument.stopRewriteSession(fDocument.getActiveRewriteSession()); // then assertFalse(fLineDiffer.isSuspended()); assertFalse(fLineDiffer.isSynchronized()); }

Target:
public void suspendedLineDifferStaysSuspendedAfterDocumentRewriteSession() throws Exception { // given fLineDiffer.connect(fDocument); fLineDiffer.suspend(); // when fDocument.startRewriteSession(SEQUENTIAL); fDocument.stopRewriteSession(fDocument.getActiveRewriteSession()); // then assertTrue(fLineDiffer.isSuspended()); }
Source:
public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { PresentationReconcilerCPP.this.setupDocument(newInput); }

Target:
public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { setupDocument(newInput); }
Source:
protected static String getLineDelimiterPreference(IFile file) { IScopeContext[] scopeContext; if (file != null) { ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE); return TextUtilities.getDefaultLineDelimiter(buffer.getDocument()); } // workspace preference scopeContext = new IScopeContext[] { InstanceScope.INSTANCE }; return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); }

Target:
protected static String getLineDelimiterPreference(IFile file) { if (file != null) { ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE); if (buffer != null) { return TextUtilities.getDefaultLineDelimiter(buffer.getDocument()); } } return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, null); }
Source:
private void updateEnableStates() { boolean enabledCodeMining= getCheckBox(PREF_CODEMINING_ENABLED).getSelection(); if (enabledCodeMining) { // Show references checkboxes boolean showReferences= getCheckBox(PREF_SHOW_REFERENCES).getSelection(); getCheckBox(PREF_SHOW_REFERENCES_ON_CLASSES).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_FIELDS).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_METHODS).setEnabled(showReferences); // Show implementations checkboxes boolean showImplementations= getCheckBox(PREF_SHOW_IMPLEMENTATIONS).getSelection(); } else { atLeastOneCheckBox.setEnabled(false); fFilteredPrefTree.setEnabled(false); } }

Target:
private void updateEnableStates() { boolean enabledCodeMining= getCheckBox(PREF_CODEMINING_ENABLED).getSelection(); if (enabledCodeMining) { // Show references checkboxes boolean showReferences= getCheckBox(PREF_SHOW_REFERENCES).getSelection(); getCheckBox(PREF_SHOW_REFERENCES_ON_CLASSES).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_FIELDS).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_METHODS).setEnabled(showReferences); // Show implementations checkboxes getCheckBox(PREF_SHOW_IMPLEMENTATIONS).getSelection(); } else { atLeastOneCheckBox.setEnabled(false); fFilteredPrefTree.setEnabled(false); } }
Source:
private void handlePropertyChangeEvent(PropertyChangeEvent event) { if (fPreferenceStore == null) { return; // Uninstalled during event notification } if (fEditor != null && fEditor.affectsJavaCodeMining(event, false)) { if (isJavaCodeMiningEnabled()) { enable(); } else { disable(); } } }

Target:
private void handlePropertyChangeEvent(PropertyChangeEvent event) { if (fPreferenceStore == null) { return; // Uninstalled during event notification } if (fEditor != null && fEditor.affectsJavaCodeMining(event)) { if (isJavaCodeMiningEnabled()) { enable(); } else { disable(); } } }
Source:
private CommunicationChannel getComChannel(boolean local, Event sourceEvent, Connection connection) { CommunicationChannel channel = communicationModel.getChannels().get(sourceEvent); if (channel == null) { if(connection instanceof EventConnection) { //currently only add a channel if an event, data connection should attach to existing channels channel = new CommunicationChannel(); channel.setSourceEvent(sourceEvent); channel.setLocal(local); communicationModel.getChannels().put(sourceEvent, channel); } } else if (!local) { //force non local if needed channel.setLocal(false); } return channel; }

Target:
private CommunicationChannel getComChannel(boolean local, Event sourceEvent, Connection connection) { CommunicationChannel channel = communicationModel.getChannels().get(sourceEvent); if (null == channel) { if(connection instanceof EventConnection) { //currently only add a channel if an event, data connection should attach to existing channels channel = new CommunicationChannel(); channel.setSourceEvent(sourceEvent); channel.setLocal(local); communicationModel.getChannels().put(sourceEvent, channel); } } else if (!local) { //force non local if needed channel.setLocal(false); } return channel; }
Source:
public static boolean isShowingEntireContents(StyledText widget) { if (widget.getTopPixel() != 0) // more efficient shortcut return false; int lastVisiblePixel= computeLastVisiblePixel(widget); int bottom= widget.getLineIndex(lastVisiblePixel); if (bottom + 1 < widget.getLineCount()) // There's definitely more lines below return false; // Check whether the last line is fully visible int bottomLastPixel= getLinePixel(widget, bottom + 1) - 1; return bottomLastPixel <= lastVisiblePixel; }

Target:
public static boolean isShowingEntireContents(StyledText widget) { if (widget.getTopPixel() != 0) { // more efficient shortcut return false; } int lastVisiblePixel= computeLastVisiblePixel(widget); int bottom= widget.getLineIndex(lastVisiblePixel); if (bottom + 1 < widget.getLineCount()) { // There's definitely more lines below return false; } // Check whether the last line is fully visible int bottomLastPixel= getLinePixel(widget, bottom + 1) - 1; return bottomLastPixel <= lastVisiblePixel; }
Source:
private boolean allBranchOperationsSucceeded( final @NonNull Map<Repository, CheckoutResult> results) { return results.entrySet().stream() // .map(Map.Entry::getValue) // .allMatch(r -> r.getStatus() == CheckoutResult.Status.OK); }

Target:
private boolean allBranchOperationsSucceeded( final @NonNull Map<Repository, CheckoutResult> results) { return results.values().stream() .allMatch(r -> r.getStatus() == CheckoutResult.Status.OK); }
Source:
private boolean anyRepositoryIsInDetachedHeadState( final @NonNull Map<Repository, CheckoutResult> results) { return results.entrySet().stream() // .map(Map.Entry::getKey) // .anyMatch(RepositoryUtil::isDetachedHead); }

Target:
private boolean anyRepositoryIsInDetachedHeadState( final @NonNull Map<Repository, CheckoutResult> results) { return results.keySet().stream() .anyMatch(RepositoryUtil::isDetachedHead); }
Source:
private static List<? extends ICodeMining> logCodeMiningProviderException(Throwable e) { String PLUGIN_ID= "org.eclipse.jface.text"; //$NON-NLS-1$ ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e)); return new ArrayList<>(); }

Target:
private static void logCodeMiningProviderException(Throwable e) { String PLUGIN_ID= "org.eclipse.jface.text"; //$NON-NLS-1$ ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e)); }
Source:
private void createPaintListener(final Table rawTable) { // Tell SWT we will completely handle painting for some columns. // rawTable.addListener(SWT.EraseItem, new Listener() { @Override public void handleEvent(final Event event) { if (0 <= event.index && event.index <= 5) event.detail &= ~SWT.FOREGROUND; } }); rawTable.addListener(SWT.PaintItem, new Listener() { @Override public void handleEvent(final Event event) { doPaint(event); } }); }

Target:
private void createPaintListener(final Table rawTable) { // Tell SWT we will completely handle painting for some columns. // rawTable.addListener(SWT.EraseItem, new Listener() { @Override public void handleEvent(final Event event) { if (event.index == 1) { event.detail &= ~SWT.FOREGROUND; } } }); rawTable.addListener(SWT.PaintItem, new Listener() { @Override public void handleEvent(final Event event) { if (event.index == 1) { doPaint(event); } } }); }
Source:
private String hostName(String host, int port) { if (port == SSH_PORT) { return host; } return String.format("[%s]:%d", host, port); }

Target:
private static String hostName(String host, int port) { if (port == SSH_PORT) { return host; } return String.format("[%s]:%d", host, port); //$NON-NLS-1$ }
Source:
public synchronized void addChild(AbstractCalledFunction child, AggregatedCalledFunction aggregatedChild) { // Update the child's statistics with itself fSelfTime -= aggregatedChild.getDuration(); if (child.getDepth() >= 0) { aggregatedChild.getFunctionStatistics().update(child); } AggregatedCalledFunction node = fChildren.get(aggregatedChild.getSymbol()); if (node == null) { fChildren.put(aggregatedChild.getSymbol(), aggregatedChild); } else { merge(node, aggregatedChild); } }

Target:
public synchronized void addChild(AbstractCalledFunction child, AggregatedCalledFunction aggregatedChild) { // Update the child's statistics with itself if (child.getDepth() >= 0) { fSelfTime -= aggregatedChild.getDuration(); aggregatedChild.getFunctionStatistics().update(child); } AggregatedCalledFunction node = fChildren.get(aggregatedChild.getSymbol()); if (node == null) { fChildren.put(aggregatedChild.getSymbol(), aggregatedChild); } else { merge(node, aggregatedChild); } }
Source:
public static void assertValidSubmoduleUri(String uri) throws SubmoduleValidationException { if (uri.startsWith("-")) { //$NON-NLS-1$ throw new SubmoduleValidationException( MessageFormat.format( JGitText.get().submoduleUrlInvalid, uri), ObjectChecker.ErrorType.GITMODULES_URL); } }

Target:
public static void assertValidSubmoduleUri(String uri) throws SubmoduleValidationException { if (uri.startsWith("-")) { //$NON-NLS-1$ throw new SubmoduleValidationException( MessageFormat.format( JGitText.get().submoduleUrlInvalid, uri), GITMODULES_URL); } }
Source:
protected @Nullable String getSegmentType(@NonNull ISegment segment) { if (segment instanceof ICalledFunction) { ICalledFunction calledFunction = (ICalledFunction) segment; // FIXME work around this trace ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { Object symbol = calledFunction.getSymbol(); return String.valueOf(symbol); } } return null; }

Target:
protected @Nullable String getSegmentType(@NonNull ISegment segment) { if (segment instanceof ICalledFunction) { ICalledFunction calledFunction = (ICalledFunction) segment; return String.valueOf(calledFunction.getSymbol()); } return null; }