auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onUserRestrictionsChanged() { final Bundle restrictions = mUserManager.getUserRestrictions(); final boolean newlyDisallowed = restrictions.getBoolean(UserManager.DISALLOW_CONFIG_TETHERING); final boolean prevDisallowed = mDisallowTethering; mDisallowTethering = newlyDisallowed; final boolean tetheringDisallowedChanged = (newlyDisallowed != prevDisallowed); if (!tetheringDisallowedChanged) { return; } final boolean isTetheringActiveOnDevice = (mWrapper.getTetheredIfaces().length != 0); final boolean disallowedTethering = newlyDisallowed && isTetheringActiveOnDevice; if (disallowedTethering) { mWrapper.untetherAll(); } mNotificationUpdater.onUserRestrictionsChanged(disallowedTethering); }

Target:
public void onUserRestrictionsChanged() { final Bundle restrictions = mUserManager.getUserRestrictions(); final boolean newlyDisallowed = restrictions.getBoolean(UserManager.DISALLOW_CONFIG_TETHERING); final boolean prevDisallowed = mDisallowTethering; mDisallowTethering = newlyDisallowed; final boolean tetheringDisallowedChanged = (newlyDisallowed != prevDisallowed); if (!tetheringDisallowedChanged) { return; } final boolean isTetheringActiveOnDevice = (mWrapper.getTetheredIfaces().length != 0); final boolean tetheringRestricted = newlyDisallowed && isTetheringActiveOnDevice; if (tetheringRestricted) { mWrapper.untetherAll(); } mNotificationUpdater.onTetheringRestrictionsChanged(tetheringRestricted); }
Source:
private GlusterBrickEntity getBrickEntity(GlusterVolumeEntity volume, Map<String, Object> brick) { String brickName = (String) brick.get(BRICK); String glusterHostUuid = (String) brick.get(HOST_UUID); if (!StringUtils.isEmpty(glusterHostUuid)) { GlusterServer glusterServer = GlusterDBUtils.getInstance().getServerByUuid(Guid.createGuidFromString(glusterHostUuid)); if (glusterServer == null) { log.warnFormat("Could not update brick {0} to volume {1} - server uuid {2} not found", brickName, volume.getName(), glusterHostUuid); return null; } String[] brickParts = brickName.split(":", -1); if (brickParts.length != 2) { log.warnFormat("Invalid brick representation [" + brickName + "]"); return null; } String brickDir = brickParts[1]; VdsStatic server = DbFacade.getInstance().getVdsStaticDao().get(glusterServer.getId()); return DbFacade.getInstance().getGlusterBrickDao().getBrickByServerIdAndDirectory(server.getId(), brickDir); } return GlusterCoreUtil.getBrickByQualifiedName(volume.getBricks(), brickName); }

Target:
private GlusterBrickEntity getBrickEntity(GlusterVolumeEntity volume, Map<String, Object> brick) { String brickName = (String) brick.get(BRICK); String glusterHostUuid = (String) brick.get(HOST_UUID); if (!StringUtils.isEmpty(glusterHostUuid)) { GlusterServer glusterServer = GlusterDBUtils.getInstance().getServerByUuid(Guid.createGuidFromString(glusterHostUuid)); if (glusterServer == null) { log.warnFormat("Could not update brick {0} to volume {1} - server uuid {2} not found", brickName, volume.getName(), glusterHostUuid); return null; } String[] brickParts = brickName.split(":", -1); if (brickParts.length != 2) { log.warnFormat("Invalid brick representation [" + brickName + "]"); return null; } String brickDir = brickParts[1]; return DbFacade.getInstance().getGlusterBrickDao().getBrickByServerIdAndDirectory(glusterServer.getId(), brickDir); } return GlusterCoreUtil.getBrickByQualifiedName(volume.getBricks(), brickName); }
Source:
private void updateVmStatistics(VM vmToUpdate) { if (_vdsManager.getRefreshStatistics()) { VmStatistics vmStatistics = _runningVms.get(vmToUpdate.getId()).getVmStatistics(); vmToUpdate.updateRunTimeStatisticsData(vmStatistics, vmToUpdate); addVmStatisticsToList(vmToUpdate.getStatisticsData()); updateInterfaceStatistics(vmToUpdate, vmStatistics); for (DiskImageDynamic imageDynamic : _runningVms.get(vmToUpdate.getId()).getVmDynamic().getDisks()) { Disk disk = getDbFacade().getDiskDao().get(imageDynamic.getId()); if (disk instanceof DiskImage) { DiskImage diskImage = (DiskImage) disk; Guid ActiveImageId = diskImage.getImageId(); imageDynamic.setId(ActiveImageId); _vmDiskImageDynamicToSave.put(ActiveImageId, imageDynamic); } } } }

Target:
private void updateVmStatistics(VM vmToUpdate) { if (_vdsManager.getRefreshStatistics()) { VmStatistics vmStatistics = _runningVms.get(vmToUpdate.getId()).getVmStatistics(); vmToUpdate.updateRunTimeStatisticsData(vmStatistics, vmToUpdate); addVmStatisticsToList(vmToUpdate.getStatisticsData()); updateInterfaceStatistics(vmToUpdate, vmStatistics); for (DiskImageDynamic imageDynamic : _runningVms.get(vmToUpdate.getId()).getVmDynamic().getDisks()) { Disk disk = getDbFacade().getDiskDao().get(imageDynamic.getId()); if (disk instanceof DiskImage) { DiskImage diskImage = (DiskImage) disk; Guid activeImageId = diskImage.getImageId(); imageDynamic.setId(activeImageId); _vmDiskImageDynamicToSave.put(activeImageId, imageDynamic); } } } }
Source:
@Override public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { if (arguments.length != 2) { throw new UDFArgumentLengthException("The function split_map_privs(s, ' ') takes exactly 2 arguments."); } converters = new ObjectInspectorConverters.Converter[arguments.length]; for (int i = 0; i < arguments.length; i++) { converters[i] = ObjectInspectorConverters .getConverter(arguments[i], PrimitiveObjectInspectorFactory.writableStringObjectInspector); } ObjectInspector rightArg = arguments[1]; if (rightArg instanceof ConstantObjectInspector) { constPattern = Pattern.compile(((ConstantObjectInspector) rightArg). getWritableConstantValue().toString()); } return ObjectInspectorFactory .getStandardListObjectInspector(PrimitiveObjectInspectorFactory.writableStringObjectInspector); }

