auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Set<DatastreamTask> findOldUnusedTasks(Map<String, Set<DatastreamTask>> previousAssignmentByInstance, Map<String, List<DatastreamTask>> newAssignmentsByInstance) { Set<DatastreamTask> newTasks = newAssignmentsByInstance.values().stream().flatMap(Collection::stream).collect(Collectors.toSet()); Set<DatastreamTask> oldTasks = previousAssignmentByInstance.values().stream().flatMap(Collection::stream).collect(Collectors.toSet()); Set<DatastreamTask> unusedTasks = oldTasks.stream().filter(x -> !newTasks.contains(x)).collect(Collectors.toSet()); LOG.info("Unused tasks to be deleted: ", unusedTasks); return unusedTasks; }

Target:
private Set<DatastreamTask> findOldUnusedTasks(Map<String, Set<DatastreamTask>> previousAssignmentByInstance, Map<String, List<DatastreamTask>> newAssignmentsByInstance) { Set<DatastreamTask> newTasks = newAssignmentsByInstance.values().stream().flatMap(Collection::stream).collect(Collectors.toSet()); Set<DatastreamTask> oldTasks = previousAssignmentByInstance.values().stream().flatMap(Collection::stream).collect(Collectors.toSet()); Set<DatastreamTask> unusedTasks = oldTasks.stream().filter(x -> !newTasks.contains(x)).collect(Collectors.toSet()); LOG.info("Unused tasks to be deleted: {}", unusedTasks); return unusedTasks; }
Source:
public long getElapsedDays(int numDays) { long elapsed = getElapsedToday(); if (numDays > 0) { elapsed += numDays * MS_PER_DAY; } return elapsed; }

Target:
public long getElapsedDays(int numDays) { long elapsed = getElapsedToday(); elapsed += numDays * MS_PER_DAY; return elapsed; }
Source:
public static IncrementalIndex getNoBitmapIncrementalTestIndex() { synchronized (log) { if (noBitmapRealtimeIndex != null) { return noBitmapRealtimeIndex; } } return noBitmapRealtimeIndex = makeRealtimeIndex("druid.sample.numeric.tsv", false, false); }

Target:
public static IncrementalIndex getNoBitmapIncrementalTestIndex() { return noBitmapRealtimeIndex.get(); }
Source:
public void onGroupJoinCompletion() { if ("DONE".equals(getStatus())) { try { openSystemSession(); fireThreeDConversionsDoneEvent(session.getDocument(new IdRef(docId))); } finally { cleanUp(true, null); } } }

Target:
public void onGroupJoinCompletion() { if (STATUS_DONE.equals(getStatus())) { try { openSystemSession(); fireThreeDConversionsDoneEvent(session.getDocument(new IdRef(docId))); } finally { cleanUp(true, null); } } }
Source:
public String getValue() { final StringBuilder val = new StringBuilder(); if (this.major > -1) val.append(this.major); appendVersionComponent(val, this.minor); appendVersionComponent(val, this.build); appendVersionComponent(val, this.revision); return val.toString(); }

Target:
public String getValue() { final StringBuilder val = new StringBuilder(); if (this.major > -1) { val.append(this.major); } appendVersionComponent(val, this.minor); appendVersionComponent(val, this.build); appendVersionComponent(val, this.revision); return val.toString(); }
Source:
public Map<String, Float> classify(BufferedImage input) throws Exception { try (Predictor<BufferedImage, Classifications> predictor = model.newPredictor()) { Classifications classifications = predictor.predict(input); List<Classifications.Classification> list = classifications.items(); return list.stream().collect(Collectors.toMap(Classifications.Classification::getClassName, x -> (float) x.getProbability())); } catch (TranslateException e) { throw new TranslateException("Failed to process output", e); } }

Target:
public Map<String, Float> classify(BufferedImage input) throws Exception { try (Predictor<BufferedImage, Classifications> predictor = model.newPredictor()) { Classifications classifications = predictor.predict(input); List<Classifications.Classification> list = classifications.items(); return list.stream().collect(Collectors.toMap(Classifications.Classification::getClassName, x -> (float) x.getProbability())); } catch (TranslateException e) { LOG.error("Could not process input or output", e); throw new RuntimeException("Could not process input or output", e); } }
Source:
public void test() { for (TestBase test : new TestBase[] { basic, cashTerminal }) { current = test; for (DiagCode marker : DiagCode.values()) if (test.getIssueCode2diagnostic().containsKey(marker.diagCode)) for (AbstractValidationDiagnostic d : test .getIssueCode2diagnostic().get(marker.diagCode)) if (d instanceof FeatureBasedDiagnostic) checkDiagnostic((FeatureBasedDiagnostic) d, marker); } }

Target:
public void test() { for (TestBase test : new TestBase[] { basic, cashTerminal }) { current = test; Set<StateGraphItem> items = new HashSet<StateGraphItem>(); for (ActorClass ac : current.getRoomModel().getActorClasses()) { if (ac.getStateMachine() == null) continue; TreeIterator<EObject> iter = ac.getStateMachine() .eAllContents(); while (iter.hasNext()) { EObject obj = iter.next(); if (obj instanceof StateGraphItem) items.add((StateGraphItem) obj); } } for (DiagCode marker : DiagCode.values()) if (test.getIssueCode2diagnostic().containsKey(marker.diagCode)) for (AbstractValidationDiagnostic d : test .getIssueCode2diagnostic().get(marker.diagCode)) if (d instanceof FeatureBasedDiagnostic) checkDiagnostic((FeatureBasedDiagnostic) d, marker, items); for (StateGraphItem item : items) { Assert.assertTrue(item + " does not have warnings", !item .getName().matches(".*_(vt|vm|rm|sm)+")); } } }
Source:
public StreamsProducer(final Producer<byte[], byte[]> producer, final boolean eosEnabled, final LogContext logContext, final String applicationId) { this.log = logContext.logger(getClass()); this.producer = Objects.requireNonNull(producer, "producer cannot be null"); this.applicationId = applicationId; this.eosEnabled = eosEnabled; }

