auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) { final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping); final DataCenterVO dc = _dcDao.findById(router.getDataCenterId()); String _dnsBasicZoneUpdates = _configDao.getValue(Config.DnsBasicZoneUpdates.key()); for (final UserVmVO vm : vms) { if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue() && _dnsBasicZoneUpdates.equalsIgnoreCase("pod")) { continue; } final NicVO nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId()); if (nic != null) { s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + "."); createDhcpEntryCommand(router, vm, nic, cmds); } } }

Target:
public void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) { final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping); final DataCenterVO dc = _dcDao.findById(router.getDataCenterId()); String dnsBasicZoneUpdates = _configDao.getValue(Config.DnsBasicZoneUpdates.key()); for (final UserVmVO vm : vms) { if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue() && dnsBasicZoneUpdates.equalsIgnoreCase("pod")) { continue; } final NicVO nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId()); if (nic != null) { s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + "."); createDhcpEntryCommand(router, vm, nic, cmds); } } }
Source:
public Schematic(String name){ this.name = name; this.userDefinedTypes = new HashMap<String, UserDefinedType>(); populateDefaultTypeDefinitions(); this.endpointTypes = new HashMap<String, EndpointType>(); this.nodeTypes = new HashMap<String, NodeType>(); this.connectionTypes = new HashMap<String, ConnectionType>(); this.constraintTypes = new HashMap<String, ConstraintType>(); this.nodes = new HashMap<String, Node>(); this.connections = new HashMap<String, Connection>(); this.constraints = new HashMap<String, Constraint>(); }

Target:
public Schematic(String name){ this.name = name; this.userDefinedTypes = new HashMap<String, Type>(); populateDefaultTypeDefinitions(); this.endpointTypes = new HashMap<String, EndpointType>(); this.nodeTypes = new HashMap<String, NodeType>(); this.connectionTypes = new HashMap<String, ConnectionType>(); this.constraintTypes = new HashMap<String, ConstraintType>(); this.nodes = new HashMap<String, Node>(); this.connections = new HashMap<String, Connection>(); this.constraints = new HashMap<String, Constraint>(); }
Source:
public void bindTo(MeterRegistry registry) { successTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "success")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); failTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "fail")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); eventService.subscribe( event -> { if (event.getPrevStatus() == WorkspaceStatus.STOPPED && event.getStatus() == WorkspaceStatus.STARTING) { workspaceStartTime.put(event.getWorkspaceId(), System.currentTimeMillis()); } else if (event.getPrevStatus() == WorkspaceStatus.STARTING) { Long startTime = workspaceStartTime.remove(event.getWorkspaceId()); if (startTime != null) { if (event.getStatus() == WorkspaceStatus.RUNNING) { successTimer.record(Duration.ofMillis(System.currentTimeMillis() - startTime)); } else if (event.getStatus() == WorkspaceStatus.STOPPED) { failTimer.record(Duration.ofMillis(System.currentTimeMillis() - startTime)); } } else { LOG.warn("No workspace start time recorded for workspace {}", event.getWorkspaceId()); } } }, WorkspaceStatusEvent.class); }

Target:
public void bindTo(MeterRegistry registry) { successTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "success")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); failTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "fail")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); eventService.subscribe(this::handleWorkspaceStatusChange, WorkspaceStatusEvent.class); }
Source:
public Future<RecordMetadata> report(ProcessingContext context) { if (!connConfig.enableErrorLog()) { return CompletableFuture.completedFuture(null); } if (!context.failed()) { return CompletableFuture.completedFuture(null); } log.error(message(context), context.error()); errorHandlingMetrics.recordErrorLogged(); return CompletableFuture.completedFuture(null); }

Target:
public Future<RecordMetadata> report(ProcessingContext context) { if (!connConfig.enableErrorLog()) { return COMPLETED; } if (!context.failed()) { return COMPLETED; } log.error(message(context), context.error()); errorHandlingMetrics.recordErrorLogged(); return COMPLETED; }
Source:
void initiate() { this.currentNonDurableLastAddConfirmed = lh.pendingAddsSequenceHead; LOG.debug("start force() on ledger capturing ", lh.ledgerId, currentNonDurableLastAddConfirmed); this.currentEnsemble = lh.metadata.currentEnsemble; this.ackSet = lh.distributionSchedule.getAckSetForForceLedger(); this.receivedResponseSet = new BitSet( lh.getLedgerMetadata().getEnsembleSize()); this.receivedResponseSet.set(0, lh.getLedgerMetadata().getEnsembleSize()); DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSetForForceLedger(); try { for (int i = 0; i < writeSet.size(); i++) { sendForceLedgerRequest(writeSet.get(i)); } } finally { writeSet.recycle(); } }

Target:
void initiate() { this.currentNonDurableLastAddConfirmed = lh.pendingAddsSequenceHead; if (LOG.isDebugEnabled()) { LOG.debug("force clientNonDurableLac {}", lh.ledgerId, currentNonDurableLastAddConfirmed); } this.currentEnsemble = lh.metadata.currentEnsemble; this.ackSet = lh.distributionSchedule.getEnsembleAckSet(); DistributionSchedule.WriteSet writeSet = lh.getDistributionSchedule() .getEnsembleSet(currentNonDurableLastAddConfirmed); try { for (int i = 0; i < writeSet.size(); i++) { sendForceLedgerRequest(writeSet.get(i)); } } finally { writeSet.recycle(); } }
Source:
public void collectMetrics(Request<?> request, Response<?> response) { final AWSRequestMetrics metrics = request.getAWSRequestMetrics(); if (metrics.isEnabled()) { final String[] tags = getTags(request, response); metrics.getTimingInfo().getAllCounters().forEach((name, count) -> { registry.gauge(registry.createId(counterName(name), tags), count); }); metrics.getTimingInfo().getSubMeasurementsByName().forEach((name, measurements) -> { final Timer timer = registry.timer(timerName(name), tags); measurements .stream() .filter(TimingInfo::isEndTimeKnown) .map(t -> t.getEndTimeNano() - t.getStartTimeNano()) .forEach(t -> timer.record(t, TimeUnit.NANOSECONDS)); }); } }