Target:
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { checkArgsSize(arguments, 1, 1); checkArgPrimitive(arguments, 0); converters[0] = ObjectInspectorConverters .getConverter(arguments[0], PrimitiveObjectInspectorFactory.writableStringObjectInspector); return ObjectInspectorFactory .getStandardListObjectInspector(PrimitiveObjectInspectorFactory.writableStringObjectInspector); }
Source:
public ReadRequest(ByteBuf buf) { address = ICorfuPayload.fromBuffer(buf, Long.class); }

Target:
public ReadRequest(ByteBuf buf) { address = buf.readLong(); }
Source:
private boolean requiresIncomingDecoration(AbstractAttributeEditor editor, TaskDataModel model, TaskAttribute attribute) { return editor.isDecorationEnabled() && model.hasBeenRead() && model.hasIncomingChanges(attribute) && isCompatibleKind(attribute.getMetaData().getKind()) ? true : false; }

Target:
private boolean requiresIncomingDecoration(AbstractAttributeEditor editor, TaskDataModel model, TaskAttribute attribute) { return editor.isDecorationEnabled() && model.hasBeenRead() && model.hasIncomingChanges(attribute) && isCompatibleKind(attribute.getMetaData().getKind()); }
Source:
public void onWikipediaZeroInterstitialEvent(final WikipediaZeroInterstitialEvent event) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.zero_interstitial_title)); alert.setMessage(getString(R.string.zero_interstitial_leave_app)); alert.setPositiveButton(getString(R.string.zero_interstitial_continue), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Utils.visitInExternalBrowser(EditSectionActivity.this, event.getUri()); } }); alert.setNegativeButton(getString(R.string.zero_interstitial_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); alert.setNeutralButton(getString(R.string.nav_item_preferences), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { visitSettings(); } }); final AlertDialog ad = alert.create(); ad.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface d) { ad.getButton(DialogInterface.BUTTON_NEGATIVE).setTypeface(Typeface.DEFAULT, Typeface.BOLD); } }); ad.show(); }

Target:
public void onWikipediaZeroInterstitialEvent(final WikipediaZeroInterstitialEvent event) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.zero_interstitial_title)); alert.setMessage(getString(R.string.zero_interstitial_leave_app)); alert.setPositiveButton(getString(R.string.zero_interstitial_continue), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Utils.visitInExternalBrowser(EditSectionActivity.this, event.getUri()); } }); alert.setNegativeButton(getString(R.string.zero_interstitial_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); AlertDialog ad = alert.create(); ad.show(); }
Source:
public void eventDispatched(IExitedDMEvent event) { IMemoryDMContext context = DMContexts.getAncestorOfType(event.getDMContext(), IMemoryDMContext.class); if (context != null) { fAddressSizes.remove(context); } }

Target:
public void eventDispatched(IExitedDMEvent event) { if (event.getDMContext() instanceof IContainerDMContext) { IMemoryDMContext context = DMContexts.getAncestorOfType(event.getDMContext(), IMemoryDMContext.class); if (context != null) { fAddressSizes.remove(context); } } }
Source:
public void setup(OperatorContext context) { super.setup(context); physicalPartitionId = context.getId(); partitionedFileName = String.format(partitionedFileNameformat, outputFileName, physicalPartitionId); }

Target:
public void setup(OperatorContext context) { super.setup(context); physicalPartitionId = context.getId(); if (StringUtils.isEmpty(partitionedFileNameformat)) { partitionedFileName = outputFileName; } else { partitionedFileName = String.format(partitionedFileNameformat, outputFileName, physicalPartitionId); } }
Source:
public void execute() throws Exception { if (!ElasticsearchProcessMonitor.isElasticsearchStarted()) { String exceptionMsg = "Elasticsearch is not yet started, check back again later"; logger.info(exceptionMsg); return; } HealthBean healthBean = new HealthBean(); try { Client esTransportClient = ESTransportClient.instance(config).getTransportClient(); ClusterHealthStatus clusterHealthStatus = esTransportClient.admin().cluster().prepareHealth().setTimeout(MASTER_NODE_TIMEOUT).execute().get().getStatus(); ClusterHealthResponse clusterHealthResponse = esTransportClient.admin().cluster().prepareHealth().execute().actionGet(MASTER_NODE_TIMEOUT); if (clusterHealthStatus == null) { logger.info("ClusterHealthStatus is null,hence returning (No Health)."); resetHealthStats(healthBean); return; } if (clusterHealthStatus.name().equalsIgnoreCase("GREEN")) { healthBean.greenorredstatus = 0; healthBean.greenoryellowstatus = 0; } else if (clusterHealthStatus.name().equalsIgnoreCase("YELLOW")) { healthBean.greenoryellowstatus = 1; healthBean.greenorredstatus = 0; } else if (clusterHealthStatus.name().equalsIgnoreCase("RED")) { healthBean.greenorredstatus = 1; healthBean.greenoryellowstatus = 0; } if(config.isNodeMismatchWithDiscoveryEnabled()) healthBean.nodematch = (clusterHealthResponse.getNumberOfNodes() == instanceManager.getAllInstances().size()) ? 0 : 1; else healthBean.nodematch = (clusterHealthResponse.getNumberOfNodes() == config.getDesiredNumberOfNodesInCluster()) ? 0 : 1; if(config.isEurekaHealthCheckEnabled()) healthBean.eurekanodematch = (clusterHealthResponse.getNumberOfNodes() == discoveryClient.getApplication(config.getAppName()).getInstances().size()) ? 0 : 1; } catch(Exception e) { resetHealthStats(healthBean); logger.warn("failed to load Cluster Health Status", e); } healthBean.esuponinstance = ElasticsearchProcessMonitor.isElasticsearchStarted() ? 1 : 0; healthReporter.healthBean.set(healthBean); }