Target:
public StreamsProducer(final Producer<byte[], byte[]> producer, final boolean eosEnabled, final LogContext logContext, final String applicationId) { log = logContext.logger(getClass()); logPrefix = logContext.logPrefix().trim(); this.producer = Objects.requireNonNull(producer, "producer cannot be null"); this.applicationId = applicationId; this.eosEnabled = eosEnabled; }
Source:
private void getBlobInfoAndCompare(Router router, String blobId, BlobProperties blobProperties, byte[] usermetadata, RouterOperationCallback<BlobInfo> getBlobInfoCallback) throws Exception { Future<BlobInfo> getBlobInfoFuture; if (getBlobInfoCallback == null) { getBlobInfoFuture = router.getBlobInfo(blobId); } else { getBlobInfoFuture = router.getBlobInfo(blobId, getBlobInfoCallback); if (!getBlobInfoCallback.awaitCallback(1, TimeUnit.SECONDS)) { throw new IllegalStateException("getBlobInfo() timed out"); } else if (getBlobInfoCallback.getException() != null) { verifyExceptionMatch(getBlobInfoCallback, getBlobInfoFuture); throw getBlobInfoCallback.getException(); } assertTrue("GetBlobInfo: Future is not done but callback has been received", getBlobInfoFuture.isDone()); assertEquals("GetBlobInfo: Future BlobInfo and callback BlobInfo do not match", getBlobInfoFuture.get(), getBlobInfoCallback.getResult()); } BlobInfo blobInfo = getBlobInfoFuture.get(); compareBlobProperties(blobProperties, blobInfo.getBlobProperties()); byte[] getBlobInfoUserMetadata = blobInfo.getUserMetadata(); assertArrayEquals("User metadata does not match what was put", usermetadata, getBlobInfoUserMetadata); }

Target:
private void getBlobInfoAndCompare(Router router, String blobId, BlobProperties blobProperties, byte[] usermetadata, RouterOperationCallback<BlobInfo> getBlobInfoCallback) throws Exception { Future<BlobInfo> getBlobInfoFuture; if (getBlobInfoCallback == null) { getBlobInfoFuture = router.getBlobInfo(blobId); } else { getBlobInfoFuture = router.getBlobInfo(blobId, getBlobInfoCallback); if (getBlobInfoCallback.awaitCallback(1, TimeUnit.SECONDS)) { assertTrue("GetBlobInfo: Future is not done but callback has been received", getBlobInfoFuture.isDone()); if (getBlobInfoCallback.getException() == null) { assertEquals("GetBlobInfo: Future BlobInfo and callback BlobInfo do not match", getBlobInfoFuture.get(), getBlobInfoCallback.getResult()); } else { verifyFutureCallbackExceptionMatch(getBlobInfoCallback, getBlobInfoFuture); throw getBlobInfoCallback.getException(); } } else { throw new IllegalStateException("getBlobInfo() timed out"); } } BlobInfo blobInfo = getBlobInfoFuture.get(); verifyBlobPropertiesMatch(blobProperties, blobInfo.getBlobProperties()); byte[] getBlobInfoUserMetadata = blobInfo.getUserMetadata(); assertArrayEquals("User metadata does not match what was put", usermetadata, getBlobInfoUserMetadata); }
Source:
public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { if (authentication == null) { authentication = ACL.SYSTEM; } if (!ACL.SYSTEM.equals(authentication)) { User user; try { if (authentication == null || authentication instanceof AnonymousAuthenticationToken) { user = null; } else if (authentication == Jenkins.getAuthentication()) { user = User.current(); } else { user = User.get(authentication.getName()); } } catch (NullPointerException e) { LogRecord lr = new LogRecord(Level.FINE, "Could not find user for specified authentication. User credentials lookup aborted"); lr.setThrown(e); lr.setParameters(new Object[]{authentication}); LOGGER.log(lr); user = null; } if (user != null) { UserCredentialsProperty property = user.getProperty(UserCredentialsProperty.class); if (property != null) { boolean needImpersonation = !user.equals(User.current()); SecurityContext old = needImpersonation ? ACL.impersonate(user.impersonate()) : null; try { return DomainCredentials .getCredentials(property.getDomainCredentialsMap(), type, domainRequirements, always()); } finally { if (needImpersonation) { SecurityContextHolder.setContext(old); } } } } } return new ArrayList<>(); }

Target:
public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { if (authentication == null) { authentication = ACL.SYSTEM; } if (!ACL.SYSTEM.equals(authentication)) { User user; try { if (authentication == null || authentication instanceof AnonymousAuthenticationToken) { user = null; } else if (authentication == Jenkins.getAuthentication()) { user = User.current(); } else { user = User.get(authentication.getName()); } } catch (NullPointerException e) { LogRecord lr = new LogRecord(Level.FINE, "Could not find user for specified authentication. User credentials lookup aborted"); lr.setThrown(e); lr.setParameters(new Object[]{authentication}); LOGGER.log(lr); user = null; } if (user != null) { UserCredentialsProperty property = user.getProperty(UserCredentialsProperty.class); if (property != null) { boolean needImpersonation = !user.equals(User.current()); SecurityContext old = needImpersonation ? ACL.impersonate(user.impersonate()) : null; try { return DomainCredentials .getCredentials(property.getDomainCredentialsMap(), type, domainRequirements, always()); } finally { if (needImpersonation) { SecurityContextHolder.setContext(old); } } } } } return Collections.emptyList(); }
Source:
private void addCriteriaForFlows(final OnmsCriteria criteria, final Boolean hasFlows) { if (hasFlows == null) { return; } criteria.add(Restrictions.eq("node.hasFlows", hasFlows)); }