Target:
public void collectMetrics(Request<?> request, Response<?> response) { final AWSRequestMetrics metrics = request.getAWSRequestMetrics(); if (metrics.isEnabled()) { final Map<String, String> baseTags = getBaseTags(request); final TimingInfo timing = metrics.getTimingInfo(); for (Field counter : COUNTERS) { Optional.ofNullable(timing.getCounter(counter.name())) .filter(v -> v.longValue() > 0) .ifPresent(v -> registry.counter(metricId(counter, baseTags)).increment(v.longValue())); } for (Field timer : TIMERS) { Optional.ofNullable(timing.getLastSubMeasurement(timer.name())) .filter(TimingInfo::isEndTimeKnown) .ifPresent(t -> registry.timer(metricId(timer, baseTags)) .record(t.getEndTimeNano() - t.getStartTimeNano(), TimeUnit.NANOSECONDS)); } notEmpty(metrics.getProperty(Field.ThrottleException)).ifPresent(throttleExceptions -> { final Id throttling = metricId("throttling", baseTags); throttleExceptions.forEach(ex -> registry.counter(throttling.withTag("throttleException", ex.getClass().getSimpleName())) .increment()); }); } }
Source:
public Series<Object, Integer> generateSeries(JudgmentSeriesCriteria judgmentSeriesCriteria, XSettings xsettings) { JudgmentCriteria judgmentCriteria = judgmentSeriesCriteriaConverter.convert(judgmentSeriesCriteria); SolrQuery query = judgmentSearchQueryFactory.createQuery(judgmentCriteria, new Paging(0, 0)); xSettingsFacetQueryApplier.applyXSettingsToQuery(query, xsettings); QueryResponse response = null; try { response = solrServer.query(query); } catch (SolrServerException e) { log.warn("Error in generating series", e); return new Series<Object, Integer>(); } Series<Object, Integer> series = seriesResultsConverter.convertToSeries(response, xsettings.getField()); return series; }

Target:
public Series<Object, Integer> generateSeries(JudgmentSeriesCriteria judgmentSeriesCriteria, XSettings xsettings) { Preconditions.checkNotNull(judgmentSeriesCriteria); Preconditions.checkNotNull(xsettings); JudgmentCriteria judgmentCriteria = judgmentSeriesCriteriaConverter.convert(judgmentSeriesCriteria); SolrQuery query = judgmentSearchQueryFactory.createQuery(judgmentCriteria, new Paging(0, 0)); xSettingsToQueryApplier.applyXSettingsToQuery(query, xsettings); QueryResponse response = solrQueryExecutor.executeQuery(query); Series<Object, Integer> series = seriesResultConverter.convertToSeries(response, xsettings.getField()); return series; }
Source:
public DagBuilder(final String name, final DagProcessor dagProcessor) { requireNonNull(name, "The name of the DagBuilder can't be null"); requireNonNull(name, "The dagProcessor of the DagBuilder can't be null"); this.dag = new Dag(name, dagProcessor); }

Target:
public DagBuilder(final String name, final DagProcessor dagProcessor) { requireNonNull(name, "The name of the DagBuilder can't be null"); requireNonNull(dagProcessor, "The dagProcessor of the DagBuilder can't be null"); this.dag = new Dag(name, dagProcessor); }
Source:
public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { if (post.getUserCreated().getId() != topicStarter.getId()) { return false; } } return true; }

Target:
public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { if (post.getUserCreated().equals(topicStarter)) { return false; } } return true; }
Source:
public void testImageNoUrl() { builder.beginDocument(); builder.characters("a "); builder.image(new ImageAttributes(), null); builder.characters(" test"); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); assertEquals("a !! test\n\n", markup); }

Target:
public void testImageNoUrl() { builder.beginDocument(); builder.characters("a "); builder.image(new ImageAttributes(), null); builder.characters(" test"); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); assertEquals("a test\n\n", markup); }
Source:
private FeedbackResponseCommentAttributes restoreFrCommentFromDataBundle(String existingFrCommentInDataBundle) { FeedbackResponseCommentAttributes existingFrComment = dataBundle.feedbackResponseComments.get(existingFrCommentInDataBundle); FeedbackResponseCommentAttributes frComment = FeedbackResponseCommentAttributes.builder( existingFrComment.courseId, existingFrComment.feedbackSessionName) .withGiverEmail(existingFrComment.giverEmail) .withFeedbackQuestionId(existingFrComment.feedbackQuestionId) .withFeedbackResponseId(existingFrComment.feedbackResponseId) .withCommentText(existingFrComment.commentText) .withCreatedAt(existingFrComment.createdAt) .build(); restoreFrCommentIdFromExistingOne(frComment, existingFrComment); return frComment; }

