auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void store(VirtualFile file, final Collection<LocalIssuePointer> rawIssues) { boolean firstAnalysis = !storePerFile.containsKey(file); cleanInvalid(file); if (firstAnalysis) { storePerFile.put(file, rawIssues); } else { matchingInProgress.lock(); Collection<LocalIssuePointer> previousIssues = getForFile(file); Collection<LocalIssuePointer> trackedIssues = new ArrayList<>(); Input<LocalIssuePointer> baseInput = () -> previousIssues; Input<LocalIssuePointer> rawInput = () -> rawIssues; updateTrackedIssues(file, trackedIssues, baseInput, rawInput); matchingInProgress.unlock(); } }

Target:
void store(VirtualFile file, final Collection<LocalIssuePointer> rawIssues) { boolean firstAnalysis = !storePerFile.containsKey(file); cleanInvalid(file); if (firstAnalysis) { storePerFile.put(file, rawIssues); } else { matchWithPreviousIssues(file, rawIssues); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BinLogPositionSourceOffset that = (BinLogPositionSourceOffset) o; if (position != that.position) return false; return filename != null ? filename.equals(that.filename) : that.filename == null; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BinLogPositionSourceOffset that = (BinLogPositionSourceOffset) o; if (position != that.position) { return false; } return filename.equals(that.filename); }
Source:
private void checkAndSetPrerequisites() throws InternalErrorException, SQLException { if (getAttributes().get("url") == null) { throw new InternalErrorException("url attribute is required"); } if (getAttributes().get("driver") != null) { try { Class.forName(getAttributes().get("driver")); } catch (ClassNotFoundException e) { throw new InternalErrorException("Driver " + getAttributes().get("driver") + " cannot be registered", e); } } if (this.con == null || (this.isOracle && !this.con.isValid(0))) { this.createConnection(); } }

Target:
private void checkAndSetPrerequisites() throws InternalErrorException { if (getAttributes().get("url") == null) { throw new InternalErrorException("url attribute is required"); } if (getAttributes().get("driver") != null) { try { Class.forName(getAttributes().get("driver")); } catch (ClassNotFoundException e) { throw new InternalErrorException("Driver " + getAttributes().get("driver") + " cannot be registered", e); } } try { if (this.con == null || (this.isOracle && !this.con.isValid(0))) { this.createConnection(); } } catch (SQLException ex) { throw new InternalErrorException("Can't check if connection to database is still valid in SQL ExtSource.", ex); } }
Source:
public void onNewHead(FlowNode flowNode) { if (!isMonitored(flowNode)) { return; } DatadogClient client = ClientFactory.getClient(); if (client == null){ return; } StepEndNode endNode = (StepEndNode) flowNode; StepStartNode startNode = endNode.getStartNode(); int stageDepth = 0; String directParentName = null; for (BlockStartNode node : startNode.iterateEnclosingBlocks()) { if (isStageNode(node)) { if(directParentName == null){ directParentName = getStageName(node); } stageDepth++; } } if(directParentName == null){ directParentName = "root"; } WorkflowRun run = getRun(flowNode); if(run == null){ return; } try { String result = getResultTag(endNode); BuildData buildData = new BuildData(run, flowNode.getExecution().getOwner().getListener()); String hostname = buildData.getHostname(""); Map<String, Set<String>> tags = buildData.getTags(); TagsUtil.addTagToTags(tags, "stage_name", getStageName(startNode)); TagsUtil.addTagToTags(tags, "parent_stage_name", directParentName); TagsUtil.addTagToTags(tags, "stage_depth", String.valueOf(stageDepth)); tags.remove("result"); TagsUtil.addTagToTags(tags, "result", result); client.gauge("jenkins.job.stage_duration", getTime(startNode, endNode), hostname, tags); } catch (IOException | InterruptedException e) { DatadogUtilities.severe(logger, e, "Unable to submit the stage duration metric for " + getStageName(startNode)); } }

Target:
public void onNewHead(FlowNode flowNode) { if (!isMonitored(flowNode)) { return; } DatadogClient client = ClientFactory.getClient(); if (client == null){ return; } StepEndNode endNode = (StepEndNode) flowNode; StepStartNode startNode = endNode.getStartNode(); int stageDepth = 0; String directParentName = null; for (BlockStartNode node : startNode.iterateEnclosingBlocks()) { if (isStageNode(node)) { if(directParentName == null){ directParentName = getStageName(node); } stageDepth++; } } if(directParentName == null){ directParentName = "root"; } WorkflowRun run = getRun(flowNode); if(run == null){ return; } try { String result = getResultTag(endNode); BuildData buildData = new BuildData(run, flowNode.getExecution().getOwner().getListener()); String hostname = buildData.getHostname(""); Map<String, Set<String>> tags = buildData.getTags(); TagsUtil.addTagToTags(tags, "stage_name", getStageName(startNode)); TagsUtil.addTagToTags(tags, "parent_stage_name", directParentName); TagsUtil.addTagToTags(tags, "stage_depth", String.valueOf(stageDepth)); TagsUtil.addTagToTags(tags, "result", result); client.gauge("jenkins.job.stage_duration", getTime(startNode, endNode), hostname, tags); } catch (IOException | InterruptedException e) { DatadogUtilities.severe(logger, e, "Unable to submit the stage duration metric for " + getStageName(startNode)); } }
Source:
public ChargeRefundResponse doRefund(Long accountId, String chargeExternalId, RefundRequest refundRequest) { GatewayAccountEntity gatewayAccountEntity = gatewayAccountDao.findById(accountId).orElseThrow( () -> new GatewayAccountNotFoundException(accountId)); ChargeEntity chargeEntity = chargeDao.findByExternalId(chargeExternalId) .orElseThrow(() -> new ChargeNotFoundRuntimeException(chargeExternalId)); RefundEntity refundEntity = createRefund(gatewayAccountEntity, chargeEntity, refundRequest); GatewayRefundResponse gatewayRefundResponse = providers .byName(PaymentGatewayName.valueFrom(gatewayAccountEntity.getGatewayName())) .refund(RefundGatewayRequest.valueOf(refundEntity, gatewayAccountEntity, chargeEntity)); RefundEntity refund = processRefund(gatewayRefundResponse, refundEntity.getId(), gatewayAccountEntity, chargeEntity); return new ChargeRefundResponse(gatewayRefundResponse, refund); }

Target:
public ChargeRefundResponse doRefund(Long accountId, String chargeExternalId, RefundRequest refundRequest) { GatewayAccountEntity gatewayAccountEntity = gatewayAccountDao.findById(accountId).orElseThrow( () -> new GatewayAccountNotFoundException(accountId)); Charge charge = chargeService.findCharge(chargeExternalId, gatewayAccountEntity.getId()) .orElseThrow(() -> new ChargeNotFoundRuntimeException(chargeExternalId)); RefundEntity refundEntity = createRefund(charge, gatewayAccountEntity, refundRequest); GatewayRefundResponse gatewayRefundResponse = providers .byName(PaymentGatewayName.valueFrom(gatewayAccountEntity.getGatewayName())) .refund(RefundGatewayRequest.valueOf(charge, refundEntity, gatewayAccountEntity)); RefundEntity refund = processRefund(gatewayRefundResponse, refundEntity.getId(), gatewayAccountEntity, charge); return new ChargeRefundResponse(gatewayRefundResponse, refund); }
Source:
public LocalGitUserResolver(@Named("che.api") String apiUrl, HttpJsonRequestFactory requestFactory) { this.preferencessUrl = apiUrl + "/preferences"; this.requestFactory = requestFactory; }

Target:
public LocalGitUserResolver(@Named("che.api") String apiUrl, HttpJsonRequestFactory requestFactory) { this.apiUrl = apiUrl; this.requestFactory = requestFactory; }
Source:
Cluster findBestProbe(List<Cluster> clusters) { int highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.sendMeanMs == 0 || cluster.recvMeanMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && (cluster.recvMeanMs - cluster.sendMeanMs <= 2.0f && cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) { int probeBitrateBps = Math.min(cluster.getSendBitrateBps(), cluster .getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) { highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.sendMeanMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.recvMeanMs; logger.warn( "Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.sendMeanMs + " ms, mean recv delta: " + cluster.recvMeanMs + " ms, num probes: " + cluster.count); break; } } return bestIt; }

Target:
private Cluster findBestProbe(List<Cluster> clusters) { int highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.sendMeanMs == 0 || cluster.recvMeanMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && (cluster.recvMeanMs - cluster.sendMeanMs <= 2.0f && cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) { int probeBitrateBps = Math.min(cluster.getSendBitrateBps(), cluster .getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) { highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.sendMeanMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.recvMeanMs; logger.warn( "Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.sendMeanMs + " ms, mean recv delta: " + cluster.recvMeanMs + " ms, num probes: " + cluster.count); break; } } return bestIt; }
Source:
public void addChild(Description description) { String msg = "This method is no longer supported. Please refer to the %s for more information."; throw new UnsupportedOperationException(String.format(msg, DescriptionBuilder.class.getSimpleName())); }

Target:
public void addChild(Description description) { String msg = "This method is not supported for immutable description instances. " + "Please refer to the %s for more information."; throw new UnsupportedOperationException(String.format(msg, DescriptionBuilder.class.getSimpleName())); }
Source:
EapAkaAttributeFactory()

Target:
protected EapAkaAttributeFactory()
Source:
private void loadResources(final Composite container, OpenShiftServerEditorModel model) { IServerWorkingCopy server = input.getServer(); OpenShiftServerUtils.getConnection(server); final IProject deployProject = OpenShiftServerUtils.getDeployProject(server); Cursor busyCursor = new Cursor(container.getDisplay(), SWT.CURSOR_WAIT); IProgressMonitor chainProgressMonitor = new NullProgressMonitor() { @Override public boolean isCanceled() { return container.isDisposed(); } }; new JobChainBuilder( new DisableAllWidgetsJob(true, container, busyCursor), chainProgressMonitor) .runWhenDone(loadingProjectsJob(model, server, deployProject)) .runWhenDone(new DisableAllWidgetsJob(false, container, false, busyCursor)) .schedule(); }

Target:
private void loadResources(final Composite container, OpenShiftServerEditorModel model) { IServerWorkingCopy server = input.getServer(); final IProject deployProject = OpenShiftServerUtils.getDeployProject(server); Cursor busyCursor = new Cursor(container.getDisplay(), SWT.CURSOR_WAIT); IProgressMonitor chainProgressMonitor = new NullProgressMonitor() { @Override public boolean isCanceled() { return container.isDisposed(); } }; new JobChainBuilder( new DisableAllWidgetsJob(true, container, busyCursor), chainProgressMonitor) .runWhenDone(loadingProjectsJob(model, server, deployProject)) .runWhenDone(new DisableAllWidgetsJob(false, container, false, busyCursor)) .schedule(); }
Source:
protected void addTask(String queueName, String workerUrl, Map<String, String> paramMap) { Map<String, String[]> multisetParamMap = new HashMap<>(); paramMap.forEach((key, value) -> { multisetParamMap.put(key, new String[] { value }); }); TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); tasksAdded.add(task); }

Target:
protected void addTask(String queueName, String workerUrl, Map<String, String> paramMap) { Map<String, String[]> multisetParamMap = new HashMap<>(); paramMap.forEach((key, value) -> multisetParamMap.put(key, new String[] { value })); TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); tasksAdded.add(task); }
Source:
public String getTitle() { return this.id; }

Target:
public String getTitle() { return id; }
Source:
public static Properties loadPropertiesFromFile(String filename, Properties props) { FileInputStream fileistream = null; try { fileistream = new FileInputStream(filename); if (props == null) { props = new Properties(); } props.load(fileistream); fileistream.close(); return props; }catch(IOException e) { throw new RuntimeException("Could not load properties from file "+filename,e); }catch(IllegalArgumentException e) { throw new RuntimeException("Could not load properties from file "+filename,e); }finally { if(fileistream != null) try { fileistream.close(); }catch(IOException e) { } } }

Target:
public static Properties loadPropertiesFromFile(String filename, Properties props) { try (FileInputStream fileistream = new FileInputStream(filename)) { if (props == null) { props = new Properties(); } props.load(fileistream); return props; } catch (IOException | IllegalArgumentException e) { throw new RuntimeException("Could not load properties from file " + filename, e); } }
Source:
void afterGroupNumChanged() { String groupsNumber = numGroups.getText().toString().trim(); if (numGroups.isFocused() && isValid(groupsNumber)) { namesPerGroup.setText(getOffset(groupsNumber)); } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isValid(groupsNumber)); }

Target:
void afterGroupNumChanged() { String numberOfGroupsInput = numGroups.getText().toString().trim(); if (numGroups.isFocused() && isValid(groupsNumber)) { namesPerGroup.setText(getOffset(groupsNumber)); } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isValid(groupsNumber)); }
Source:
public void addChildConnection(PhoenixConnection connection) { synchronized (this) { if (childConnections == null) { childConnections = new ConcurrentLinkedQueue<>(); } } childConnections.add(connection); }

Target:
public void addChildConnection(PhoenixConnection connection) { if(childConnections == null) { synchronized (queueCreationLock) { if (childConnections == null) { childConnections = new ConcurrentLinkedQueue<>(); } } } childConnections.add(connection); }
Source:
public void testGetRank() { setUp(); long result = iterator.getRank(); assertEquals(1L, result); }

Target:
public void testGetRank() { long result = iterator.getRank(); assertEquals(2L, result); }
Source:
private boolean isMbeanAccessible() { Object attr = null; long startTime = System.currentTimeMillis(); while (attr == null && (System.currentTimeMillis() - startTime < mbeanTimeoutMillis)) { try { attr = localMBeanServer.getAttribute(new ObjectName(mbeanName), mbeanAttributeName); if (!isNumeric(attr)) { LOGGER.debug("{} from MBean has non-numeric data", mbeanAttributeName, mbeanName); return false; } if (!(attr instanceof Integer) && !(attr instanceof Long) && !(attr instanceof Float) && !(attr instanceof Double)) { return false; } } catch (Exception e) { try { LOGGER.trace("MBean not found, sleeping...", mbeanName); Thread.sleep(1000); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } } } return attr != null; }

Target:
private boolean isMbeanAccessible() { Object attr = null; long startTime = System.currentTimeMillis(); while (attr == null && (System.currentTimeMillis() - startTime < mbeanTimeoutMillis)) { try { attr = localMBeanServer.getAttribute(new ObjectName(mbeanName), mbeanAttributeName); if (!isNumeric(attr)) { LOGGER.debug("{} from MBean has non-numeric data", mbeanAttributeName, mbeanName); return false; } if (!(attr instanceof Integer) && !(attr instanceof Long) && !(attr instanceof Float) && !(attr instanceof Double)) { return false; } } catch (Exception e) { try { LOGGER.trace("MBean not found, sleeping...", mbeanName); Thread.sleep(1000); } catch (InterruptedException ie) { } } } return attr != null; }
Source:
private void toggleOffline(@NonNull ReadingListPage page) { updatePageItemUI(page); if (shouldForceDownloadOverMobileData()) { ReadingListsFragment.showMobileDataWarningDialog(requireActivity(), (dialog, which) -> toggleOffline(page, true)); } else { toggleOffline(page, !Prefs.isDownloadingReadingListArticlesEnabled()); } }

Target:
private void toggleOffline(@NonNull ReadingListPage page) { updatePageProgress(page); if (shouldForceDownloadOverMobileData()) { ReadingListsFragment.showMobileDataWarningDialog(requireActivity(), (dialog, which) -> toggleOffline(page, true)); } else { toggleOffline(page, !Prefs.isDownloadingReadingListArticlesEnabled()); } }
Source:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); boolean localFs = isLocalFs(dom); if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } else if (vds.getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_HOST_NOT_UP, String.format("$%1$s %2$s", "hostName", vds.getName())); } if (!checkStorageDomain()) { return false; } if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }

Target:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); boolean localFs = isLocalFs(dom); if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } else if (vds.getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_HOST_NOT_UP, String.format("$%1$s %2$s", "hostName", vds.getName())); } StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); if (!checkStorageDomain()) { return false; } if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }
Source:
public boolean isGround() { return isConcreteCollection() && super.isGround(); }