Target:
private void addCriteriaForFlows(final OnmsCriteria criteria, final Boolean hasFlows) { criteria.add(Restrictions.eq("node.hasFlows", hasFlows)); }
Source:
private List<UrlInfo> getTargetEndpoints(NhinTargetCommunitiesType targetCommunities) { List<UrlInfo> urlInfoList = null; try { urlInfoList = connectionManager.getEndpointURLFromNhinTargetCommunities(targetCommunities, NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Failed to obtain target URLs for service " + NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME + ex.getMessage(), ex); return null; } return urlInfoList; }

Target:
private List<UrlInfo> getTargetEndpoints(NhinTargetCommunitiesType targetCommunities) { List<UrlInfo> urlInfoList = null; try { urlInfoList = connectionManager.getEndpointURLFromNhinTargetCommunities(targetCommunities, NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Failed to obtain target URLs for service " + NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME + ex.getLocalizedMessage(), ex); return null; } return urlInfoList; }
Source:
void addVolume(FsVolumeImpl volume) { if (storageTypeVolumeMap.containsKey(volume.getStorageType())) { FsDatasetImpl.LOG.error("Found storage type already exist." + " Skipping for now. Please check disk configuration"); } else { storageTypeVolumeMap.put(volume.getStorageType(), volume); } }

Target:
boolean addVolume(FsVolumeImpl volume) { if (storageTypeVolumeMap.containsKey(volume.getStorageType())) { FsDatasetImpl.LOG.error("Found storage type already exist." + " Skipping for now. Please check disk configuration"); return false; } storageTypeVolumeMap.put(volume.getStorageType(), volume); return true; }
Source:
public PopupFlagCustomPageIndicatorMenu(Context ctx) { this.contextId = ctx.getId(); this.setText(Constant.messages.getString("custompages.popup.indicator", ctx.getName())); this.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { performAction(); } }); }

Target:
public PopupFlagCustomPageIndicatorMenu(Context ctx) { this.contextId = ctx.getId(); this.setText(Constant.messages.getString("custompages.popup.indicator", ctx.getName())); this.addActionListener(event -> performAction()); }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String key = getRequestParamValue(Const.ParamsNames.REGKEY); Assumption.assertNotNull(key); String institute = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_INSTITUTION); String isSampleDataImported = getRequestParamValue(Const.ParamsNames.IS_SAMPLE_DATA_IMPORTED); new GateKeeper().verifyLoggedInUserPrivileges(); try { if(institute !=null && !institute.isEmpty()){ Assumption.assertNotNull(isSampleDataImported); boolean isSampleImportedBool = true; if(isSampleDataImported.toLowerCase().contains("false")){ isSampleImportedBool = false; } logic.createAccountForNewInstructor(key, account.googleId, institute, isSampleImportedBool); }else{ logic.joinCourseForInstructor(key, account.googleId); } } catch (JoinCourseException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } catch (InvalidParametersException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } final String joinedCourseMsg = "Action Instructor Joins Course" + "<br/>Google ID: " + account.googleId + "<br/>Key : " + StringHelper.decrypt(key); if(statusToAdmin != null) { statusToAdmin += "<br/><br/>" + joinedCourseMsg; } else { statusToAdmin = joinedCourseMsg; } RedirectResult response = createRedirectResult(Const.ActionURIs.INSTRUCTOR_HOME_PAGE); InstructorAttributes instructor = logic.getInstructorForRegistrationKey(key); if(instructor != null) { response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, instructor.courseId); } return response; }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String key = getRequestParamValue(Const.ParamsNames.REGKEY); Assumption.assertNotNull(key); String institute = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_INSTITUTION); String isSampleDataImported = getRequestParamValue(Const.ParamsNames.IS_SAMPLE_DATA_IMPORTED); new GateKeeper().verifyLoggedInUserPrivileges(); try { if(institute !=null && !institute.isEmpty()){ Assumption.assertNotNull(isSampleDataImported); boolean isSampleImportedBool = Boolean.valueOf(isSampleDataImported); logic.createAccountForNewInstructor(key, account.googleId, institute, isSampleImportedBool); }else{ logic.joinCourseForInstructor(key, account.googleId); } } catch (JoinCourseException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } catch (InvalidParametersException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } final String joinedCourseMsg = "Action Instructor Joins Course" + "<br/>Google ID: " + account.googleId + "<br/>Key : " + StringHelper.decrypt(key); if(statusToAdmin != null) { statusToAdmin += "<br/><br/>" + joinedCourseMsg; } else { statusToAdmin = joinedCourseMsg; } RedirectResult response = createRedirectResult(Const.ActionURIs.INSTRUCTOR_HOME_PAGE); InstructorAttributes instructor = logic.getInstructorForRegistrationKey(key); if(instructor != null) { response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, instructor.courseId); } return response; }
Source:
public void setApplicationName(String applicationName) { this.applicationName = applicationName == null ? "Task-" + hashCode() : applicationName; }

Target:
public void setApplicationName(String applicationName) { this.applicationName = !StringUtils.hasText(applicationName) ? "Task-" + UUID.randomUUID().toString() : applicationName; }
Source:
public void testNumericLiteralDataType() { m_tester.sql("select * from R2 where si = 5.0 and i = 2 and f = 5.1") .transform("VoltLogicalCalc(expr#0..5=[{inputs}], expr#6=[CAST($t1):DOUBLE], expr#7=[5.0], expr#8=[=($t6, $t7)], " + "expr#9=[2], expr#10=[=($t0, $t9)], expr#11=[5.0], expr#12=[=($t4, $t11)], expr#13=[AND($t8, $t10, $t12)], " + "proj#0..5=[{exprs}], $condition=[$t13])\n" + " VoltLogicalTableScan(table=[[public, R2]])\n") .pass(); }

Target:
public void testNumericLiteralDataType() { m_tester.sql("select * from R2 where si = 5.0 and i = 2 and f = 5.0") .transform("VoltLogicalCalc(expr#0..5=[{inputs}], expr#6=[CAST($t1):DOUBLE], expr#7=[5.0], expr#8=[=($t6, $t7)], " + "expr#9=[2], expr#10=[=($t0, $t9)], expr#11=[5.0], expr#12=[=($t4, $t11)], expr#13=[AND($t8, $t10, $t12)], " + "proj#0..5=[{exprs}], $condition=[$t13])\n" + " VoltLogicalTableScan(table=[[public, R2]])\n") .pass(); }
Source:
public void init(String restServerUrl, ISchedulerClient client) { this.httpEngine = new ApacheHttpClient4Engine(new HttpClientBuilder().disableContentCompression() .useSystemProperties() .build()); this.restDataspaceUrl = restDataspaceUrl(restServerUrl); try { this.sessionId = client.getSession(); } catch (NotConnectedException e) { if (log.isDebugEnabled()) { log.debug("Error client trying to retrieve session from disconnected client"); } throw Throwables.propagate(e); } this.schedulerClient = client; }