Target:
public void execute() throws Exception { HealthBean healthBean = new HealthBean(); if (instanceManager.isMaster()) { reportClusterMetrics(healthBean); } healthBean.esuponinstance = ElasticsearchProcessMonitor.isElasticsearchStarted() ? 1 : 0; healthReporter.healthBean.set(healthBean); }
Source:
public void onAutoConnectClicked() { autoConnectStep.showProgressBar(); String lastKnowReader = RetailSDK.getDeviceManager().getLastActiveBluetoothReader(); RetailSDK.getDeviceManager().scanAndAutoConnectToBluetoothReader(null, new DeviceManager.ConnectionCallback() { @Override public void connection(final RetailSDKException error, final PaymentDevice cardReader) { ReaderConnectionActivity.this.runOnUiThread(new Runnable() { @Override public void run() { autoConnectStep.hideProgressBarShowButton(); if (error == null && cardReader != null) { onReaderConnected(cardReader); } else if (error != null) { Toast.makeText(getApplicationContext(), "Connection to a reader failed with error: " + error, Toast.LENGTH_SHORT).show(); Log.e(LOG_TAG, "Connection to a reader failed with error: " + error); } else { Toast.makeText(getApplicationContext(), "Could not find the last card reader to connect to", Toast.LENGTH_SHORT).show(); Log.d(LOG_TAG, "Could not find the last card reader to connect to"); } } }); } }); }

Target:
public void onAutoConnectClicked() { autoConnectStep.showProgressBar(); String lastKnowReader = RetailSDK.getDeviceManager().getLastActiveBluetoothReader(); RetailSDK.getDeviceManager().scanAndAutoConnectToBluetoothReader(lastKnowReader, new DeviceManager.ConnectionCallback() { @Override public void connection(final RetailSDKException error, final PaymentDevice cardReader) { ReaderConnectionActivity.this.runOnUiThread(new Runnable() { @Override public void run() { autoConnectStep.hideProgressBarShowButton(); if (error == null && cardReader != null) { onReaderConnected(cardReader); } else if (error != null) { Toast.makeText(getApplicationContext(), "Connection to a reader failed with error: " + error, Toast.LENGTH_SHORT).show(); Log.e(LOG_TAG, "Connection to a reader failed with error: " + error); } else { Toast.makeText(getApplicationContext(), "Could not find the last card reader to connect to", Toast.LENGTH_SHORT).show(); Log.d(LOG_TAG, "Could not find the last card reader to connect to"); } } }); } }); }
Source:
public Object[] resolve(Method method) { DroneContext context = droneContext.get(); InjectionPoint<?>[] injectionPoints = InjectionPoints.parametersInMethod(method); Object[] resolution = new Object[injectionPoints.length]; for (int i = 0; i < injectionPoints.length; i++) { InjectionPoint<?> injectionPoint = injectionPoints[i]; if (injectionPoint == null) { resolution[i] = null; continue; } log.log(Level.FINE, "Injecting @Drone for method {0}, argument {1} @{2} ", new Object[] { method.getName(), injectionPoint.getDroneType().getSimpleName(), injectionPoint.getQualifier().getSimpleName() }); Object drone = context.getDrone(injectionPoint); Validate.notNull(drone, "Retrieved a null from Drone Context, which is not a valid Drone browser object"); resolution[i] = drone; } return resolution; }

Target:
public Object[] resolve(Method method) { DroneContext context = droneContext.get(); InjectionPoint<?>[] injectionPoints = InjectionPoints.parametersInMethod(method); Object[] resolution = new Object[injectionPoints.length]; for (int i = 0; i < injectionPoints.length; i++) { InjectionPoint<?> injectionPoint = injectionPoints[i]; if (injectionPoint == null) { resolution[i] = null; continue; } ensureInjectionPointPrepared(injectionPoint); log.log(Level.FINE, "Injecting @Drone for method {0}, injection point {1}", new Object[] { method.getName(), injectionPoint } ); Object drone = context.getDrone(injectionPoint); Validate.stateNotNull(drone, "Retrieved a null from Drone Context, which is not a valid Drone browser object" + ".\nMethod: {0}, injection point: {1},", method.getName(), injectionPoint); resolution[i] = drone; } return resolution; }
Source:
public String toString() { return String.format("ProductBranding [id: %s, name: %s, productId: %s, type: %s]", this.getId(), this.getName(), this.getProductId(), this.getType()); }

Target:
public String toString() { return String.format("Branding [id: %s, name: %s, productId: %s, type: %s]", this.getId(), this.getName(), this.getProductId(), this.getType()); }
Source:
private boolean isRemoveService(OperationContext context, ModelNode operation) { if (context.isNormalServer()) { if (operation.hasDefined(OPERATION_HEADERS) && operation.get(OPERATION_HEADERS).hasDefined(ALLOW_RESOURCE_SERVICE_RESTART) && operation.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).asBoolean()) { context.removeService(MBeanServerService.SERVICE_NAME); return true; } } return false; }

Target:
private boolean isRemoveService(OperationContext context, ModelNode operation) { if (context.isNormalServer()) { if (context.isResourceServiceRestartAllowed()) { context.removeService(MBeanServerService.SERVICE_NAME); return true; } } return false; }
Source:
private long createConfigurableDependencyMap(Configuration config, SelectableFeature feature) { if (!(feature.getFeature().getFeatureModel() instanceof ExtendedFeatureModel)) { return 0; } int numberOfConfigurableAttributes = 0; for (IFeatureStructure child : feature.getFeature().getStructure().getChildren()) { numberOfConfigurableAttributes += createConfigurableDependencyMap(config, config.getSelectableFeature(child.getFeature())); } if (feature.getSelection() == Selection.SELECTED) { ExtendedFeature extFeature = (ExtendedFeature) feature.getFeature(); numberOfConfigurableAttributes += extFeature.getAttributes().stream().filter(att -> att.isConfigurable()).count(); if (numberOfConfigurableAttributes > 0) { configurableFilterList.add(feature.getFeature().getName()); } } return numberOfConfigurableAttributes; }