Target:
private FeedbackResponseCommentAttributes restoreFrCommentFromDataBundle(String existingFrCommentInDataBundle) { FeedbackResponseCommentAttributes existingFrComment = dataBundle.feedbackResponseComments.get(existingFrCommentInDataBundle); FeedbackResponseCommentAttributes frComment = FeedbackResponseCommentAttributes .builder(existingFrComment.courseId, existingFrComment.feedbackSessionName, existingFrComment.giverEmail, existingFrComment.commentText) .withFeedbackQuestionId(existingFrComment.feedbackQuestionId) .withFeedbackResponseId(existingFrComment.feedbackResponseId) .withCreatedAt(existingFrComment.createdAt) .build(); restoreFrCommentIdFromExistingOne(frComment, existingFrComment); return frComment; }
Source:
private double getCellScrollDeltaY(final GridWidget gridWidget, final boolean isHeaderCellSelected) { final GridData gridModel = gridWidget.getModel(); final GridData.SelectedCell origin = getSelectedCellOrigin(gridModel, isHeaderCellSelected); final int uiRowIndex = origin.getRowIndex(); double dy = 0; final Bounds bounds = gridLayer.getVisibleBounds(); final double rowHeight = gridModel.getRow(uiRowIndex).getHeight(); final double headerHeight = gridWidget.getRenderer().getHeaderHeight(); final double gridCellY = gridWidget.getY() + headerHeight + gridWidget.getRendererHelper().getRowOffset(uiRowIndex); if (gridCellY + rowHeight >= bounds.getY() + bounds.getHeight()) { dy = bounds.getY() + bounds.getHeight() - gridCellY - rowHeight; } else if (gridCellY <= bounds.getY() + headerHeight) { dy = bounds.getY() + headerHeight - gridCellY; } return dy; }

Target:
private double getCellScrollDeltaY(final GridWidget gridWidget, final boolean isHeaderCellSelected) { final GridData gridModel = gridWidget.getModel(); final GridData.SelectedCell origin = getSelectedCellOrigin(gridModel, isHeaderCellSelected); final int uiRowIndex = origin.getRowIndex(); double dy = 0; final Bounds bounds = gridLayer.getVisibleBounds(); final int headerRowCount = gridModel.getHeaderRowCount(); final double headerHeight = gridWidget.getRenderer().getHeaderHeight(); final double rowHeight = isHeaderCellSelected ? gridWidget.getRenderer().getHeaderRowHeight() : gridModel.getRow(uiRowIndex).getHeight(); final double headerYOffset = isHeaderCellSelected ? headerHeight - headerRowCount * rowHeight : headerHeight; final double rowOffset = isHeaderCellSelected ? rowHeight * uiRowIndex : gridWidget.getRendererHelper().getRowOffset(uiRowIndex); final double gridCellY = gridWidget.getY() + headerYOffset + rowOffset; if (gridCellY + rowHeight >= bounds.getY() + bounds.getHeight()) { dy = bounds.getY() + bounds.getHeight() - gridCellY - rowHeight; } else if (gridCellY <= bounds.getY() + headerYOffset) { dy = bounds.getY() + headerYOffset - gridCellY; } return dy; }
Source:
public void setConnectionFactory(ConnectionFactory connectionFactory) { super.setConnectionFactory(connectionFactory); if (!this.receiveTimeoutExplicitlySet) { if (connectionFactory instanceof CachingConnectionFactory && ((CachingConnectionFactory) connectionFactory).isCacheConsumers()) { super.setReceiveTimeout(JmsDestinationAccessor.RECEIVE_TIMEOUT_NO_WAIT); } else { super.setReceiveTimeout(1000); } } }

Target:
public void setConnectionFactory(ConnectionFactory connectionFactory) { super.setConnectionFactory(connectionFactory); if (!this.receiveTimeoutExplicitlySet) { if (connectionFactory instanceof CachingConnectionFactory && ((CachingConnectionFactory) connectionFactory).isCacheConsumers()) { super.setReceiveTimeout(JmsDestinationAccessor.RECEIVE_TIMEOUT_NO_WAIT); } else { super.setReceiveTimeout(NO_CACHING_RECEIVE_TIMEOUT); } } }
Source:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); if (_vds.getProtocol() == 1) { _vdsProxy = new JsonRpcVdsServer(JsonRpcUtils.createStompClient(_vds.getHostName(), _vds.getPort(), connectionTimeOut, clientTimeOut, clientRetries, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication))); } else if (_vds.getProtocol() == 0){ Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); } }

Target:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); if (VdsProtocol.STOMP == _vds.getProtocol()) { _vdsProxy = new JsonRpcVdsServer(JsonRpcUtils.createStompClient(_vds.getHostName(), _vds.getPort(), connectionTimeOut, clientTimeOut, clientRetries, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication))); } else if (VdsProtocol.XML == _vds.getProtocol()){ Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); } }
Source:
private void updateAndPropagate(Map<VElement, VDiagnostic> controlDiagnosticMap) { for (final Map.Entry<VElement, VDiagnostic> next : controlDiagnosticMap.entrySet()) { next.getKey().setDiagnostic(next.getValue()); reevaluateToTop(next.getKey().eContainer(), controlDiagnosticMap); } }