Target:
public void init(String restServerUrl, ISchedulerClient client) { this.httpEngine = new ApacheHttpClient4Engine(new HttpClientBuilder().disableContentCompression() .useSystemProperties() .build()); this.restDataspaceUrl = restDataspaceUrl(restServerUrl); this.sessionId = client.getSession(); if (log.isDebugEnabled()) { log.debug("Error : trying to retrieve session from disconnected client."); } this.schedulerClient = client; }
Source:
public void deregisterToLogReplicationLock() throws Exception { LockClient lockClient = createLockClient(LockStateType.HAS_LEASE); lockClient.deregisterInterest(); }

Target:
public void deregisterToLogReplicationLock() throws Exception { LockClient lockClient = LockClient.newInstance(this.lockConfig, logReplicationNodeId, this.lockListener, runtime, Optional.of(LockStateType.HAS_LEASE)); lockClient.deregisterInterest(); }
Source:
protected static JSONObject taskParams(final Activity activity, final Task task) { HashMap<String, JSONObject> params = new HashMap<String, JSONObject>(); ObjectMapper mapper = getNetworkManager(activity).getObjectMapper(); try { JSONObject taskJson = new JSONObject(mapper.writeValueAsString(task)); taskJson.put("due_date", new SimpleDateFormat("yyyy/MM/dd").format(task.getDueDate())); params.put("task", taskJson); } catch (Exception e) { e.printStackTrace(); } return new JSONObject(params); }

Target:
protected static JSONObject taskParams(final Activity activity, final Task task) { HashMap<String, JSONObject> params = new HashMap<String, JSONObject>(); ObjectMapper mapper = getNetworkManager(activity).getObjectMapper(); try { JSONObject taskJson = new JSONObject(mapper.writeValueAsString(task)); params.put("task", taskJson); } catch (Exception e) { e.printStackTrace(); } return new JSONObject(params); }
Source:
public boolean canSpawnAt(LocalWorld world, Rotation rotation, int x, int y, int z) { BlockFunction[] blocks = settings.blocks[rotation.getRotationId()]; BO3Check[] checks = settings.bo3Checks[rotation.getRotationId()]; for (BO3Check check : checks) { if (check.preventsSpawn(world, x + check.x, y + check.y, z + check.z)) { return false; } } int blocksOutsideSourceBlock = 0; for (BlockFunction block : blocks) { if (!world.isLoaded(x + block.x, y + block.y, z + block.z)) { return false; } boolean insideSource = false; int blockPresent = world.getTypeId(x + block.x, y + block.y, z + block.z); for (Integer sblock : settings.sourceBlock) { if (sblock == blockPresent) { insideSource = true; break; } } if (!insideSource) { blocksOutsideSourceBlock++; } } if ((((double) blocksOutsideSourceBlock / (double) blocks.length) * 100.0) > settings.maxPercentageOutsideSourceBlock) { return false; } if (!TerrainControl.fireCanCustomObjectSpawnEvent(this, world, x, y, z)) { return false; } return true; }

Target:
public boolean canSpawnAt(LocalWorld world, Rotation rotation, int x, int y, int z) { BlockFunction[] blocks = settings.blocks[rotation.getRotationId()]; BO3Check[] checks = settings.bo3Checks[rotation.getRotationId()]; for (BO3Check check : checks) { if (check.preventsSpawn(world, x + check.x, y + check.y, z + check.z)) { return false; } } int blocksOutsideSourceBlock = 0; for (BlockFunction block : blocks) { if (!world.isLoaded(x + block.x, y + block.y, z + block.z)) { return false; } if (!settings.sourceBlock.contains(world.getTypeId(x + block.x, y + block.y, z + block.z))) { blocksOutsideSourceBlock++; } } if ((((double) blocksOutsideSourceBlock / (double) blocks.length) * 100.0) > settings.maxPercentageOutsideSourceBlock) { return false; } if (!TerrainControl.fireCanCustomObjectSpawnEvent(this, world, x, y, z)) { return false; } return true; }
Source:
@Override protected void executeCommand() { if (getLeaseAction().equals(VDSCommandType.AddVmLease)) { ActionReturnValue retVal = runInternalAction(ActionType.GetVmLeaseInfo, getParameters()); if (retVal.getSucceeded() && retVal.getActionReturnValue() != null) { log.info("VM '{}' lease already exists on storage domain '{}': '{}'", getParameters().getVmId(), getParameters().getStorageDomainId(), retVal.getActionReturnValue()); getParameters().setVmLeaseInfo(retVal.getActionReturnValue()); setSucceeded(true); return; } } super.executeCommand(); }

Target:
@Override protected void executeCommand() { ActionReturnValue retVal = runInternalAction(ActionType.GetVmLeaseInfo, getParameters()); if (retVal.getSucceeded() && retVal.getActionReturnValue() != null) { log.info("VM '{}' lease already exists on storage domain '{}': '{}'", getParameters().getVmId(), getParameters().getStorageDomainId(), retVal.getActionReturnValue()); getParameters().setVmLeaseInfo(retVal.getActionReturnValue()); setSucceeded(true); return; } super.executeCommand(); }
Source:
public ERDatabaseAttachment _process(EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete) throws IOException { NSData data = new NSData(uploadedFile.toURI().toURL()); ERDatabaseAttachment attachment = _process(editingContext, data, recommendedFileName, mimeType, configurationName); if (pendingDelete) { uploadedFile.delete(); } return attachment; }