Target:
public final boolean isGround() { return isConcreteCollection() && super.isGround(); }
Source:
public void testEqualsId() { import1.setId(new Id("123")); import2.setId(new Id("123")); assertEquals(import1, import2); }

Target:
public void testEqualsId() { assertEquals(import1, import2); }
Source:
public Builder setDataSize(Estimate dataSize) { this.dataSize = requireNonNull(dataSize, "dataSize can not be null"); return this; }

Target:
public Builder setDataSize(Estimate dataSize) { this.dataSize = dataSize; return this; }
Source:
public void testToStreamNonErrorHandlingThread() throws JSONException, IOException { StackTraceElement[] stacktrace = { new StackTraceElement("", "run_func", "librunner.so", 5038), new StackTraceElement("Runner", "runFunc", "Runner.java", 14), new StackTraceElement("App", "launch", "App.java", 70), }; CachedThread thread = new CachedThread(new Configuration("key"), 24, "main-one", "ando", false, stacktrace); JSONObject result = streamableToJson(thread); assertEquals(24, result.getLong("id")); assertEquals("main-one", result.getString("name")); assertEquals("ando", result.getString("type")); boolean thrown = false; try { result.getBoolean("errorReportingThread"); } catch (JSONException ex) { thrown = true; } assertTrue("errorReportingThread should not be set", thrown); JSONArray frames = result.getJSONArray("stacktrace"); assertEquals(3, frames.length()); assertEquals("run_func", frames.getJSONObject(0).getString("method")); assertEquals("librunner.so", frames.getJSONObject(0).getString("file")); assertEquals(5038, frames.getJSONObject(0).getInt("lineNumber")); assertEquals("Runner.runFunc", frames.getJSONObject(1).getString("method")); assertEquals("Runner.java", frames.getJSONObject(1).getString("file")); assertEquals(14, frames.getJSONObject(1).getInt("lineNumber")); assertEquals("App.launch", frames.getJSONObject(2).getString("method")); assertEquals("App.java", frames.getJSONObject(2).getString("file")); assertEquals(70, frames.getJSONObject(2).getInt("lineNumber")); }