Target:
private void updateAndPropagate(Map<VElement, VDiagnostic> controlDiagnosticMap) { controlDiagnosticMap.forEach(VElement::setDiagnostic); final NavigableMap<Integer, Set<VElement>> depthMap = mapByDepth(controlDiagnosticMap.keySet()); reevaluateToTop(depthMap, controlDiagnosticMap); }
Source:
public <T> T createInstance(PartitionHandlingConfiguration config) { String mergePolicyClass = config.mergePolicyClass(); if (mergePolicyClass == null) return null; try { return (T) policies.computeIfAbsent(mergePolicyClass, k -> new CompletableFuture<>()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException("An error occurred while processing the deployment", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.loadingCustomMergePolicyTimeout(mergePolicyClass); } return null; }

Target:
public <T> T createInstance(PartitionHandlingConfiguration config) { EntryMergePolicy mergePolicy = config.mergePolicy(); if (mergePolicy == null) return null; if (mergePolicy instanceof DeployedMergePolicy) { DeployedMergePolicy wrapper = (DeployedMergePolicy) mergePolicy; try { return (T) policies.computeIfAbsent(wrapper.getClassName(), k -> new CompletableFuture<>()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException("An error occurred while processing the deployment", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.loadingCustomMergePolicyTimeout(wrapper.getClassName()); throw new CacheException(e); } } return (T) mergePolicy; }
Source:
public void doBefore() { lastComment = null; final EventListener el = this; eventDesc = new EventListenerDescriptor() { @Override public Set<String> getEvents() { return Sets.newHashSet(LifeCycleConstants.TRANSITION_EVENT); } @Override public EventListener asEventListener() { return el; } @Override public void initListener() { } }; eventService.addEventListener(eventDesc); }

Target:
public void doBefore() { lastComment = null; eventDesc = new EventListenerDescriptor() { @Override public Set<String> getEvents() { return Sets.newHashSet(LifeCycleConstants.TRANSITION_EVENT); } @Override public EventListener asEventListener() { return TransitionTest.this; } @Override public void initListener() { } }; eventService.addEventListener(eventDesc); }
Source:
private void logEnabledExtensions() { log.info("Start of enabled extensions list: "); for (ExtensionEntry entry: loadedEntries.values()) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); if (entry.extension != null) { log.info(String.format( "Name: %1$s Author %2$s Version %3$s Home: %4$s License: %5$s File: %6$s", emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(entry.file) ) ); } } log.info("End of enabled extensions list"); }

Target:
private void logEnabledExtensions() { log.info("Start of enabled extensions list"); for (ExtensionEntry entry: loadedEntries.values()) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); if (entry.extension != null) { log.info(String.format( "Name: '%1$s', Author '%2$s', Version '%3$s', Home: '%4$s' License: '%5$s' File: '%6$s'", emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(entry.file) ) ); } } log.info("End of enabled extensions list"); }
Source:
default <T> SearchHit<T> queryForObject(Query query, Class<T> clazz, IndexCoordinates index) { SearchHits<T> searchHits = queryForList(query, clazz, index); return searchHits.hasSearchHits() ? searchHits.getSearchHit(0) : null; }

Target:
default <T> T queryForObject(Query query, Class<T> clazz, IndexCoordinates index) { return (T) SearchHitSupport.unwrapSearchHits(searchOne(query, clazz, index)); }
Source:
public SystemAdmin getSystemAdmin(String systemName, String adminLabel) { if (systemAdminMap.isEmpty() || (systemAdminMap.containsKey(systemName) && systemAdminMap.get(systemName).isStopped())) { systemAdminMap.clear(); } return getSystemAdmins(adminLabel).get(systemName); }

Target:
public SystemAdmin getSystemAdmin(String systemName, String adminLabel) { if (systemAdminMap.containsKey(systemName) && systemAdminMap.get(systemName).isStopped()) { systemAdminMap.clear(); } return getSystemAdmins(adminLabel).get(systemName); }
Source:
private void persistWorkbenchModel() { Job[] cleanAndSaveJobs = Job.getJobManager().find(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB); if (cleanAndSaveJobs != null && cleanAndSaveJobs.length > 0) { return; } final MApplication appCopy = (MApplication) EcoreUtil.copy((EObject) application); if (detectWorkbenchCorruption(appCopy)) { return; } final IModelResourceHandler handler = e4Context.get(IModelResourceHandler.class); Job cleanAndSaveJob = new Job(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB) { @Override protected IStatus run(IProgressMonitor monitor) { final Resource res = handler.createResourceWithApp(appCopy); cleanUpCopy(appCopy, e4Context); try { if (!detectWorkbenchCorruption((MApplication) res.getContents().get(0))) { res.save(null); } } catch (IOException e) { } finally { res.unload(); res.getResourceSet().getResources().remove(res); } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return WORKBENCH_AUTO_SAVE_BACKGROUND_JOB == family; } }; cleanAndSaveJob.setPriority(Job.SHORT); cleanAndSaveJob.setSystem(true); cleanAndSaveJob.schedule(); }

Target:
private void persistWorkbenchModel() { try { Job.getJobManager().join(WORKBENCH_AUTO_SAVE_JOB, new NullProgressMonitor()); } catch (OperationCanceledException e) { } catch (InterruptedException e) { } final MApplication appCopy = (MApplication) EcoreUtil.copy((EObject) application); if (detectWorkbenchCorruption(appCopy)) { return; } final IModelResourceHandler handler = e4Context.get(IModelResourceHandler.class); Job cleanAndSaveJob = new Job(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB) { @Override protected IStatus run(IProgressMonitor monitor) { final Resource res = handler.createResourceWithApp(appCopy); cleanUpCopy(appCopy, e4Context); try { if (!detectWorkbenchCorruption((MApplication) res.getContents().get(0))) { res.save(null); } } catch (IOException e) { } finally { res.unload(); res.getResourceSet().getResources().remove(res); } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return WORKBENCH_AUTO_SAVE_JOB.equals(family); } }; cleanAndSaveJob.setPriority(Job.SHORT); cleanAndSaveJob.setSystem(true); cleanAndSaveJob.schedule(); }
Source:
private static boolean isBuiltIn(String sql, String builtIn) { return sql.regionMatches(true, 0, builtIn, 0, builtIn.length()); }

Target:
public static boolean isBuiltIn(String sql, String builtIn) { return sql.regionMatches(true, 0, builtIn, 0, builtIn.length()); }
Source:
public Intersection(SimpleFeature intersectionFeature, AttributeGetter getter) { this.point = (Point) intersectionFeature.getDefaultGeometry(); this.attGet = getter; this.transectId = (Integer) attGet.getValue(TRANSECT_ID_ATTR, intersectionFeature); this.distance = (Double) attGet.getValue(DISTANCE_ATTR, intersectionFeature); this.isMeanHighWater = getBooleanFromMhwAttribute(attGet.getValue(MHW_ATTR, intersectionFeature)); this.feature = intersectionFeature; }