Target:
public ERDatabaseAttachment _process(EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete) throws IOException { try { NSData data = new NSData(uploadedFile.toURI().toURL()); ERDatabaseAttachment attachment = _process(editingContext, data, recommendedFileName, mimeType, configurationName); return attachment; } finally { if (pendingDelete) { uploadedFile.delete(); } } }
Source:
public RuleAssert overrideStats(String nodeId, PlanNodeStatsEstimate nodeStats) { ((TestingStatsCalculator) statsCalculator).setNodeStats(new PlanNodeId(nodeId), nodeStats); return this; }

Target:
public RuleAssert overrideStats(String nodeId, PlanNodeStatsEstimate nodeStats) { statsCalculator.setNodeStats(new PlanNodeId(nodeId), nodeStats); return this; }
Source:
public static void beforeClass() throws Exception { adminSynapse = new SynapseAdminClientImpl(); SynapseClientHelper.setEndpoints(adminSynapse); adminSynapse.setUsername(StackConfigurationSingleton.singleton().getMigrationAdminUsername()); adminSynapse.setApiKey(StackConfigurationSingleton.singleton().getMigrationAdminAPIKey()); synapse = new SynapseClientImpl(); userId = SynapseClientHelper.createUser(adminSynapse, synapse); }

Target:
public static void beforeClass() throws Exception { adminSynapse = new SynapseAdminClientImpl(); SynapseClientHelper.setEndpoints(adminSynapse); adminSynapse.setUsername(StackConfigurationSingleton.singleton().getMigrationAdminUsername()); adminSynapse.setApiKey(StackConfigurationSingleton.singleton().getMigrationAdminAPIKey()); synapse = new SynapseClientImpl(); userId = SynapseClientHelper.createUser(adminSynapse, synapse); SynapseClientHelper.setEndpoints(synapse); }
Source:
private boolean verifyMetricsFromSinkOnce(Map<String, Long> expectedMetrics) { synchronized (GlobalPhoenixMetricsTestSink.lock) { for (AbstractMetric metric : GlobalPhoenixMetricsTestSink.metrics) { if (expectedMetrics.containsKey(metric.name())) { Long value = expectedMetrics.get(metric.name()); if (value != null) { long expectedValue = value; long actualValue = metric.value().longValue(); if (expectedValue != actualValue) { LOG.warn("Metric from Hadoop Sink: " + metric.name() + " didn't match expected."); LOG.warn("Expected: " + expectedValue + " Actual: " + actualValue); return false; } expectedMetrics.remove(metric.name()); } } } } assertTrue("Metric expected but not present in Hadoop Metrics Sink (GlobalPhoenixMetricsTestSink)", expectedMetrics.size() == 0); return true; }

Target:
private boolean verifyMetricsFromSinkOnce(Map<String, Long> expectedMetrics) { synchronized (GlobalPhoenixMetricsTestSink.lock) { for (AbstractMetric metric : GlobalPhoenixMetricsTestSink.metrics) { if (expectedMetrics.containsKey(metric.name())) { Long value = expectedMetrics.get(metric.name()); if (value != null) { long expectedValue = value; long actualValue = metric.value().longValue(); if (expectedValue != actualValue) { LOG.warn("Metric from Hadoop Sink: " + metric.name() + " didn't match expected."); return false; } expectedMetrics.remove(metric.name()); } } } } assertTrue("Metric expected but not present in Hadoop Metrics Sink (GlobalPhoenixMetricsTestSink)", expectedMetrics.size() == 0); return true; }
Source:
private boolean isUpgradeButtonAvailable(int position) { long currentPlanProductId = WordPress.wpDB.getPlanIdForLocalTableBlogId(mLocalBlogID); if (isBuyButtonAvailable(position) || PlansUtils.isFreePlan(currentPlanProductId)) { return false; } final Plan plan = getPageAdapter().getPlan(position); if (PlansUtils.isFreePlan(plan) || currentPlanProductId > plan.getProductID()) { return false; } return plan.isAvailable() && !plan.isCurrentPlan(); }