Target:
private int createConfigurableDependencyMap(Configuration config, SelectableFeature feature) { if (!(feature.getFeature().getFeatureModel() instanceof ExtendedFeatureModel)) { return 0; } int numberOfConfigurableAttributes = 0; for (IFeatureStructure child : feature.getFeature().getStructure().getChildren()) { numberOfConfigurableAttributes += createConfigurableDependencyMap(config, config.getSelectableFeature(child.getFeature())); } if (feature.getSelection() == Selection.SELECTED) { ExtendedFeature extFeature = (ExtendedFeature) feature.getFeature(); numberOfConfigurableAttributes += extFeature.getAttributes().stream().filter(att -> att.isConfigurable()).count(); if (numberOfConfigurableAttributes > 0) { configurableFilterList.add(feature.getFeature().getName()); } } return numberOfConfigurableAttributes; }
Source:
public void processEvent(GlusterEvent event) { if (event == null) { return; } GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid(Guid.createGuidFromString(event.getNodeId())); if (glusterServer == null) { return; } VDS host = vdsDao.get(glusterServer.getId()); if (host == null) { return; } if (event.getEvent().equalsIgnoreCase("EVENT_GEOREP_CHECKPOINT_COMPLETED")) { GlusterVolumeEntity masterVol = glusterVolumeDao.getByName(host.getClusterId(), (String) event.getMessage().get("master_volume")); if (masterVol == null) { log.debug("Could not determine master volume from event '{}'", event); return; } GlusterGeoRepSession session = geoRepDao.getGeoRepSession(masterVol.getId(), (String) event.getMessage().get("slave_host"), (String) event.getMessage().get("slave_volume")); if (session != null) { log.debug("received event for session '{}'", session.getSessionKey()); } GlusterGeoRepSyncJob.getInstance().refreshGeoRepDataForVolume(masterVol); } }

Target:
public void processEvent(GlusterEvent event) { if (event == null) { log.debug("No event to process!"); return; } GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid(Guid.createGuidFromString(event.getNodeId())); if (glusterServer == null) { log.debug("Could not determine gluster server from event '{}'", event); return; } VdsStatic host = vdsStaticDao.get(glusterServer.getId()); if (host == null) { log.debug("No host corresponding to gluster server in '{}'", event); return; } if (event.getEvent().equalsIgnoreCase(EVENT_GEOREP_CHECKPOINT_COMPLETED)) { GlusterVolumeEntity masterVol = glusterVolumeDao.getByName(host.getClusterId(), (String) event.getMessage().get(MASTER_VOLUME)); if (masterVol == null) { log.debug("Could not determine master volume from event '{}'", event); return; } GlusterGeoRepSession session = geoRepDao.getGeoRepSession(masterVol.getId(), (String) event.getMessage().get(SLAVE_HOST), (String) event.getMessage().get(SLAVE_VOLUME)); if (session != null) { log.debug("received event for session '{}'", session.getSessionKey()); } GlusterGeoRepSyncJob.getInstance().refreshGeoRepDataForVolume(masterVol); } }
Source:
private void write(SetMultimap<ModelWithPayload<Series>, ModelWithPayload<Episode>> seriesAndEpisodes, Brand brand) { for (Entry<ModelWithPayload<Series>, Collection<ModelWithPayload<Episode>>> seryAndEpisodes : seriesAndEpisodes.asMap().entrySet()) { Series series = null; ModelWithPayload<Series> seryModelWithPayload = seryAndEpisodes.getKey(); if (seryModelWithPayload.getModel().getCanonicalUri() != null) { series = resolveAndUpdate(seryModelWithPayload.getModel()); series.setParent(brand); checkUri(series); checkSource(brand); writer.createOrUpdate(seryModelWithPayload.getModel(), (seryModelWithPayload.getPayload() != null) ? seryModelWithPayload.getPayload() : ""); } for (ModelWithPayload<Episode> episodeModelWithPayload : seryAndEpisodes.getValue()) { try { Episode episode = episodeModelWithPayload.getModel(); episode = resolveAndUpdate(episode); episode.setContainer(brand); if (series != null) { episode.setSeries(series); } checkUri(episode); checkSource(episode); writer.createOrUpdate(episode, (episodeModelWithPayload.getPayload() != null) ? episodeModelWithPayload.getPayload() : ""); } catch (Exception e) { log.warn("Failed to write " + episodeModelWithPayload.getModel().getCanonicalUri(), e); } } } }

Target:
private void write(SetMultimap<ModelWithPayload<Series>, ModelWithPayload<Episode>> seriesAndEpisodes, Brand brand) { for (Entry<ModelWithPayload<Series>, Collection<ModelWithPayload<Episode>>> seryAndEpisodes : seriesAndEpisodes.asMap().entrySet()) { Series series = null; ModelWithPayload<Series> seryModelWithPayload = seryAndEpisodes.getKey(); if (seryModelWithPayload.getModel().getCanonicalUri() != null) { series = resolveAndUpdate(seryModelWithPayload.getModel()); series.setParent(brand); checkUri(series); checkSource(brand); writer.createOrUpdate(seryModelWithPayload.getModel(), seryModelWithPayload.getPayload()); } for (ModelWithPayload<Episode> episodeModelWithPayload : seryAndEpisodes.getValue()) { try { Episode episode = episodeModelWithPayload.getModel(); episode = resolveAndUpdate(episode); episode.setContainer(brand); if (series != null) { episode.setSeries(series); } checkUri(episode); checkSource(episode); writer.createOrUpdate(episode, episodeModelWithPayload.getPayload()); } catch (Exception e) { log.warn("Failed to write " + episodeModelWithPayload.getModel().getCanonicalUri(), e); } } } }
Source:
private String downloadSegmentToLocal(String uri, PinotCrypter crypter, String tableName, String segmentName) throws Exception { File tempDir = new File(new File(_instanceDataManager.getSegmentFileDirectory(), tableName), "tmp-" + segmentName + "-" + UUID.randomUUID()); FileUtils.forceMkdir(tempDir); File tempDownloadFile = new File(tempDir, segmentName + ENCODED_SUFFIX); File tempTarFile = new File(tempDir, segmentName + TAR_GZ_SUFFIX); File tempSegmentDir = new File(tempDir, segmentName); try { SegmentFetcherFactory.fetchSegmentToLocal(uri, tempDownloadFile); if (crypter != null) { crypter.decrypt(tempDownloadFile, tempTarFile); } else { tempTarFile = tempDownloadFile; } LOGGER .info("Downloaded tarred segment: for table: from: to: {}, file length: {}", segmentName, tableName, uri, tempTarFile, tempTarFile.length()); try { File tempIndexDir = TarGzCompressionUtils.untar(tempTarFile, tempSegmentDir).get(0); File indexDir = new File(new File(_instanceDataManager.getSegmentDataDirectory(), tableName), segmentName); if (indexDir.exists()) { LOGGER.info("Deleting existing index directory for segment: for table: {}", segmentName, tableName); FileUtils.deleteDirectory(indexDir); } FileUtils.moveDirectory(tempIndexDir, indexDir); LOGGER.info("Successfully downloaded segment: for table: to: {}", segmentName, tableName, indexDir); return indexDir.getAbsolutePath(); } catch (Exception e) { _serverMetrics.addMeteredTableValue(tableName, ServerMeter.UNTAR_FAILURES, 1L); throw e; } } finally { FileUtils.deleteQuietly(tempDir); } }