Target:
public Intersection(SimpleFeature intersectionFeature, AttributeGetter getter) { this.point = (Point) intersectionFeature.getDefaultGeometry(); this.attGet = getter; this.transectId = (Integer) attGet.getValue(TRANSECT_ID_ATTR, intersectionFeature); this.distance = (Double) attGet.getValue(DISTANCE_ATTR, intersectionFeature); this.isMeanHighWater = attGet.getBooleanFromMhwAttribute(attGet.getValue(MHW_ATTR, intersectionFeature)); this.feature = intersectionFeature; }
Source:
public void allowSnapshot(Path path) throws IOException { dfs.allowSnapshot(path); if (dfs.isSnapshotTrashRootEnabled()) { try { dfs.provisionSnapshotTrash(path, TRASH_PERMISSION); } catch (FileAlreadyExistsException ex) { LOG.warn(ex.getMessage()); LOG.info("You can safely ignore the above warning if you are allowing " + "snapshot on an encryption zone, as the EZ already has a trash."); } } }

Target:
public void allowSnapshot(Path path) throws IOException { dfs.allowSnapshot(path); if (dfs.isSnapshotTrashRootEnabled()) { dfs.provisionSnapshotTrash(path, TRASH_PERMISSION); } }
Source:
public ValueNode replaceIndexExpression(ResultColumnList childRCL) throws StandardException { ValueNodeList newList = (ValueNodeList) getNodeFactory().getNode( C_NodeTypes.VALUE_NODE_LIST, getContextManager()); for (Object leftItem : leftOperandList) { newList.addValueNode(((ValueNode) leftItem).replaceIndexExpression(childRCL)); } leftOperandList = newList; return this; }

Target:
public ValueNode replaceIndexExpression(ResultColumnList childRCL) throws StandardException { if (leftOperandList != null) { leftOperandList = leftOperandList.replaceIndexExpression(childRCL); } if (rightOperandList != null) { rightOperandList = rightOperandList.replaceIndexExpression(childRCL); } return this; }
Source:
public void setShowBuffering(boolean showBuffering) { setShowBuffering(showBuffering ? SHOW_BUFFERING_ALWAYS : SHOW_BUFFERING_NEVER); }

Target:
public void setShowBuffering(boolean showBuffering) { setShowBuffering(showBuffering ? SHOW_BUFFERING_WHEN_PLAYING : SHOW_BUFFERING_NEVER); }
Source:
public void oneGardenSecondStudent() { String student = "Bob"; String plants = "VVCCGG\nVVCCGG"; Plant[] expected = {Plant.CLOVER, Plant.CLOVER, Plant.CLOVER, Plant.CLOVER}; assertEquals(expected, new KindergartenGarden(plants).getPlantsOfStudent(student)); }

Target:
public void oneGardenSecondStudent() { String student = "Bob"; String plants = "VVCCGG\nVVCCGG"; List<Plant> expected = Arrays.asList(Plant.CLOVER, Plant.CLOVER, Plant.CLOVER, Plant.CLOVER); assertEquals( expected, new KindergartenGarden(plants).getPlantsOfStudent(student) ); }
Source:
public void reset() { init(); }

Target:
public void reset() { excludeLists = propertyToList(KIE_LISTENER_EXCLUDE); includeLists = propertyToList(KIE_LISTENER_INCLUDE); listeners.clear(); Predicate<String> predicate = createPredicate(); for (NotificationListener listener : listenersLoaded) { if (predicate.test(listener.getClass().getName())) { listeners.add(listener); } } }
Source:
@Override public void send(Bundle input) { try { Bundle output = input; if (fields != null) { output = output.createBundle(); for (int i = 0; i < fields.length; i++) { IndexField fieldIn = fieldsIn[i]; AutoField fieldOut = fieldsOut[i]; fieldOut.setValue(output, fieldIn.getValue(input)); } } queue.put(output); } catch (InterruptedException ex) { firstError.compareAndSet(null, ex); close(); } }

Target:
@Override public void send(Bundle input) { try { Bundle output; if (fields == null) { output = input; } else { if (fields.length != input.getFormat().getFieldCount()) { throw new IllegalStateException("Expecting " + fields.length + " fields " + Arrays.toString(fields) + " and result from query has " + input.getFormat().getFieldCount() + " fields " + Arrays.toString(fieldNames(input))); } output = formatOut.createBundle(); Iterator<BundleField> fieldsIn = input.getFormat().iterator(); for (int i = 0; i < fields.length; i++) { AutoField fieldOut = fields[i]; fieldOut.setValue(output, input.getValue(fieldsIn.next())); } } queue.put(output); } catch (Exception ex) { firstError.compareAndSet(null, ex); close(); } }
Source:
public String toString() { return new String(this.workspacePath) + "|" + new String(this.fieldDescriptor); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(this.workspacePath); builder.append("|"); builder.append(this.fieldDescriptor); return builder.toString(); }
Source:
private static Bin mergeBins(final List<Bin> bins) { if (bins.isEmpty()) { throw new IllegalArgumentException("Cannot merge empty bins"); } if (bins.size() == 1) { return bins.get(0); } final int referenceSequence = bins.get(0).getReferenceSequence(); final int binNumber = bins.get(0).getBinNumber(); final List<Chunk> allChunks = new ArrayList<>(); for (Bin b : bins) { if (b.getReferenceSequence() != referenceSequence) { throw new IllegalArgumentException("Bins have different reference sequences"); } if (b.getBinNumber() != binNumber) { throw new IllegalArgumentException("Bins have different numbers"); } allChunks.addAll(b.getChunkList()); } Collections.sort(allChunks); final Bin bin = new Bin(referenceSequence, binNumber); for (Chunk newChunk : allChunks) { final long chunkStart = newChunk.getChunkStart(); final long chunkEnd = newChunk.getChunkEnd(); final List<Chunk> oldChunks = bin.getChunkList(); if (!bin.containsChunks()) { bin.addInitialChunk(newChunk); } else { final Chunk lastChunk = bin.getLastChunk(); if (BlockCompressedFilePointerUtil.areInSameOrAdjacentBlocks( lastChunk.getChunkEnd(), chunkStart)) { lastChunk.setChunkEnd(chunkEnd); } else { oldChunks.add(newChunk); bin.setLastChunk(newChunk); } } } return bin; }