Target:
private boolean isUpgradeButtonAvailable(int position) { long currentPlanProductId = WordPress.wpDB.getPlanIdForLocalTableBlogId(mLocalBlogID); if (isBuyButtonAvailable(position) || PlansUtils.isFreePlan(currentPlanProductId)) { return false; } Plan currentPlan = PlansUtils.getPlan(mAvailablePlans, currentPlanProductId); if (currentPlan == null) { AppLog.w(AppLog.T.PLANS, "Blog's current plan with ID " + currentPlanProductId + "is not available anymore on wpcom!"); return false; } final Plan selectedPlan = getPageAdapter().getPlan(position); if (PlansUtils.isGreaterEquals(currentPlan, selectedPlan)) { return false; } return selectedPlan.isAvailable() && !selectedPlan.isCurrentPlan(); }
Source:
public synchronized JDBCConfiguration getJDBCDiskQuotaConfig() throws IOException, org.geowebcache.config.ConfigurationException { Resource configFile = configDir.get("geowebcache-diskquota-jdbc.xml"); if (!Resources.exists(configFile)) { return null; } try { JDBCConfiguration configuration; InputStream is = configFile.in(); try { configuration = JDBCConfiguration.load(is); } finally { is.close(); } return passwordHelper.unencryptPassword(configuration); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to load geowebcache-diskquota-jdbc.xml", e); return null; } }

Target:
public synchronized JDBCConfiguration getJDBCDiskQuotaConfig() throws IOException, org.geowebcache.config.ConfigurationException { Resource configFile = configDir.get("geowebcache-diskquota-jdbc.xml"); if (!Resources.exists(configFile)) { return null; } try { JDBCConfiguration configuration; try (InputStream is = configFile.in()) { configuration = JDBCConfiguration.load(is); } return passwordHelper.unencryptPassword(configuration); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to load geowebcache-diskquota-jdbc.xml", e); return null; } }
Source:
private CompletableFuture<Void> handleBatchRequest(TransferBatchRequest request, CompletableFuture<Void> allFutures, Semaphore semaphore) throws InterruptedException { if (request.getBatchType() == SEGMENT_INIT) { int numPermits = request.getDestinationNodes() .map(AbstractCollection::size).orElse(1) * NUM_REQUESTS_PER_NODE; if (numPermits == 0) { throw new IllegalStateException("Number of permits should be equal to" + " at least one."); } log.trace("Starting a new segment transfer. Parallelism level: {}", numPermits); semaphore.drainPermits(); semaphore.release(numPermits); } else if (request.getBatchType() == DATA) { semaphore.acquire(); CompletableFuture<Void> batchTransferResult = stateTransferBatchProcessor .transfer(request) .thenApply(response -> { semaphore.release(); if (response.getStatus() == SUCCEEDED) { return null; } else if (response.getStatus() == FAILED && response.getCauseOfFailure().isPresent()) { throw response.getCauseOfFailure().get(); } else { throw new StateTransferBatchProcessorException(); } }); allFutures = CFUtils.allOfOrTerminateExceptionally(allFutures, batchTransferResult); } else { throw new IllegalStateException("Unrecognized batch type: " + request.getBatchType()); } return allFutures; }

Target:
private CompletableFuture<Void> handleBatchRequest(TransferBatchRequest request, CompletableFuture<Void> allFutures, Semaphore semaphore) throws InterruptedException { semaphore.acquire(); CompletableFuture<Void> batchTransferResult = stateTransferBatchProcessor .transfer(request) .thenApply(response -> { semaphore.release(); if (response.getStatus() == SUCCEEDED) { return null; } else if (response.getStatus() == FAILED && response.getCauseOfFailure().isPresent()) { throw response.getCauseOfFailure().get(); } else { throw new StateTransferBatchProcessorException(); } }); allFutures = CFUtils.allOfOrTerminateExceptionally(allFutures, batchTransferResult); return allFutures; }
Source:
CircuitBreakerRegistry createCircuitBreakerRegistry( CircuitBreakerConfigurationProperties circuitBreakerProperties, RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer, CompositeCustomizer<CircuitBreakerConfigCustomizer> customizerMap) { Map<String, CircuitBreakerConfig> configs = circuitBreakerProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> circuitBreakerProperties .createCircuitBreakerConfig(entry.getKey(), entry.getValue(), customizerMap))); return CircuitBreakerRegistry.of(configs, circuitBreakerRegistryEventConsumer, circuitBreakerProperties.getTags()); }

Target:
CircuitBreakerRegistry createCircuitBreakerRegistry( CircuitBreakerConfigurationProperties circuitBreakerProperties, RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer, CompositeCustomizer<CircuitBreakerConfigCustomizer> customizerMap) { Map<String, CircuitBreakerConfig> configs = circuitBreakerProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> circuitBreakerProperties .createCircuitBreakerConfig(entry.getKey(), entry.getValue(), customizerMap))); return CircuitBreakerRegistry.of(configs, circuitBreakerRegistryEventConsumer, Map.copyOf(circuitBreakerProperties.getTags())); }
Source:
public synchronized Configuration getUserCmpTaskConf() { final String initialWorkloadStr; final String computationSpeedStr; try { if (bufferedReader == null) { bufferedReader = new BufferedReader(new FileReader(confFile)); } final String str = bufferedReader.readLine(); if (str == null) { initialWorkloadStr = "0"; computationSpeedStr = "1.0"; } else { final String[] args = str.trim().split("\\s+"); initialWorkloadStr = args[0]; final int initialWorkload = Integer.parseInt(initialWorkloadStr); if (initialWorkload < 0) { throw new RuntimeException(String.format("Initial workload is negative %d", initialWorkload)); } computationSpeedStr = args[1]; final float computationSpeed = Float.parseFloat(computationSpeedStr); if (computationSpeed < 0) { throw new RuntimeException(String.format("Computation speed is negative %f", computationSpeed)); } } } catch (final FileNotFoundException e) { throw new RuntimeException(String.format("No file named %s", confFile), e); } catch (final IOException e) { throw new RuntimeException(String.format("Failed to read line from %s", confFile), e); } catch (final NumberFormatException e) { throw new RuntimeException(String.format("Failed to parse integer or float from %s", confFile), e); } return Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(InitialWorkload.class, initialWorkloadStr) .bindNamedParameter(ComputationSpeed.class, computationSpeedStr) .build(); }

Target:
public Configuration getUserCmpTaskConf() { final String initialWorkloadStr; final String computationRateStr; final String str = readLineFromFile(); if (str == null) { return Tang.Factory.getTang().newConfigurationBuilder().build(); } else { final String[] args = str.split("\\s+"); initialWorkloadStr = args[0]; final int initialWorkload = Integer.parseInt(initialWorkloadStr); if (initialWorkload < 0) { throw new RuntimeException(String.format("Initial workload is negative %d", initialWorkload)); } computationRateStr = args[1]; final long computationRate = Long.parseLong(computationRateStr); if (computationRate < 0) { throw new RuntimeException(String.format("Computation rate is negative %d", computationRate)); } } return Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(InitialWorkload.class, initialWorkloadStr) .bindNamedParameter(ComputationRate.class, computationRateStr) .build(); }
Source:
public Object register(Object obj, Runnable action) { try { return createMtd.invoke(null, obj, action); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); throw new RuntimeException("Reflection failure: invoke sun.misc.Cleaner.create method failed", e); } }