Target:
public void testToStreamNonErrorHandlingThread() throws JSONException, IOException { StackTraceElement[] stacktrace = { new StackTraceElement("", "run_func", "librunner.so", 5038), new StackTraceElement("Runner", "runFunc", "Runner.java", 14), new StackTraceElement("App", "launch", "App.java", 70), }; CachedThread thread = new CachedThread(new Configuration("key"), 24, "main-one", "ando", false, stacktrace); JSONObject result = streamableToJson(thread); assertEquals(24, result.getLong("id")); assertEquals("main-one", result.getString("name")); assertEquals("ando", result.getString("type")); assertFalse("Error reporting thread should not be set when false", result.has("errorReportingThread")); JSONArray frames = result.getJSONArray("stacktrace"); assertEquals(3, frames.length()); assertEquals("run_func", frames.getJSONObject(0).getString("method")); assertEquals("librunner.so", frames.getJSONObject(0).getString("file")); assertEquals(5038, frames.getJSONObject(0).getInt("lineNumber")); assertEquals("Runner.runFunc", frames.getJSONObject(1).getString("method")); assertEquals("Runner.java", frames.getJSONObject(1).getString("file")); assertEquals(14, frames.getJSONObject(1).getInt("lineNumber")); assertEquals("App.launch", frames.getJSONObject(2).getString("method")); assertEquals("App.java", frames.getJSONObject(2).getString("file")); assertEquals(70, frames.getJSONObject(2).getInt("lineNumber")); }
Source:
public ClientKeyValueStoreListener(EntryStatus[] types) { List<EntryStatus> eventTypes = Arrays.asList(types); listenCreated = eventTypes.contains(EntryStatus.CREATED) ? true : false; listenUpdated = eventTypes.contains(EntryStatus.UPDATED) ? true : false; listenDeleted = eventTypes.contains(EntryStatus.DELETED) ? true : false; }