Target:
private String downloadSegmentToLocal(String uri, PinotCrypter crypter, String tableName, String segmentName) throws Exception { File tempDir = new File(new File(_instanceDataManager.getSegmentFileDirectory(), tableName), "tmp-" + segmentName + "-" + UUID.randomUUID()); FileUtils.forceMkdir(tempDir); File tempDownloadFile = new File(tempDir, segmentName + ENCODED_SUFFIX); File tempTarFile = new File(tempDir, segmentName + TAR_GZ_SUFFIX); File tempSegmentDir = new File(tempDir, segmentName); try { SegmentFetcherFactory.fetchSegmentToLocal(uri, tempDownloadFile); if (crypter != null) { crypter.decrypt(tempDownloadFile, tempTarFile); } else { tempTarFile = tempDownloadFile; } LOGGER .info("Downloaded tarred segment: for table: from: to: {}, file length: {}", segmentName, tableName, uri, tempTarFile, tempTarFile.length()); try { File tempIndexDir = TarGzCompressionUtils.untar(tempTarFile, tempSegmentDir).get(0); File indexDir = new File(new File(_instanceDataManager.getSegmentDataDirectory(), tableName), segmentName); if (indexDir.exists()) { LOGGER.info("Deleting existing index directory for segment: for table: {}", segmentName, tableName); FileUtils.deleteDirectory(indexDir); } FileUtils.moveDirectory(tempIndexDir, indexDir); LOGGER.info("Successfully downloaded segment: for table: to: {}", segmentName, tableName, indexDir); return indexDir.getAbsolutePath(); } catch (Exception e) { _serverMetrics.addMeteredTableValue(tableName, ServerMeter.UNTAR_FAILURES, 1L); Utils.rethrowException(e); return null; } } finally { FileUtils.deleteQuietly(tempDir); } }
Source:
private static void refreshBorderFigure(final BorderedStyle borderedStyle, final StyledFigure styledFigure) { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); if (styledFigure instanceof Shape) { styledFigure.setBorder(null); ((Shape) styledFigure).setOutline(false); ((Shape) styledFigure).setOutlineXOR(false); } else { styledFigure.setBorder(lineBorder); } } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); final RGBValues borderColor = borderedStyle.getBorderColor(); if (borderColor != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderColor)); } if (borderSize == 0) { if (!(styledFigure instanceof NoteFigure)) { styledFigure.setBorder(null); } } }

Target:
private static void refreshBorderFigure(final BorderedStyle borderedStyle, final StyledFigure styledFigure) { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); if (styledFigure instanceof Shape) { styledFigure.setBorder(null); ((Shape) styledFigure).setOutline(false); } else { styledFigure.setBorder(lineBorder); } } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); final RGBValues borderColor = borderedStyle.getBorderColor(); if (borderColor != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderColor)); } if (borderSize == 0) { if (!(styledFigure instanceof NoteFigure)) { styledFigure.setBorder(null); if (styledFigure instanceof Shape) { ((Shape) styledFigure).setOutline(false); } } else { if (styledFigure instanceof Shape) { ((Shape) styledFigure).setOutline(true); } } } }
Source:
public static void cleanDirectBuffer(ByteBuffer buf) { if (cleanMethod != null) { try { cleanMethod.invoke(cleanerMethod.invoke(buf)); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) { } } else if (invokeCleanerMethod != null) { try { invokeCleanerMethod.invoke(unsafe, buf); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) { e.printStackTrace(); } } }

Target:
public static void cleanDirectBuffer(ByteBuffer buf) { if (cleanMethod != null) { try { cleanMethod.invoke(cleanerMethod.invoke(buf)); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) { logger.warn("Error while cleaning up the DirectBuffer", e); } } else if (invokeCleanerMethod != null) { try { invokeCleanerMethod.invoke(unsafe, buf); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) { logger.warn("Error while cleaning up the DirectBuffer", e); } } }
Source:
void addChild(final PlotCommit c) { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; else if (cnt == 1) { if (!c.getId().equals(children[0].getId())) children = new PlotCommit[] { children[0], c }; } else { for (int i = 0; i < children.length; i++) if (c.getId().equals(children[i].getId())) return; final PlotCommit[] n = new PlotCommit[cnt + 1]; System.arraycopy(children, 0, n, 0, cnt); n[cnt] = c; children = n; } }

Target:
void addChild(final PlotCommit c) { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; else if (cnt == 1) { if (!c.getId().equals(children[0].getId())) children = new PlotCommit[] { children[0], c }; } else { for (PlotCommit pc : children) if (c.getId().equals(pc.getId())) return; final PlotCommit[] n = new PlotCommit[cnt + 1]; System.arraycopy(children, 0, n, 0, cnt); n[cnt] = c; children = n; } }
Source:
private int displayPackageFilePath(String pckg, int userId) throws RemoteException { final PrintWriter pw = getOutPrintWriter(); PackageInfo info = mInterface.getPackageInfo(pckg, 0, userId); if (info != null && info.applicationInfo != null) { pw.print("package:"); pw.println(info.applicationInfo.sourceDir); if (!ArrayUtils.isEmpty(info.applicationInfo.splitSourceDirs)) { for (String splitSourceDir : info.applicationInfo.splitSourceDirs) { pw.print("package:"); pw.println(splitSourceDir); } } return 0; } else { final int getApexFlags = PackageManager.MATCH_APEX | PackageManager.MATCH_UNINSTALLED_PACKAGES; @SuppressWarnings("unchecked") final ParceledListSlice<PackageInfo> slice = mInterface .getInstalledPackages(getApexFlags, userId); for (PackageInfo pi : slice.getList()) { if (pi.packageName.equals(pckg)) { info = pi; break; } } if (info != null && info.applicationInfo != null) { pw.print("package:"); pw.println(info.applicationInfo.sourceDir); return 0; } } return 1; }