Target:
public Object register(Object obj, Runnable action) { try { return createMtd.invoke(null, obj, action); } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Reflection failure: invoke sun.misc.Cleaner.create method failed", e); } }
Source:
public static boolean canBeDynamic() { Bundle uiWorkbenchBundle = Platform.getBundle("org.eclipse.ui.workbench"); Version junoStart = Version.parseVersion("3.103"); Version lunaStart = Version.parseVersion("3.106"); return uiWorkbenchBundle != null && uiWorkbenchBundle.getVersion().compareTo(junoStart) < 0 && uiWorkbenchBundle.getVersion().compareTo(lunaStart) >= 0; }

Target:
public static boolean canBeDynamic() { Bundle uiWorkbenchBundle = Platform.getBundle("org.eclipse.ui.workbench"); Version junoStart = Version.parseVersion("3.103"); Version lunaStart = Version.parseVersion("3.106"); return uiWorkbenchBundle != null && !Ranges.closedOpen(junoStart, lunaStart).contains(uiWorkbenchBundle.getVersion()); }
Source:
private String flattenList(List<?> list) { if (list.size() == 1) { return list.get(0).toString(); } if (list.size() > 1) { logger.warn("The JsonPath expression yielded more than one result: {}", list); } return UnDefType.NULL.toFullString(); }

Target:
private String flattenList(List<?> list) { if (list.size() == 1) { return list.get(0).toString(); } if (list.size() > 1) { logger.warn( "JsonPath expressions with more than one result are not allowed, please adapt your selector. Result: {}", list); } return UnDefType.NULL.toFullString(); }
Source:
public static BloomFilterReader getBloomFilterReader(PinotDataBuffer dataBuffer) { int typeValue = dataBuffer.getInt(0); int version = dataBuffer.getInt(4); Preconditions.checkState(typeValue == 1 && version == 1); return new OffHeapGuavaBloomFilterReader(dataBuffer.view(8, dataBuffer.size())); }

Target:
public static BloomFilterReader getBloomFilterReader(PinotDataBuffer dataBuffer) { int typeValue = dataBuffer.getInt(TYPE_VALUE_OFFSET); int version = dataBuffer.getInt(VERSION_OFFSET); Preconditions.checkState( typeValue == OnHeapGuavaBloomFilterCreator.TYPE_VALUE && version == OnHeapGuavaBloomFilterCreator.VERSION, "Unsupported bloom filter type value: %s and version: %s", typeValue, version); return new OffHeapGuavaBloomFilterReader(dataBuffer.view(HEADER_SIZE, dataBuffer.size())); }
Source:
public ConnectionAnchor(Block block) { this.block = block; this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handleMousePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::handleMouseDrag); this.addEventHandler(MouseEvent.MOUSE_RELEASED, this::handleMouseRelease); this.addEventHandler(TouchEvent.TOUCH_PRESSED, this::handleTouchPress); this.addEventHandler(TouchEvent.TOUCH_MOVED, this::handleTouchMove); this.addEventHandler(TouchEvent.TOUCH_RELEASED, this::handleTouchRelease); }

Target:
public ConnectionAnchor(Block block) { this.block = block; this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handleMousePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, event -> { if (this.wireInProgress != null && !event.isSynthesized()) { this.wireInProgress.handleMouseDrag(event); } }); this.addEventHandler(MouseEvent.MOUSE_RELEASED, event -> { if (this.wireInProgress != null && !event.isSynthesized()) { this.wireInProgress.handleMouseRelease(event); } }); this.addEventHandler(TouchEvent.TOUCH_PRESSED, this::handleTouchPress); this.addEventHandler(TouchEvent.TOUCH_MOVED, event -> { if (this.wireInProgress != null) { this.wireInProgress.handleTouchMove(event); } }); this.addEventHandler(TouchEvent.TOUCH_RELEASED, event -> { if (this.wireInProgress != null) { this.wireInProgress.handleTouchRelease(event); } }); }
Source:
private Mono<CosmosDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options, Context context) { String spanName = "createDatabase." + database.getId(); Mono<CosmosDatabaseResponse> responseMono = createDatabaseInternal(database, options); return tracerProvider.traceEnabledCosmosResponsePublisher(responseMono, context, spanName, database.getId(), this.serviceEndpoint); }

Target:
private Mono<CosmosDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options, Context context) { String spanName = "createDatabase." + database.getId(); Mono<CosmosDatabaseResponse> responseMono = asyncDocumentClient.createDatabase(database, ModelBridgeInternal.toRequestOptions(options)) .map(databaseResourceResponse -> ModelBridgeInternal.createCosmosDatabaseResponse(databaseResourceResponse)) .single(); return tracerProvider.traceEnabledCosmosResponsePublisher(responseMono, context, spanName, database.getId(), this.serviceEndpoint); }
Source:
static public int getRapidDefaultReadNameRegexSplit(final String readName, final char delim, final int[] tokens) { int tokensIdx = 0; int prevIdx = 0; for (int i = 0; i < readName.length(); i++) { if (readName.charAt(i) == delim) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, i)); tokensIdx++; if (4 < tokensIdx) return tokensIdx; prevIdx = i + 1; } } if (prevIdx < readName.length()) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, readName.length())); tokensIdx++; } return tokensIdx; }