Target:
private ClientKeyValueStoreListener(EntryStatus[] types) { List<EntryStatus> eventTypes = Arrays.asList(types); listenCreated = eventTypes.contains(EntryStatus.CREATED); listenUpdated = eventTypes.contains(EntryStatus.UPDATED); listenDeleted = eventTypes.contains(EntryStatus.DELETED); }
Source:
Mono<Response<Void>> setTagsWithResponse(Map<String, String> tags, Context context) { List<BlobTag> tagList = null; if (tags != null) { tagList = new ArrayList<>(); for (String tag : tags.keySet()) { tagList.add(new BlobTag().setKey(tag).setValue(tags.get(tag))); } } BlobTags t = new BlobTags().setBlobTagSet(tagList); return this.azureBlobStorage.blobs().setTagsWithRestResponseAsync(null, null, null, snapshot, null , null, null, null, t, context) .map(response -> new SimpleResponse<>(response, null)); }

Target:
Mono<Response<Void>> setTagsWithResponse(Map<String, String> tags, Context context) { List<BlobTag> tagList = null; if (tags != null) { tagList = new ArrayList<>(); for (Map.Entry<String, String> entry : tags.entrySet()) { tagList.add(new BlobTag().setKey(entry.getKey()).setValue(entry.getValue())); } } BlobTags t = new BlobTags().setBlobTagSet(tagList); return this.azureBlobStorage.blobs().setTagsWithRestResponseAsync(null, null, null, versionId, null, null, null, t, context) .map(response -> new SimpleResponse<>(response, null)); }
Source:
public Builder<?> read(NearCacheConfiguration template) { mode = template.mode(); maxEntries = template.maxEntries(); Pattern pattern = template.cacheNamePattern(); cacheNamePattern = pattern; return this; }

Target:
public Builder<?> read(NearCacheConfiguration template) { mode = template.mode(); maxEntries = template.maxEntries(); cacheNamePattern = template.cacheNamePattern(); return this; }
Source:
public LowResMapOverlay(final Context aContext, boolean isMLSTileStore, MapView mapView) { super(aContext); ITileSource coverageTileSource; if (isMLSTileStore) { coverageTileSource = new XYTileSource("MozStumbler Tile Store", null, 13, 13, AbstractMapOverlay.TILE_PIXEL_SIZE, AbstractMapOverlay.FILE_TYPE_SUFFIX_PNG, new String[]{BuildConfig.TILE_SERVER_URL}); } else { coverageTileSource = new XYTileSource("MapquestOSM", ResourceProxy.string.mapquest_osm, 13, 13, AbstractMapOverlay.TILE_PIXEL_SIZE, ".jpg", new String[]{ "<LINK_3>", "<LINK_1>", "<LINK_2>", "<LINK_0>"}); } this.setLoadingBackgroundColor(Color.TRANSPARENT); mTileProvider.setTileRequestCompleteHandler(new SimpleInvalidationHandler(mapView)); mTileProvider.setTileSource(coverageTileSource); }