Target:
private static Bin mergeBins(final List<Bin> bins) { if (bins.isEmpty()) { throw new IllegalArgumentException("Cannot merge empty bins"); } if (bins.size() == 1) { return bins.get(0); } final int referenceSequence = bins.get(0).getReferenceSequence(); final int binNumber = bins.get(0).getBinNumber(); final List<Chunk> allChunks = new ArrayList<>(); for (Bin b : bins) { if (b.getReferenceSequence() != referenceSequence) { throw new IllegalArgumentException(String.format("Bins have different reference sequences, %s and %s.", b.getReferenceSequence(), referenceSequence)); } if (b.getBinNumber() != binNumber) { throw new IllegalArgumentException(String.format("Bins have different numbers, %s and %s.", b.getBinNumber(), binNumber)); } allChunks.addAll(b.getChunkList()); } Collections.sort(allChunks); final Bin bin = new Bin(referenceSequence, binNumber); for (Chunk newChunk : allChunks) { bin.addChunk(newChunk); } return bin; }
Source:
public void shutdownAdminBlobStorageService() throws IOException { adminBlobStorageService.shutdown(); router.close(); }

Target:
public void shutdownAdminBlobStorageService() throws IOException { adminBlobStorageService.shutdown(); responseHandler.shutdown(); router.close(); }
Source:
public void testJoinerConfigWithDuplicateOutputFields() { String selectedFields = "film.film_id, film.film_name, " + "filmActor.actor_name as name, filmCategory.category_name as name"; JoinerConfig config = new JoinerConfig("film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name", selectedFields, "film,filmActor,filmCategory"); Joiner joiner = new Joiner(config); Map<String, Schema> inputSchemas = ImmutableMap.of("film", filmSchema, "filmActor", filmActorSchema, "filmCategory", filmCategorySchema); FailureCollector collector = new MockFailureCollector(); String caughtException = ""; try { joiner.init(inputSchemas, collector); joiner.getOutputSchema(inputSchemas, collector); } catch (Exception e) { caughtException = e.getMessage(); } Assert.assertEquals(validationExceptionMessage, caughtException); Assert.assertEquals(1, collector.getValidationFailures().size()); Assert.assertEquals(1, collector.getValidationFailures().get(0).getCauses().size()); Cause expectedCause = new Cause(); expectedCause.addAttribute(CauseAttributes.STAGE_CONFIG, SELECTED_FIELDS); expectedCause.addAttribute(stage, mockStage); Assert.assertEquals(expectedCause, collector.getValidationFailures().get(0).getCauses().get(0)); }

Target:
public void testJoinerConfigWithDuplicateOutputFields() { String selectedFields = "film.film_id, film.film_name, " + "filmActor.actor_name as name, filmCategory.category_name as name"; JoinerConfig config = new JoinerConfig("film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name", selectedFields, "film,filmActor,filmCategory"); Joiner joiner = new Joiner(config); Map<String, Schema> inputSchemas = ImmutableMap.of("film", filmSchema, "filmActor", filmActorSchema, "filmCategory", filmCategorySchema); FailureCollector collector = new MockFailureCollector(); try { joiner.init(inputSchemas, collector); joiner.getOutputSchema(inputSchemas, collector); Assert.fail(); } catch (ValidationException e) { Assert.assertEquals(1, e.getFailures().size()); Assert.assertEquals(1, e.getFailures().get(0).getCauses().size()); Cause expectedCause = new Cause(); expectedCause.addAttribute(CauseAttributes.STAGE_CONFIG, JoinerConfig.SELECT_FIELDS); expectedCause.addAttribute(STAGE, MOCK_STAGE); Assert.assertEquals(expectedCause, e.getFailures().get(0).getCauses().get(0)); } }
Source:
public ConfigInfos validateConfigs( final @PathParam("connectorType") String connType, final Map<String, String> connectorConfig ) throws Throwable { String includedConnType = connectorConfig.get(ConnectorConfig.CONNECTOR_CLASS_CONFIG); if (includedConnType != null && !normalizedPluginName(includedConnType).endsWith(normalizedPluginName(connType))) { throw new BadRequestException( "Included connector type " + includedConnType + " does not match request type " + connType ); } FutureCallback<ConfigInfos> validationCallback = new FutureCallback<>(); herder.validateConnectorConfig(connectorConfig, validationCallback); return validationCallback.get(); }