Target:
public static int getRapidDefaultReadNameRegexSplit(final String readName, final char delim, final int[] tokens) { int tokensIdx = 0; int prevIdx = 0; for (int i = 0; i < readName.length(); i++) { if (readName.charAt(i) == delim) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, i)); tokensIdx++; if (4 < tokensIdx) return tokensIdx; prevIdx = i + 1; } } if (prevIdx < readName.length()) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, readName.length())); tokensIdx++; } return tokensIdx; }
Source:
private void startProcessMonitor() { this.getTaskExecutor().execute(() -> { Process process = OSDelegatingFileTailingMessageProducer.this.process; if (process == null) { if (logger.isDebugEnabled()) { logger.debug("Process destroyed before starting process monitor"); } return; } int result = Integer.MIN_VALUE; try { if (logger.isDebugEnabled()) { logger.debug("Monitoring process " + process); } result = process.waitFor(); if (logger.isInfoEnabled()) { logger.info("tail process terminated with value " + result); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.error("Interrupted - stopping adapter", e); stop(); } finally { destroyProcess(); } if (isRunning()) { if (logger.isInfoEnabled()) { logger.info("Restarting tail process in " + getMissingFileDelay() + " milliseconds"); } this.getRequiredTaskScheduler() .schedule(this::runExec, new Date(System.currentTimeMillis() + getMissingFileDelay())); } }); }

Target:
private void startProcessMonitor() { this.getTaskExecutor().execute(() -> { Process process = OSDelegatingFileTailingMessageProducer.this.process; if (process == null) { if (logger.isDebugEnabled()) { logger.debug("Process destroyed before starting process monitor"); } return; } int result = Integer.MIN_VALUE; try { if (logger.isDebugEnabled()) { logger.debug("Monitoring process " + process); } result = process.waitFor(); if (logger.isInfoEnabled()) { logger.info("tail process terminated with value " + result); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.error("Interrupted - stopping adapter", e); stop(); } finally { destroyProcess(); } if (isRunning()) { if (logger.isInfoEnabled()) { logger.info("Restarting tail process in " + getMissingFileDelay() + " milliseconds"); } getTaskScheduler() .schedule(this::runExec, new Date(System.currentTimeMillis() + getMissingFileDelay())); } }); }
Source:
public void onBindViewHolder(@NonNull LanguageViewHolder holder, int position) { String languageName = WikipediaApp.getInstance().getAppLanguageLocalizedName(items.get(position)); holder.languageName.setText(String.format(getContext().getString(R.string.multilingual_onboarding_laguage_string), String.valueOf(position + 1), languageName == null ? items.get(position) : languageName)); }

Target:
public void onBindViewHolder(@NonNull LanguageViewHolder holder, int position) { String languageName = WikipediaApp.getInstance().getAppLanguageLocalizedName(items.get(position)); holder.languageName.setText(String.format(getContext().getString(R.string.multilingual_onboarding_laguage_string), String.valueOf(position + 1), languageName)); }
Source:
private AbstractTreeIterator combineDF(final AbstractTreeIterator minRef) throws CorruptObjectException { AbstractTreeIterator treeMatch = null; for (final AbstractTreeIterator t : trees) { if (t.matches == minRef || t.eof()) continue; for (;;) { final int cmp = t.pathCompare(minRef, TREE_MODE); if (cmp < 0) { t.matchShift++; t.next(1); if (t.eof()) { t.back(t.matchShift); t.matchShift = 0; break; } } else if (cmp == 0) { t.matches = minRef; treeMatch = t; break; } else { if (t.matchShift != 0) { t.back(t.matchShift); t.matchShift = 0; } break; } } } if (treeMatch != null) { for (final AbstractTreeIterator t : trees) if (t.matches == minRef) t.matches = treeMatch; if (dfConflict == null && !isGitlink(minRef)) dfConflict = treeMatch; return treeMatch; } return minRef; }

Target:
private AbstractTreeIterator combineDF(final AbstractTreeIterator minRef) throws CorruptObjectException { AbstractTreeIterator treeMatch = null; for (final AbstractTreeIterator t : trees) { if (t.matches == minRef || t.eof()) continue; for (;;) { final int cmp = t.pathCompare(minRef, TREE_MODE); if (cmp < 0) { t.matchShift++; t.next(1); if (t.eof()) { t.back(t.matchShift); t.matchShift = 0; break; } } else if (cmp == 0) { t.matches = minRef; treeMatch = t; break; } else { if (t.matchShift != 0) { t.back(t.matchShift); t.matchShift = 0; } break; } } } if (treeMatch != null) { for (final AbstractTreeIterator t : trees) if (t.matches == minRef) t.matches = treeMatch; if (dfConflict == null && !isGitlink(minRef)) { dfConflict = treeMatch; } return treeMatch; } return minRef; }
Source:
private List<Target<Object>> createTargets(ControllerMethod method) { Method javaMethod = method.getMethod(); List<Target<Object>> targets = new ArrayList<>(); List<br.com.caelum.vraptor.http.Parameter> parameterNames = nameProvider.parametersFor(javaMethod); for (br.com.caelum.vraptor.http.Parameter p : parameterNames) { Type type = p.getParameterizedType(); if (type instanceof TypeVariable) { type = extractType(method); } targets.add(new Target<>(type, p.getName())); } return targets; }

Target:
private List<Target<Object>> createTargets(ControllerMethod method) { Method javaMethod = method.getMethod(); List<Target<Object>> targets = new ArrayList<>(); for (br.com.caelum.vraptor.http.Parameter p : nameProvider.parametersFor(javaMethod)) { Type type = p.getParameterizedType(); if (type instanceof TypeVariable) { type = extractType(method); } targets.add(new Target<>(type, p.getName())); } return targets; }
Source:
private void createBooleanAccessor() { accessors.put(Boolean.class, new Accessor<Boolean>() { @Override public Boolean get(String key, Boolean defaultValue) { return preferences.getBoolean(key, (defaultValue == null) ? false : defaultValue); } @Override public void put(String key, Boolean value) { editor.putBoolean(key, value).apply(); } }); }

Target:
private void createBooleanAccessor() { accessors.put(Boolean.class, new Accessor<Boolean>() { @Override public Boolean get(String key) { return preferences.getBoolean(key, false); } @Override public void put(String key, Boolean value) { editor.putBoolean(key, value).apply(); } }); }
Source:
public static List<RelCollation> calc(RelMetadataQuery mq, RelNode input, RexProgram program) { final List<RexNode> projects = program .getProjectList() .stream() .map((p) -> program.expandLocalRef(p)) .collect(Collectors.toList()); return enumrableCalc(mq, input, projects); }

Target:
public static List<RelCollation> calc(RelMetadataQuery mq, RelNode input, RexProgram program) { final List<RexNode> projects = program .getProjectList() .stream() .map((p) -> program.expandLocalRef(p)) .collect(Collectors.toList()); return project(mq, input, projects); }
Source:
private void updateGameMode( CommandSender sender, Player who, GameMode gameMode, ResourceBundle bundle) { String gameModeName = GameModeUtils.prettyPrint(gameMode, bundle.getLocale()); who.setGameMode(gameMode); if (sender.equals(who)) { new LocalizedStringImpl("gamemode.done.self", bundle).send(sender, gameModeName); } else { new LocalizedStringImpl("gamemode.done", bundle) .send(sender, who.getDisplayName(), gameModeName); } }

Target:
private void updateGameMode( CommandSender sender, Player who, GameMode gameMode, ResourceBundle bundle) { String gameModeName = GameModeUtils.prettyPrint(gameMode, bundle.getLocale()); who.setGameMode(gameMode); if (!sender.equals(who)) { new LocalizedStringImpl("gamemode.done", bundle) .send(sender, who.getDisplayName(), gameModeName); } new LocalizedStringImpl("gamemode.done.to-you", bundle).send(who, gameModeName); }