Target:
public LowResMapOverlay(final Context aContext, boolean isMLSTileStore, MapView mapView) { super(aContext); ITileSource coverageTileSource; if (isMLSTileStore) { coverageTileSource = new XYTileSource("MozStumbler Tile Store", null, AbstractMapOverlay.MIN_ZOOM_LEVEL_OF_MAP, AbstractMapOverlay.MIN_ZOOM_LEVEL_OF_MAP, AbstractMapOverlay.TILE_PIXEL_SIZE, AbstractMapOverlay.FILE_TYPE_SUFFIX_PNG, new String[]{BuildConfig.TILE_SERVER_URL}); } else { coverageTileSource = new XYTileSource("MapquestOSM", ResourceProxy.string.mapquest_osm, AbstractMapOverlay.MIN_ZOOM_LEVEL_OF_MAP, AbstractMapOverlay.MIN_ZOOM_LEVEL_OF_MAP, AbstractMapOverlay.TILE_PIXEL_SIZE, ".jpg", new String[]{ "<LINK_3>", "<LINK_1>", "<LINK_2>", "<LINK_0>"}); } this.setLoadingBackgroundColor(Color.TRANSPARENT); mTileProvider.setTileRequestCompleteHandler(new SimpleInvalidationHandler(mapView)); mTileProvider.setTileSource(coverageTileSource); }
Source:
public void run() { Properties properties = new Properties(); properties.put("metadata.broker.list", "localhost:9092"); properties.put("partitioner.class", "com.pinterest.secor.tools.RandomPartitioner"); properties.put("serializer.class", "kafka.serializer.DefaultEncoder"); properties.put("key.serializer.class", "kafka.serializer.StringEncoder"); properties.put("request.required.acks", "1"); ProducerConfig config = new ProducerConfig(properties); Producer<String, byte[]> producer = new Producer<String, byte[]>(config); TProtocolFactory protocol = null; if(mType.equals("json")) { protocol = new TSimpleJSONProtocol.Factory(); } else if (mType.equals("binary")) { protocol = new TBinaryProtocol.Factory(); } else { throw new RuntimeException("Undefined message encoding type"); } TSerializer serializer = new TSerializer(protocol); for (int i = 0; i < mNumMessages; ++i) { TestMessage testMessage = new TestMessage(System.currentTimeMillis() * 1000000L + i, "some_value_" + i); if (i % 2 == 0) { testMessage.setEnumField(TestEnum.SOME_VALUE); } else { testMessage.setEnumField(TestEnum.SOME_OTHER_VALUE); } byte[] bytes; try { bytes = serializer.serialize(testMessage); } catch(TException e) { throw new RuntimeException("Failed to serialize message " + testMessage, e); } KeyedMessage<String, byte[]> data = new KeyedMessage<String, byte[]>( mTopic, Integer.toString(i), bytes); producer.send(data); } producer.close(); }

Target:
public void run() { Properties properties = new Properties(); properties.put("metadata.broker.list", "localhost:9092"); properties.put("partitioner.class", "com.pinterest.secor.tools.RandomPartitioner"); properties.put("serializer.class", "kafka.serializer.DefaultEncoder"); properties.put("key.serializer.class", "kafka.serializer.StringEncoder"); properties.put("request.required.acks", "1"); ProducerConfig config = new ProducerConfig(properties); Producer<String, byte[]> producer = new Producer<String, byte[]>(config); TProtocolFactory protocol = null; if(mType.equals("json")) { protocol = new TSimpleJSONProtocol.Factory(); } else if (mType.equals("binary")) { protocol = new TBinaryProtocol.Factory(); } else { throw new RuntimeException("Undefined message encoding type: " + mType); } TSerializer serializer = new TSerializer(protocol); for (int i = 0; i < mNumMessages; ++i) { TestMessage testMessage = new TestMessage(System.currentTimeMillis() * 1000000L + i, "some_value_" + i); if (i % 2 == 0) { testMessage.setEnumField(TestEnum.SOME_VALUE); } else { testMessage.setEnumField(TestEnum.SOME_OTHER_VALUE); } byte[] bytes; try { bytes = serializer.serialize(testMessage); } catch(TException e) { throw new RuntimeException("Failed to serialize message " + testMessage, e); } KeyedMessage<String, byte[]> data = new KeyedMessage<String, byte[]>( mTopic, Integer.toString(i), bytes); producer.send(data); } producer.close(); }
Source:
public void testHlsSampleAes_bbb_unmuxed_1500k() throws Exception { if (!MediaUtils.checkDecoder(MediaFormat.MIMETYPE_VIDEO_AVC)) { return; } MediaCodecList mcl = new MediaCodecList(MediaCodecList.REGULAR_CODECS); for (MediaCodecInfo info : mcl.getCodecInfos()) { if (info.isEncoder() || info.getName().toLowerCase().startsWith("omx.google.")) { continue; } try { CodecCapabilities caps = info.getCapabilitiesForType(MediaFormat.MIMETYPE_VIDEO_AVC); VideoCapabilities vcaps = caps.getVideoCapabilities(); if (vcaps.areSizeAndRateSupported(1920 ,1080, 30)) { playLiveVideoTest( "<LINK_0>" + "bbb_1080p_30fps_11min/unmuxed_1500k/prog_index.m3u8", 60 * 1000); } } catch (IllegalArgumentException e) { } } }