Target:
private int displayPackageFilePath(String pckg, int userId) throws RemoteException { PackageInfo info = mInterface.getPackageInfo(pckg, PackageManager.MATCH_APEX, userId); if (info != null && info.applicationInfo != null) { final PrintWriter pw = getOutPrintWriter(); pw.print("package:"); pw.println(info.applicationInfo.sourceDir); if (!ArrayUtils.isEmpty(info.applicationInfo.splitSourceDirs)) { for (String splitSourceDir : info.applicationInfo.splitSourceDirs) { pw.print("package:"); pw.println(splitSourceDir); } } return 0; } return 1; }
Source:
public ContainerChillModeRule(String ruleName, EventQueue eventQueue, Configuration conf, List<ContainerInfo> containers, SCMChillModeManager manager) { super(manager, ruleName); chillModeCutoff = conf.getDouble( HddsConfigKeys.HDDS_SCM_CHILLMODE_THRESHOLD_PCT, HddsConfigKeys.HDDS_SCM_CHILLMODE_THRESHOLD_PCT_DEFAULT); if (chillModeCutoff > 1.0 || chillModeCutoff < 0.0) { throw new IllegalArgumentException(HddsConfigKeys. HDDS_SCM_CHILLMODE_THRESHOLD_PCT + " value should be >= 0.0 and <= " + "1.0"); } containerMap = new ConcurrentHashMap<>(); if(containers != null) { containers.forEach(c -> { if (c != null && c.getState() != null && !c.getState().equals(HddsProtos.LifeCycleState.OPEN)) { containerMap.put(c.getContainerID(), c); } }); maxContainer = containerMap.size(); } eventQueue.addHandler(SCMEvents.NODE_REGISTRATION_CONT_REPORT, this); }

Target:
public ContainerChillModeRule(String ruleName, EventQueue eventQueue, Configuration conf, List<ContainerInfo> containers, SCMChillModeManager manager) { super(manager, ruleName, eventQueue); chillModeCutoff = conf.getDouble( HddsConfigKeys.HDDS_SCM_CHILLMODE_THRESHOLD_PCT, HddsConfigKeys.HDDS_SCM_CHILLMODE_THRESHOLD_PCT_DEFAULT); Preconditions.checkArgument( (chillModeCutoff >= 0.0 && chillModeCutoff <= 1.0), HddsConfigKeys.HDDS_SCM_CHILLMODE_THRESHOLD_PCT + " value should be >= 0.0 and <= 1.0"); containerMap = new ConcurrentHashMap<>(); if(containers != null) { containers.forEach(c -> { if (c != null && c.getState() != null && !c.getState().equals(HddsProtos.LifeCycleState.OPEN)) { containerMap.put(c.getContainerID(), c); } }); maxContainer = containerMap.size(); } }
Source:
public String call(SQLDatabase db) throws Exception { Cursor cursor = null; try { cursor = db.rawQuery("SELECT value FROM info WHERE key='publicUUID'", null); if (cursor.moveToFirst()) { return "touchdb_" + cursor.getString(0); } else { throw new IllegalStateException("Error querying PublicUUID, " + "it is probably because the sqlDatabase is not probably " + "initialized."); } } finally { DatabaseUtils.closeCursorQuietly(cursor); } }

Target:
public String call(SQLDatabase db) throws Exception { Cursor cursor = null; try { cursor = db.rawQuery("SELECT value FROM info WHERE key='publicUUID'", null); if (cursor.moveToFirst()) { return "touchdb_" + cursor.getString(0); } else { throw new IllegalStateException("Error querying PublicUUID, " + "it is probably because the sqlDatabase is not properly " + "initialized."); } } finally { DatabaseUtils.closeCursorQuietly(cursor); } }
Source:
public void after() throws Exception { String output = docker.exec(options("-T"), "geode", arguments("cat", "server-dolores/server-dolores.log")); System.out.println("Server log file--------------------------------\n" + output); if (cache != null) { cache.close(); } }

Target:
public void after() throws Exception { if (cache != null) { cache.close(); } }
Source:
public List<CinderVolumeType> getVolumeTypes() { ArrayList<CinderVolumeType> cinderVolumeTypes = new ArrayList<>(); OpenStackRequest<VolumeTypes> listRequest = getClient(getTenantId()).volumeTypes().list(); VolumeTypes volumeTypes = listRequest.execute(); for (VolumeType volumeType : volumeTypes) { CinderVolumeType cinderVolumeType = new CinderVolumeType(); cinderVolumeType.setId(volumeType.getId()); cinderVolumeType.setName(volumeType.getName()); cinderVolumeType.setExtraSpecs(volumeType.getExtraSpecs()); cinderVolumeTypes.add(cinderVolumeType); } return cinderVolumeTypes; }

Target:
public List<CinderVolumeType> getVolumeTypes() { ArrayList<CinderVolumeType> cinderVolumeTypes = new ArrayList<>(); OpenStackRequest<VolumeTypes> listRequest = getClient(getTenantId()).volumeTypes().list(); VolumeTypes volumeTypes = listRequest.execute(); for (VolumeType volumeType : volumeTypes) { CinderVolumeType cinderVolumeType = new CinderVolumeType( volumeType.getId(), volumeType.getName(), volumeType.getExtraSpecs()); cinderVolumeTypes.add(cinderVolumeType); } return cinderVolumeTypes; }
Source:
public void testExecutePrimaryKeyLookupQuery() throws Exception { indexType2TweeterDocuments(); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); final Column[] pks = table.getPrimaryKeys().toArray(new Column[0]); try (DataSet ds = dataContext.query().from(table).selectAll().where(pks[0]).eq("tweet_tweet2_1").execute()) { assertTrue(ds.next()); final Object dateValue = ds.getRow().getValue(1); assertEquals("Row[values=[tweet_tweet2_1, " + dateValue + ", 1, user1]]", ds.getRow().toString()); assertFalse(ds.next()); assertEquals(InMemoryDataSet.class, ds.getClass()); } }