Target:
public ConfigInfos validateConfigs( final @PathParam("connectorType") String connType, final Map<String, String> connectorConfig ) throws Throwable { String includedConnType = connectorConfig.get(ConnectorConfig.CONNECTOR_CLASS_CONFIG); if (includedConnType != null && !normalizedPluginName(includedConnType).endsWith(normalizedPluginName(connType))) { throw new BadRequestException( "Included connector type " + includedConnType + " does not match request type " + connType ); } FutureCallback<ConfigInfos> validationCallback = new FutureCallback<>(); herder.validateConnectorConfig(connectorConfig, validationCallback, false); try { return validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, TimeUnit.SECONDS); } catch (TimeoutException e) { throw new ConnectRestException(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Request timed out"); } catch (InterruptedException e) { throw new ConnectRestException(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Request interrupted"); } }
Source:
public void testSimple() throws IOException { String hostport = emulator.getContainerIpAddress() + ":" + emulator.getMappedPort(8085); ManagedChannel channel = ManagedChannelBuilder.forTarget(hostport).usePlaintext().build(); try { TransportChannelProvider channelProvider = FixedTransportChannelProvider.create(GrpcTransportChannel.create(channel)); CredentialsProvider credentialsProvider = NoCredentialsProvider.create(); TopicAdminClient topicClient = TopicAdminClient.create( TopicAdminSettings.newBuilder() .setTransportChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build()); Topic topic = Topic.newBuilder().setName("projects/my-project-id/topics/my-topic-id").build(); topicClient.createTopic(topic); Publisher publisher = Publisher.newBuilder(topic.getName()).build(); PubsubMessage message = PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8("test message")).build(); ApiFuture<String> future = publisher.publish(message); ApiFutures.addCallback(future, new ApiFutureCallback<String>() { @Override public void onFailure(Throwable t) { } @Override public void onSuccess(String result) { assertThat(result).isNotNull(); } }, MoreExecutors.directExecutor()); } finally { channel.shutdown(); } assertThat(emulator.getMappedPort(8085)).isNotNull(); }

Target:
public void testSimple() throws IOException { String hostport = emulator.getContainerIpAddress() + ":" + emulator.getMappedPort(8085); ManagedChannel channel = ManagedChannelBuilder.forTarget(hostport).usePlaintext().build(); try { TransportChannelProvider channelProvider = FixedTransportChannelProvider.create(GrpcTransportChannel.create(channel)); NoCredentialsProvider credentialsProvider = NoCredentialsProvider.create(); String topicId = "my-topic-id"; createTopic(topicId, channelProvider, credentialsProvider); String subscriptionId = "my-subscription-id"; createSubscription(subscriptionId, topicId, channelProvider, credentialsProvider); Publisher publisher = Publisher.newBuilder(TopicName.of(PROJECT_ID, topicId)) .setChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build(); PubsubMessage message = PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8("test message")).build(); publisher.publish(message); SubscriberStubSettings subscriberStubSettings = SubscriberStubSettings.newBuilder() .setTransportChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build(); try (SubscriberStub subscriber = GrpcSubscriberStub.create(subscriberStubSettings)) { PullRequest pullRequest = PullRequest.newBuilder() .setMaxMessages(1) .setSubscription(ProjectSubscriptionName.format(PROJECT_ID, subscriptionId)) .build(); PullResponse pullResponse = subscriber.pullCallable().call(pullRequest); assertThat(pullResponse.getReceivedMessagesList()).hasSize(1); assertThat(pullResponse.getReceivedMessages(0).getMessage().getData().toStringUtf8()).isEqualTo("test message"); } } finally { channel.shutdown(); } }
Source:
public DenseHll toDense() { DenseHll result = new DenseHll(indexBitLength); int overflowIndex = 0; for (int hashIndex = 0; hashIndex < numberOfHashes; hashIndex++) { short shortHash = shortHashes[hashIndex]; int bucket = extractIndex(indexBitLength, shortHash); int zeros = numberOfLeadingZeros(toLongHash(shortHash), indexBitLength); if (zeros > (Short.SIZE - indexBitLength)) { zeros = Short.SIZE - indexBitLength; while (overflowIndex < numberOfOverflows) { short overflow = overflows[overflowIndex]; int overflowBucket = extractIndex(indexBitLength, overflow); if (overflowBucket > bucket) { break; } overflowIndex++; if (overflowBucket == bucket) { zeros += extractValue(overflow) + 1; break; } } } result.insert(bucket, zeros + 1); } return result; }

Target:
public DenseHll toDense() { DenseHll result = new DenseHll(indexBitLength); int overflowIndex = 0; for (int hashIndex = 0; hashIndex < numberOfHashes; hashIndex++) { short shortHash = shortHashes[hashIndex]; int bucket = extractIndex(indexBitLength, shortHash); int zeros = numberOfLeadingZeros(toLongHash(shortHash), indexBitLength); int valueBits = Short.SIZE - indexBitLength; if (zeros > valueBits) { zeros = valueBits; while (overflowIndex < numberOfOverflows) { short overflow = overflows[overflowIndex]; int overflowBucket = extractIndex(indexBitLength, overflow); if (overflowBucket > bucket) { break; } overflowIndex++; if (overflowBucket == bucket) { zeros += extractValue(overflow) + 1; break; } } } result.insert(bucket, zeros + 1); } return result; }
Source:
public void createNonAdminAccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); BitstreamFormatRest bitstreamFormatRest = this.createRandomMockBitstreamRest(false); context.turnOffAuthorisationSystem(); EPerson user = EPersonBuilder.createEPerson(context) .withNameInMetadata("first", "last") .withEmail("testaze@gmail.com") .withPassword(password) .withLanguage(I18nUtil.getDefaultLocale().getLanguage()) .build(); context.restoreAuthSystemState(); String token = getAuthToken(user.getEmail(), password); getClient(token).perform(post("/api/core/bitstreamformats/") .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) .andExpect(status().isForbidden()); }

Target:
public void createNonAdminAccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); BitstreamFormatRest bitstreamFormatRest = this.createRandomMockBitstreamRest(false); context.turnOffAuthorisationSystem(); EPerson user = EPersonBuilder.createEPerson(context) .withNameInMetadata("first", "last") .withEmail("testaze@gmail.com") .withPassword(password) .withLanguage(I18nUtil.getDefaultLocale().getLanguage()) .build(); context.restoreAuthSystemState(); String token = getAuthToken(user.getEmail(), password); getClient(token).perform(post("/api/core/bitstreamformats/") .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) .andExpect(status().isForbidden()); getClient().perform(get("/api/core/bitstreamformats/")) .andExpect(status().isOk()) .andExpect(jsonPath("$.page.totalElements", is(DEFAULT_AMOUNT_FORMATS))); }
Source:
public Locale getLocale() { return Locale.forLanguageTag(player.language.replace('_', '-')); }