Target:
public void testHlsSampleAes_bbb_unmuxed_1500k() throws Exception { if (!MediaUtils.checkDecoder(MediaFormat.MIMETYPE_VIDEO_AVC)) { return; } MediaFormat format = MediaFormat.createVideoFormat(MediaFormat.MIMETYPE_VIDEO_AVC, 1920, 1080); String[] decoderNames = MediaUtils.getDecoderNames(false, format); if (decoderNames.length == 0) { MediaUtils.skipTest("No decoders for " + format); } else { playLiveVideoTest( "<LINK_0>" + "bbb_1080p_30fps_11min/unmuxed_1500k/prog_index.m3u8", 60 * 1000); } }
Source:
public static org.eclipse.uml2.uml.Package getPackage(EPackage definition, EObject context) { org.eclipse.uml2.uml.Package package_ = getPackage(definition); if (package_ == null && context != null) { Resource eResource = context.eResource(); if (eResource != null) { ResourceSet resourceSet = eResource.getResourceSet(); if (resourceSet != null) { String nsURI = definition.getNsURI(); URI location = UMLPlugin .getEPackageNsURIToPackageLocationMap().get(nsURI); if (location == null) { location = UMLPlugin.getEPackageNsURIToProfileLocationMap().get(nsURI); } if (location != null) { try { package_ = (org.eclipse.uml2.uml.Package) resourceSet.getEObject( location, true); } catch (Exception e) { UMLPlugin.INSTANCE.log(e); } } else { LOOP : for (Resource resource : resourceSet .getResources()) { for (TreeIterator<Object> allProperContents = EcoreUtil .getAllProperContents(resource, false); allProperContents .hasNext();) { Object object = allProperContents.next(); if (object instanceof org.eclipse.uml2.uml.Package) { EAnnotation eAnnotation = ((org.eclipse.uml2.uml.Package) object) .getEAnnotation(UML2_UML_PACKAGE_2_0_NS_URI); if (eAnnotation != null) { for (EObject content : eAnnotation .getContents()) { if (content instanceof EPackage && safeEquals(nsURI, ((EPackage) content) .getNsURI())) { package_ = (org.eclipse.uml2.uml.Package) object; break LOOP; } } } allProperContents.prune(); } } } } } } } return package_; }

Target:
public static org.eclipse.uml2.uml.Package getPackage(EPackage definition, EObject context) { org.eclipse.uml2.uml.Package package_ = getPackage(definition); if (package_ == null && context != null) { Resource eResource = context.eResource(); if (eResource != null) { ResourceSet resourceSet = eResource.getResourceSet(); if (resourceSet != null) { String nsURI = definition.getNsURI(); URI location = UMLPlugin .getEPackageNsURIToPackageLocationMap().get(nsURI); if (location != null) { try { package_ = (org.eclipse.uml2.uml.Package) resourceSet.getEObject( location, true); } catch (Exception e) { UMLPlugin.INSTANCE.log(e); } } else { LOOP : for (Resource resource : resourceSet .getResources()) { for (TreeIterator<Object> allProperContents = EcoreUtil .getAllProperContents(resource, false); allProperContents .hasNext();) { Object object = allProperContents.next(); if (object instanceof org.eclipse.uml2.uml.Package) { EAnnotation eAnnotation = ((org.eclipse.uml2.uml.Package) object) .getEAnnotation(UML2_UML_PACKAGE_2_0_NS_URI); if (eAnnotation != null) { for (EObject content : eAnnotation .getContents()) { if (content instanceof EPackage && safeEquals(nsURI, ((EPackage) content) .getNsURI())) { package_ = (org.eclipse.uml2.uml.Package) object; break LOOP; } } } allProperContents.prune(); } } } } } } } return package_; }
Source:
public boolean canProvision(Label label) { if (slaveInfos != null) { for (MesosSlaveInfo slaveInfo : slaveInfos) { if (slaveInfo.matchesLabel(label)) { return true; } if (label.toString().startsWith(slaveInfo.getLabelString() + ":")) { return true; } } } return false; }

Target:
public boolean canProvision(Label label) { if (slaveInfos != null) { for (MesosSlaveInfo slaveInfo : slaveInfos) { if (slaveInfo.matchesLabel(label)) { return true; } } } return false; }
Source:
public void testGetWithStartIndexAndPageSize() throws PersistenceException, IOException, SolrServerException { QueryResponse response = mock(QueryResponse.class); SolrDocumentList docList = getSolrDocuments(); when(response.getResults()).thenReturn(docList); when(solrClient.query(any(), eq(METHOD.POST))).thenReturn(response); List<Map<String, Object>> items = persistentStore.get("testcore", "", 0, 1); verify(solrClient).query(solrParamsArgumentCaptor.capture(), eq(METHOD.POST)); final SolrParams solrParams = solrParamsArgumentCaptor.getValue(); assertThat(items.size(), equalTo(2)); assertThat(solrParams.get("start"), is("0")); assertThat(solrParams.get("rows"), is("1")); assertThat(items.get(0).get("id_txt"), equalTo("idvalue1")); }

Target:
public void testGetWithStartIndexAndPageSize() throws PersistenceException, IOException, SolrServerException { QueryResponse response = mock(QueryResponse.class); when(response.getResults()).thenReturn(getSolrDocuments(1)); when(solrClient.query(any(), eq(METHOD.POST))).thenReturn(response); List<Map<String, Object>> items = persistentStore.get("testcore", "", 0, 1); verify(solrClient).query(solrParamsArgumentCaptor.capture(), eq(METHOD.POST)); final SolrParams solrParams = solrParamsArgumentCaptor.getValue(); assertThat(items.size(), equalTo(1)); assertThat(solrParams.get("start"), is("0")); assertThat(solrParams.get("rows"), is("1")); assertThat(items.get(0).get("id_txt"), equalTo("idvalue1")); }
Source:
private void logResultOfPrestartVms(int prestartedVmsCounter, int numOfVmsToPrestart, Guid vmPoolId, Map<String, Integer> failureReasons) { if (prestartedVmsCounter > 0) { log.info("Prestarted Vms out of the required, in VmPool '{}'", prestartedVmsCounter, numOfVmsToPrestart, vmPoolId); } else { log.info("Failed to prestart any Vms for VmPool '{}'", vmPoolId); } if (prestartedVmsCounter < numOfVmsToPrestart) { for (Map.Entry<String, Integer> entry : failureReasons.entrySet()) { log.info("Failed to prestart Vms with reason {}", entry.getValue(), entry.getKey()); } } }