Target:
public void testExecutePrimaryKeyLookupQuery() throws Exception { indexType2TweeterDocuments(); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); final Column[] primaryKeys = table.getPrimaryKeys().toArray(new Column[0]); try (final DataSet dataSet = dataContext .query() .from(table) .selectAll() .where(primaryKeys[0]) .eq("tweet_tweet2_1") .execute()) { assertTrue(dataSet.next()); final Object dateValue = dataSet.getRow().getValue(1); assertEquals("Row[values=[tweet_tweet2_1, " + dateValue + ", 1, user1]]", dataSet.getRow().toString()); assertFalse(dataSet.next()); assertEquals(InMemoryDataSet.class, dataSet.getClass()); } }
Source:
private boolean userHasNoWorkspaces() { boolean userHasNoWorkspaces = false; String userId = getSessionUserIdOrUndefined(); if (!"undefined".equals(userId)) { try { Page<WorkspaceImpl> workspaces = workspaceManager.getWorkspaces(userId, false, 30, 0); if (workspaces.isEmpty()) { log.debug("User '{}' has no more workspaces left", userId); userHasNoWorkspaces = true; } } catch (ServerException e) { log.error( "Unable to get the number of workspaces for user '{}'. Cause: {}", userId, e.getMessage(), e); } } return userHasNoWorkspaces; }

Target:
private boolean userHasNoWorkspaces() { String userId = getSessionUserIdOrUndefined(); if (!"undefined".equals(userId)) { try { Page<WorkspaceImpl> workspaces = workspaceManager.getWorkspaces(userId, false, 1, 0); if (workspaces.isEmpty()) { log.debug("User '{}' has no more workspaces left", userId); return true; } } catch (ServerException e) { log.error( "Unable to get the number of workspaces for user '{}'. Cause: {}", userId, e.getMessage(), e); } } return false; }
Source:
default Collection<String> eventsNetworkSend() { return Collections.singleton("net_dev_queue"); }

Target:
default Collection<String> eventsNetworkSend() { return Collections.EMPTY_SET; }
Source:
public void checkWrite(Object key) { log.tracef("Check write for key=%s, status=%s", key, state); if (state == PartitionState.AVAILABLE) return; if (state == PartitionState.UNAVAILABLE) throw new AvailabilityException("Cluster is UNAVAILABLE because of node failures."); List<Address> owners = distributionManager.locate(key); if (! rpcManager.getTransport().getMembers().containsAll(owners)) { log.tracef("Partition is in %s mode, access is not allowed for key %s", state, key); throw new AvailabilityException("Not all owners of key '" + key + "' are in this partition"); } else { log.tracef("Key %s is writable.", key); } }

Target:
public void checkWrite(Object key) { doCheck(key); }
Source:
static <T> Try<T> ofCallable(Callable<? extends T> callable) { return of(callable::call); }

Target:
static <T> Try<T> ofCallable(Callable<? extends T> callable) { Objects.requireNonNull(callable, "callable is null"); return of(callable::call); }
Source:
protected void executeRuntimeStep(final OperationContext context, final ModelNode operation) throws OperationFailedException { ModifiableKeyStoreService keyStoreService = getModifiableKeyStoreService(context); KeyStore keyStore = keyStoreService.getModifiableValue(); String alias = ALIAS.resolveModelAttribute(context, operation).asString(); String path = PATH.resolveModelAttribute(context, operation).asString(); String relativeTo = RELATIVE_TO.resolveModelAttribute(context, operation).asStringOrNull(); PathResolver pathResolver = pathResolver(); File resolvedPath = ((KeyStoreService) keyStoreService).getResolvedPath(pathResolver, path, relativeTo); boolean pem = PEM.resolveModelAttribute(context, operation).asBoolean(); try { if (! keyStore.containsAlias(alias)) { throw ROOT_LOGGER.keyStoreAliasDoesNotExist(alias); } final X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); if (certificate == null) { throw ROOT_LOGGER.unableToObtainCertificate(alias); } try (FileOutputStream fos = new FileOutputStream(resolvedPath)) { if (pem) { ByteStringBuilder pemCertificate = new ByteStringBuilder(); Pem.generatePemX509Certificate(pemCertificate, certificate); fos.write(pemCertificate.toArray()); } else { fos.write(certificate.getEncoded()); } } } catch (Exception e) { if (e instanceof OperationFailedException) { throw (OperationFailedException) e; } else { throw new OperationFailedException(e); } } }

Target:
protected void executeRuntimeStep(final OperationContext context, final ModelNode operation) throws OperationFailedException { ModifiableKeyStoreService keyStoreService = getModifiableKeyStoreService(context); KeyStore keyStore = keyStoreService.getModifiableValue(); String alias = ALIAS.resolveModelAttribute(context, operation).asString(); String path = PATH.resolveModelAttribute(context, operation).asString(); String relativeTo = RELATIVE_TO.resolveModelAttribute(context, operation).asStringOrNull(); PathResolver pathResolver = pathResolver(); File resolvedPath = ((KeyStoreService) keyStoreService).getResolvedPath(pathResolver, path, relativeTo); boolean pem = PEM.resolveModelAttribute(context, operation).asBoolean(); try { if (! keyStore.containsAlias(alias)) { throw ROOT_LOGGER.keyStoreAliasDoesNotExist(alias); } final X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); if (certificate == null) { throw ROOT_LOGGER.unableToObtainCertificate(alias); } try (FileOutputStream fos = new FileOutputStream(resolvedPath)) { if (pem) { ByteStringBuilder pemCertificate = new ByteStringBuilder(); Pem.generatePemX509Certificate(pemCertificate, certificate); fos.write(pemCertificate.toArray()); } else { fos.write(certificate.getEncoded()); } } } catch (Exception e) { if (e instanceof OperationFailedException) { throw (OperationFailedException) e; } else { throw new RuntimeException(e); } } }
Source:
public static Date lastModified(Resource resource) { if (resource != null) { try { Value value = resource.adaptTo(Node.class).getProperty("cq:lastModified").getValue(); return value.getDate().getTime(); } catch (RepositoryException e) { e.printStackTrace(); } } return new Date(); }