Target:
public Locale getLocale() { return TextUtils.getLocaleByMinecraftTag(player.language); }
Source:
protected void onClose() throws IOException { final boolean ok; try { ok = client.completePendingCommand() || client.getReplyCode() == 426; } finally { getAbstractFileSystem().putClient(client); } if (!ok) { throw new FileSystemException("vfs.provider.ftp/finish-get.error", getName()); } }

Target:
protected void onClose() throws IOException { final boolean ok; try { ok = client.completePendingCommand() || client.getReplyCode() == FTPReply.TRANSFER_ABORTED; } finally { getAbstractFileSystem().putClient(client); } if (!ok) { throw new FileSystemException("vfs.provider.ftp/finish-get.error", getName()); } }
Source:
public Function<Row, Row> makePostComputeManipulatorFn(MovingAverageQuery query, MetricManipulationFn fn) { return new Function<Row, Row>() { @Override public Row apply(Row result) { MapBasedRow mRow = (MapBasedRow) result; final Map<String, Object> values = new HashMap(mRow.getEvent()); for (AggregatorFactory agg : query.getAggregatorSpecs()) { Object aggVal = values.get(agg.getName()); if (aggVal != null) { values.put(agg.getName(), fn.manipulate(agg, aggVal)); } else { values.put(agg.getName(), null); } } for (AveragerFactory<?, ?> avg : query.getAveragerSpecs()) { Object aggVal = values.get(avg.getName()); if (aggVal != null) { values.put(avg.getName(), fn.manipulate(new AveragerFactoryWrapper(avg, avg.getName() + "_"), aggVal)); } else { values.put(avg.getName(), null); } } return new MapBasedRow(result.getTimestamp(), values); } }; }

Target:
public Function<Row, Row> makePostComputeManipulatorFn(MovingAverageQuery query, MetricManipulationFn fn) { return new Function<Row, Row>() { @Override public Row apply(Row result) { MapBasedRow mRow = (MapBasedRow) result; final Map<String, Object> values = new HashMap<>(mRow.getEvent()); for (AggregatorFactory agg : query.getAggregatorSpecs()) { Object aggVal = values.get(agg.getName()); if (aggVal != null) { values.put(agg.getName(), fn.manipulate(agg, aggVal)); } else { values.put(agg.getName(), null); } } for (AveragerFactory<?, ?> avg : query.getAveragerSpecs()) { Object aggVal = values.get(avg.getName()); if (aggVal != null) { values.put(avg.getName(), fn.manipulate(new AveragerFactoryWrapper<>(avg, avg.getName() + "_"), aggVal)); } else { values.put(avg.getName(), null); } } return new MapBasedRow(result.getTimestamp(), values); } }; }
Source:
public void setData(byte data, boolean applyPhysics) { chunk.setMetaData(x & 0xf, z & 0xf, y & 0x7f, data); if (applyPhysics) { } BlockChangeMessage bcmsg = new BlockChangeMessage(x, y, z, getTypeId(), data); for (GlowPlayer p : getWorld().getRawPlayers()) { p.sendBlockChange(bcmsg); } }

Target:
public void setData(byte data, boolean applyPhysics) { byte oldData = getData(); chunk.setMetaData(x & 0xf, z & 0xf, y & 0x7f, data); if (applyPhysics) { applyPhysics(getType(), getTypeId(), oldData, data); } BlockChangeMessage bcmsg = new BlockChangeMessage(x, y, z, getTypeId(), data); for (GlowPlayer p : getWorld().getRawPlayers()) { p.sendBlockChange(bcmsg); } }
Source:
public static LocalQueryRunner createLocalQueryRunner() { Session defaultSession = testSessionBuilder() .setCatalog("local") .setSchema(TINY_SCHEMA_NAME) .build(); LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession); localQueryRunner.createCatalog( defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); localQueryRunner.getMetadata().addFunctions(CUSTOM_FUNCTIONS); SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager(); sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES); sessionPropertyManager.addConnectorSessionProperties(new ConnectorId(TESTING_CATALOG), TEST_CATALOG_PROPERTIES); return localQueryRunner; }

Target:
public static LocalQueryRunner createLocalQueryRunner() { Session defaultSession = testSessionBuilder() .setCatalog("local") .setSchema(TINY_SCHEMA_NAME) .setSystemProperty(PUSH_PARTIAL_AGGREGATION_THROUGH_JOIN, "true") .build(); LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession); localQueryRunner.createCatalog( defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); localQueryRunner.getMetadata().addFunctions(CUSTOM_FUNCTIONS); SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager(); sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES); sessionPropertyManager.addConnectorSessionProperties(new ConnectorId(TESTING_CATALOG), TEST_CATALOG_PROPERTIES); return localQueryRunner; }
Source:
public boolean removeLock(final long lockId) { return connector.retryWithHandle( new HandleCallback<Boolean>() { @Override public Boolean withHandle(Handle handle) throws Exception { return handle.createStatement( String.format( "DELETE FROM %s WHERE id = :id", lockTable ) ) .bind("id", lockId) .execute() == 1; } } ); }

Target:
public void removeLock(final long lockId) { connector.retryWithHandle( new HandleCallback<Void>() { @Override public Void withHandle(Handle handle) throws Exception { handle.createStatement(String.format("DELETE FROM %s WHERE id = :id", lockTable)) .bind("id", lockId) .execute(); return null; } } ); }