Target:
private void logResultOfPrestartVms(int prestartedVmsCounter, int numOfVmsToPrestart, Guid vmPoolId, Map<String, Integer> failureReasons) { if (prestartedVmsCounter > 0) { log.info("Prestarted VMs out of the required, in VmPool '{}'", prestartedVmsCounter, numOfVmsToPrestart, vmPoolId); } else { log.info("Failed to prestart any VMs for VmPool '{}'", vmPoolId); } if (prestartedVmsCounter < numOfVmsToPrestart) { for (Map.Entry<String, Integer> entry : failureReasons.entrySet()) { log.info("Failed to prestart VMs with reason {}", entry.getValue(), entry.getKey()); } } }
Source:
public OperationResult<String> d_mset(final String... keysvalues) { if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { return connPool.executeWithFailover(new MultiKeyOperation<String>(Arrays.asList(keysvalues), OpName.MSET) { @Override public String execute(Jedis client, ConnectionContext state) { return client.mset(keysvalues); } }); } else { return connPool.executeWithFailover(new CompressionValueMultiKeyOperation<String>(Arrays.asList(keysvalues), OpName.MSET) { @Override public String execute(final Jedis client, final ConnectionContext state) throws DynoException { return client.mset(keysvalues); } }); } }

Target:
public OperationResult<String> d_mset(final String... keysvalues) { if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { return connPool.executeWithFailover(new MultiKeyOperation<String>(Arrays.asList(keysvalues), OpName.MSET) { @Override public String execute(Jedis client, ConnectionContext state) { return client.mset(keysvalues); } }); } else { return connPool.executeWithFailover(new CompressionValueMultiKeyOperation<String>(Arrays.asList(keysvalues), OpName.MSET) { @Override public String execute(final Jedis client, final ConnectionContext state) { return client.mset(compressMultiKeyValue(state,keysvalues)); } }); } }
Source:
public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = super.getUpdatableProperties(); description.removeProperty("property"); addPropertiesCommonForCreateAndUpdate(description); return description; }

Target:
public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = getCreatableProperties(); description.removeProperty("property"); return description; }
Source:
public static ResultProducer<ResultSetIterable> returningGeneratedKeys(String... generatedKeyColumnNames) { return (supplier, ctx) -> { String[] columnNames = Stream.of(generatedKeyColumnNames) .filter(name -> name != null && !name.isEmpty()) .toArray(String[]::new); ctx.setReturningGeneratedKeys(true); if (columnNames.length > 0) { ctx.setGeneratedKeysColumnNames(columnNames); } return ResultSetIterable.of(getGeneratedKeys(supplier, ctx), ctx); }; }