Target:
static Date lastModified(Resource resource) { if (resource != null) { return resource.getValueMap().get(NameConstants.PN_LAST_MOD, new Date()); } return new Date(); }
Source:
protected Processor createLogger() throws Exception { Processor answer; CamelLogger camelLogger; LoggingLevel loggingLevel = LoggingLevel.INFO; if (level != null) { loggingLevel = LoggingLevel.valueOf(level); } if (providedLogger == null) { camelLogger = new CamelLogger(loggerName, loggingLevel, getMarker()); } else { camelLogger = new CamelLogger(providedLogger, loggingLevel, getMarker()); } if (getGroupSize() != null) { answer = new ThroughputLogger(camelLogger, getGroupSize()); } else if (getGroupInterval() != null) { Boolean groupActiveOnly = getGroupActiveOnly() != null ? getGroupActiveOnly() : Boolean.TRUE; Long groupDelay = getGroupDelay(); answer = new ThroughputLogger(camelLogger, this.getCamelContext(), getGroupInterval(), groupDelay, groupActiveOnly); } else { CamelLogProcessor processor = new CamelLogProcessor(camelLogger, localFormatter, getMaskingFormatter()); getCamelContext().getLogListeners().forEach(listener -> { if (listener != null) { processor.addLogListener(listener); } }); answer = processor; } setProcessor(answer); return answer; }

Target:
protected Processor createLogger() throws Exception { Processor answer; CamelLogger camelLogger; LoggingLevel loggingLevel = LoggingLevel.INFO; if (level != null) { loggingLevel = LoggingLevel.valueOf(level); } if (providedLogger == null) { camelLogger = new CamelLogger(loggerName, loggingLevel, getMarker()); } else { camelLogger = new CamelLogger(providedLogger, loggingLevel, getMarker()); } if (getGroupSize() != null) { answer = new ThroughputLogger(camelLogger, getGroupSize()); } else if (getGroupInterval() != null) { Boolean groupActiveOnly = getGroupActiveOnly() != null ? getGroupActiveOnly() : Boolean.TRUE; Long groupDelay = getGroupDelay(); answer = new ThroughputLogger(camelLogger, this.getCamelContext(), getGroupInterval(), groupDelay, groupActiveOnly); } else { answer = new CamelLogProcessor(camelLogger, localFormatter, getMaskingFormatter(), getCamelContext().getLogListeners()); } setProcessor(answer); return answer; }
Source:
public void register(ParseAuthenticationProvider provider) { final String authType = provider.getAuthType(); synchronized (lock) { if (authenticationProviders.containsKey(authType)) { throw new IllegalStateException("Another " + authType + " provider was already registered: " + authenticationProviders.get(authType)); } authenticationProviders.put(provider.getAuthType(), provider); } if (provider instanceof AnonymousAuthenticationProvider) { return; } controller.getAsync(false).onSuccess(new Continuation<ParseUser, Void>() { @Override public Void then(Task<ParseUser> task) throws Exception { ParseUser user = task.getResult(); if (user != null) { user.synchronizeAuthData(authType); } return null; } }); }

Target:
public void register(ParseAuthenticationProvider provider) { final String authType = provider.getAuthType(); if (authType == null) { throw new IllegalArgumentException("Invalid authType: " + null); } synchronized (lock) { if (authenticationProviders.containsKey(authType)) { throw new IllegalStateException("Another " + authType + " provider was already registered: " + authenticationProviders.get(authType)); } authenticationProviders.put(provider.getAuthType(), provider); } if (provider instanceof AnonymousAuthenticationProvider) { return; } controller.getAsync(false).onSuccess(new Continuation<ParseUser, Void>() { @Override public Void then(Task<ParseUser> task) throws Exception { ParseUser user = task.getResult(); if (user != null) { user.synchronizeAuthData(authType); } return null; } }); }
Source:
private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) { if (validationStatus.isOK()) { return; } final IStatus rootStatus = validationStatus; List allStatuses = new ArrayList(); SiriusDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new SiriusDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet(), allStatuses)); for (Iterator it = allStatuses.iterator(); it.hasNext();) { IConstraintStatus nextStatus = (IConstraintStatus) it.next(); DSemanticDecorator dSemanticDecorator = getDSemanticDecorator(nextStatus.getTarget(), diagramEditPart); if (dSemanticDecorator != null) { View view = SiriusGMFHelper.getGmfView(dSemanticDecorator); String qualifiedName = EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true); if (nextStatus instanceof RuleWrappingStatus) { createValidationRuleMarker((RuleWrappingStatus) nextStatus, diagramEditPart.getViewer(), target, view, qualifiedName, nextStatus.getMessage(), nextStatus.getSeverity()); } else { addMarker(diagramEditPart.getViewer(), target, view, qualifiedName, nextStatus.getMessage(), nextStatus.getSeverity()); } } } }

Target:
private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) { if (validationStatus.isOK()) { return; } final IStatus rootStatus = validationStatus; List allStatuses = new ArrayList(); collectTargetElements(rootStatus, new HashSet(), allStatuses); for (Iterator it = allStatuses.iterator(); it.hasNext();) { IConstraintStatus nextStatus = (IConstraintStatus) it.next(); DSemanticDecorator dSemanticDecorator = getDSemanticDecorator(nextStatus.getTarget(), diagramEditPart); if (dSemanticDecorator != null) { View view = SiriusGMFHelper.getGmfView(dSemanticDecorator); String qualifiedName = EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true); if (nextStatus instanceof RuleWrappingStatus) { createValidationRuleMarker((RuleWrappingStatus) nextStatus, diagramEditPart.getViewer(), target, view, qualifiedName, nextStatus.getMessage(), nextStatus.getSeverity()); } else { addMarker(diagramEditPart.getViewer(), target, view, qualifiedName, nextStatus.getMessage(), nextStatus.getSeverity()); } } } }
Source:
public List<ConditionImpl> getConditions() { return conditions; }

Target:
public List<Condition> getConditions() { return conditions; }