Target:
public static ResultProducer<ResultSetIterable> returningGeneratedKeys(String... generatedKeyColumnNames) { return (supplier, ctx) -> { ctx.setReturningGeneratedKeys(true); if (generatedKeyColumnNames.length > 0) { ctx.setGeneratedKeysColumnNames(generatedKeyColumnNames); } return ResultSetIterable.of(getGeneratedKeys(supplier, ctx), ctx); }; }
Source:
private String getAdapterQueryLogUnsecuredSerrviceUrl() { String url = null; try { url = proxyHelper.getUrlLocalHomeCommunity(NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.debug("Error while retrieving url for " + NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME + ex.getLocalizedMessage(), ex); return url; } catch (Exception ex) { LOG.error("Failed to call the web service " + NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME + ex.getLocalizedMessage(), ex); } return url; }

Target:
private String getAdapterQueryLogUnsecuredSerrviceUrl() { String url = null; try { url = proxyHelper.getUrlLocalHomeCommunity(NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Error while retrieving url for {}: {}", NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME, ex.getLocalizedMessage(), ex); return url; } catch (Exception ex) { LOG.error("Failed to call the web service {}: {}", NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME, ex.getLocalizedMessage(), ex); } return url; }
Source:
public StoreStats storeStats() { final LongSupplier remainingRecoveryBytesSupplier; synchronized (mutex) { if (recoveryState == null) { remainingRecoveryBytesSupplier = () -> 0L; } else if (recoveryState.getStage() == RecoveryState.Stage.INIT) { remainingRecoveryBytesSupplier = () -> StoreStats.UNKNOWN_RESERVED_BYTES; } else if (recoveryState.getStage() == RecoveryState.Stage.INDEX) { final RecoveryState.Index indexStageRecoveryState = recoveryState.getIndex(); remainingRecoveryBytesSupplier = () -> { final long bytesStillToRecover = indexStageRecoveryState.bytesStillToRecover(); return bytesStillToRecover == -1 ? StoreStats.UNKNOWN_RESERVED_BYTES : bytesStillToRecover; }; } else { remainingRecoveryBytesSupplier = () -> 0L; } } try { return store.stats(remainingRecoveryBytesSupplier.getAsLong()); } catch (IOException e) { failShard("Failing shard because of exception during storeStats", e); throw new ElasticsearchException("io exception while building 'store stats'", e); } }

Target:
public StoreStats storeStats() { try { final RecoveryState recoveryState = this.recoveryState; final long bytesStillToRecover = recoveryState == null ? -1L : recoveryState.getIndex().bytesStillToRecover(); return store.stats(bytesStillToRecover == -1 ? StoreStats.UNKNOWN_RESERVED_BYTES : bytesStillToRecover); } catch (IOException e) { failShard("Failing shard because of exception during storeStats", e); throw new ElasticsearchException("io exception while building 'store stats'", e); } }
Source:
public void updateModelToTarget() { final IObservableSet<M> modelSet = model; modelSet.getRealm().exec(() -> { SetDiff<M> diff = Diffs.computeSetDiff(Collections.emptySet(), modelSet); doUpdate(modelSet, target, diff, modelToTarget, true, true); }); }

Target:
public void updateModelToTarget() { model.getRealm().exec(() -> { SetDiff<M> diff = Diffs.computeSetDiff(Collections.emptySet(), model); doUpdate(model, target, diff, modelToTarget, true, true); }); }
Source:
private Optional<Class> getClassByName(String name) { try { return Optional.of(Class .forName("com.vaadin.flow.component.dnd.DragSource")); } catch (ClassNotFoundException e) { return Optional.empty(); } }

Target:
private Optional<Class> getClassByName(String name) { try { return Optional.of(Class .forName(name)); } catch (ClassNotFoundException e) { return Optional.empty(); } }
Source:
private static <AutoClosableWrapper extends AutoCloseable & Wrapper> void close(AutoClosableWrapper dbObject) { if (dbObject != null) { try { dbObject.close(); } catch (SQLRecoverableException ex) { handleSQLRecoverableException(dbObject, ex); } catch (SQLException e) { log.error("Database error. Could not close statement. Continuing with others. - " + e.getMessage(), e); } catch (Exception e) { log.error("An unknown error occurred during close operation" + e.getMessage(), e); } finally { dbObject = null; } } }

Target:
private static <AutoClosableWrapper extends AutoCloseable & Wrapper> void close(AutoClosableWrapper dbObject) { if (dbObject != null) { try { dbObject.close(); } catch (SQLRecoverableException ex) { handleSQLRecoverableExceptionOnClose(dbObject, ex); } catch (SQLException e) { log.error("Database error. Could not close statement. Continuing with others. - " + e.getMessage(), e); } catch (Exception e) { log.error("An unknown error occurred during close operation" + e.getMessage(), e); } finally { dbObject = null; } } }
Source:
public ResponseEntity<?> addProfile(@AuthenticationPrincipal User user, @Validated @RequestBody ProfileDTO input) { Collection<RFIDLink> linkCollection = rfidLinkRepository.findRFIDLinksByEmail(user.getEmail()); if (linkCollection.isEmpty()) return this.addProfile(user.getId(), input); LocalDate currentBirthday = user.getProfile().getBirthday(); boolean isDateChanged = currentBirthday != input.getBirthday(); if (isDateChanged) { ProfileDTO changedInput = input; changedInput.setBirthday(currentBirthday); return this.addProfile(user.getId(), input); } return this.addProfile(user.getId(), input); }

Target:
public ResponseEntity<?> addProfile(@AuthenticationPrincipal User user, @Validated @RequestBody ProfileDTO input) { boolean isUserCheckedIn = rfidService.isOwnerLinked(user.getEmail()); if (!isUserCheckedIn) { return this.addProfile(user.getId(), input); } LocalDate currentBirthday = user.getProfile().getBirthday(); boolean isDateChanged = currentBirthday != input.getBirthday(); if (isDateChanged) { return createResponseEntity(HttpStatus.BAD_REQUEST, "Unable to change date during event", user.getProfile()); } return this.addProfile(user.getId(), input); }
Source:
public Response add(LinkedHashMap<String, Long> entity) throws SQLException, ClassNotFoundException { Context.getPermissionsManager().checkReadonly(getUserId()); checkAndLinkPermission(entity, true); Context.getPermissionsManager().refreshPermissions(entity); return Response.noContent().build(); }

Target:
public Response add(LinkedHashMap<String, Long> entity) throws SQLException, ClassNotFoundException { Context.getPermissionsManager().checkReadonly(getUserId()); Permission permission = new Permission(entity); checkPermission(permission, true); Context.getDataManager().linkObject(permission.getOwnerClass(), permission.getOwnerId(), permission.getPropertyClass(), permission.getPropertyId(), true); Context.getPermissionsManager().refreshPermissions(permission); return Response.noContent().build(); }
Source:
private void teleportAllPlayers(Server server, CommandSource sender, User target, String label) { sender.sendMessage(tl("teleportAll")); final Location loc = target.getLocation(); for (User player : ess.getOnlineUsers()) { if (target == player) { continue; } if (sender.equals(target.getBase()) && target.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !target.isAuthorized("essentials.worlds." + target.getWorld().getName())) { continue; } CompletableFuture<Exception> eFuture = new CompletableFuture<>(); eFuture.thenAccept(e -> showError(sender.getSender(), e, label)); player.getAsyncTeleport().now(loc, false, TeleportCause.COMMAND, eFuture, new CompletableFuture<>()); } }

Target:
private void teleportAllPlayers(Server server, CommandSource sender, User target, String label) { sender.sendMessage(tl("teleportAll")); final Location loc = target.getLocation(); for (User player : ess.getOnlineUsers()) { if (target == player) { continue; } if (sender.getSender().equals(target.getBase()) && target.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !target.isAuthorized("essentials.worlds." + target.getWorld().getName())) { continue; } player.getAsyncTeleport().now(loc, false, TeleportCause.COMMAND, getNewExceptionFuture(sender, label)); } }
Source:
protected void verifyProcessor(@NonNull MethodTree tree, final @NonNull IdentifierTree processorAnnotation) { final long count = Iterables.size(Iterables.filter(tree.parameters(), ClassParserUtils.getSimpleTypePredicate(imports))); if (count > maxArgumentsAllowed) { final String message = String .format("Processor '%s' has %d simple-type parameters marked as @Optional (more than %d, which is the maximum allowed). It's strongly recommended that all optional parameters are grouped inside a separate POJO class.", tree.simpleName(), count, maxArgumentsAllowed); logAndRaiseIssue(processorAnnotation, message); } }

Target:
protected void verifyProcessor(@NonNull MethodTree tree, final @NonNull IdentifierTree processorAnnotation) { long count = Iterables.size(Iterables.filter(tree.parameters(), Predicates.and(ClassParserUtils.simpleTypePredicate(imports), new Predicate<VariableTree>() { @Override public boolean apply(@Nullable VariableTree input) { return Iterables.any(input.modifiers().annotations(), ClassParserUtils.hasAnnotationPredicate(Optional.class)); } }))); if (count > maxArgumentsAllowed) { final String message = String .format("Processor '%s' has %d simple-type parameters marked as @Optional (more than %d, which is the maximum allowed). It's strongly recommended that all optional parameters are grouped inside a separate POJO class.", tree.simpleName(), count, maxArgumentsAllowed); logAndRaiseIssue(processorAnnotation, message); } }