auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean equals(Object o) { if (this == o) return true; <START> if (o == null || getClass() != o.getClass()) <END> return false; Dependency that = (Dependency) o; return getArtifactCoordinates().equals(that.getArtifactCoordinates()); }</code><technical_language>please {}</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Dependency that = (Dependency) o; return getArtifactCoordinates().equals(that.getArtifactCoordinates()); }
Source:
<code>private void sendBase(String methodName, TBase<?, ?> args) throws TException { try { Method sendBase = TServiceClient.class.getDeclaredMethod( "sendBase", String.class, TBase.class); <START> sendBase.setAccessible(true); <END> sendBase.invoke(mClient, methodName, args); sendBase.setAccessible(false); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new RuntimeException("Unable to hack sendBase", e); } }</code><technical_language>do set unset time</technical_language>

Target:
private void sendBase(String methodName, TBase<?, ?> args) throws TException { try { Method sendBase = TServiceClient.class.getDeclaredMethod( "sendBase", String.class, TBase.class); sendBase.setAccessible(true); sendBase.invoke(mClient, methodName, args); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new RuntimeException("Unable to invoke sendBase", e); } }
Source:
<code>public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && args[0].contains("lock") && user.isAuthorized("essentials.jump.lock")) { if (user.isFlyClickJump()) { user.setRightClickJump(false); user.sendMessage("Flying wizard mode disabled"); } else { user.setRightClickJump(true); user.sendMessage("Enabling flying wizard mode"); } return; } Location loc; final Location cloc = user.getLocation(); try { loc = LocationUtil.getTarget(user.getBase()); loc.setYaw(cloc.getYaw()); loc.setPitch(cloc.getPitch()); loc.setY(loc.getY() + 1); } catch (NullPointerException ex) { throw new Exception(tl("jumpError"), ex); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); <START> user.getAsyncTeleport().teleport(loc, charge, TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel), new CompletableFuture<>()); <END> }</code><technical_language>I tell, throw new NoChargeException() is prevent players paying command cost for /jump command teleport itself. this change alter this behaviour (or I reading wrong)</technical_language>

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && args[0].contains("lock") && user.isAuthorized("essentials.jump.lock")) { if (user.isFlyClickJump()) { user.setRightClickJump(false); user.sendMessage("Flying wizard mode disabled"); } else { user.setRightClickJump(true); user.sendMessage("Enabling flying wizard mode"); } return; } Location loc; final Location cloc = user.getLocation(); try { loc = LocationUtil.getTarget(user.getBase()); loc.setYaw(cloc.getYaw()); loc.setPitch(cloc.getPitch()); loc.setY(loc.getY() + 1); } catch (NullPointerException ex) { throw new Exception(tl("jumpError"), ex); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); user.getAsyncTeleport().teleport(loc, charge, TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel)); }
Source:
<code>public Set<Item> getAllMembers() { <START> return Collections.unmodifiableSet(getMembers((Item i) -> !(i instanceof GroupItem))); <END> }</code><technical_language>respect copyOf, this wrapped in new HashSet(...)</technical_language>

Target:
public Set<Item> getAllMembers() { return Collections.unmodifiableSet(new LinkedHashSet<Item>(getMembers((Item i) -> !(i instanceof GroupItem)))); }
Source:
<code>private static QueryError toQueryError(QueryInfo queryInfo) { FailureInfo failure = queryInfo.getFailureInfo(); if (failure == null) { QueryState state = queryInfo.getState(); if ((!state.isDone()) || (state == QueryState.FINISHED)) { return null; } log.warn("Query %s in state %s has no failure info", queryInfo.getQueryId(), state); failure = toFailure(new RuntimeException(format("Query is %s (reason unknown)", state))).toFailureInfo(); } ErrorCode errorCode; if (queryInfo.getErrorCode() != null) { errorCode = queryInfo.getErrorCode(); } else { errorCode = GENERIC_INTERNAL_ERROR.toErrorCode(); log.warn("Failed query %s has no error code", queryInfo.getQueryId()); } return new QueryError( <START> failure.getMessage() == null ? "Internal error" : failure.getMessage(), <END> null, errorCode.getCode(), errorCode.getName(), errorCode.getType().toString(), failure.getErrorLocation(), failure); }</code><technical_language>firstNonNull(failure.getMessage(), "Internal error")</technical_language>

Target:
private static QueryError toQueryError(QueryInfo queryInfo) { FailureInfo failure = queryInfo.getFailureInfo(); if (failure == null) { QueryState state = queryInfo.getState(); if ((!state.isDone()) || (state == QueryState.FINISHED)) { return null; } log.warn("Query %s in state %s has no failure info", queryInfo.getQueryId(), state); failure = toFailure(new RuntimeException(format("Query is %s (reason unknown)", state))).toFailureInfo(); } ErrorCode errorCode; if (queryInfo.getErrorCode() != null) { errorCode = queryInfo.getErrorCode(); } else { errorCode = GENERIC_INTERNAL_ERROR.toErrorCode(); log.warn("Failed query %s has no error code", queryInfo.getQueryId()); } return new QueryError( firstNonNull(failure.getMessage(), "Internal error"), null, errorCode.getCode(), errorCode.getName(), errorCode.getType().toString(), failure.getErrorLocation(), failure); }
Source:
<code>private <P, R> void handle(final RetryContextImpl<P, R> retryContext) { final RetryStrategy retryStrategy = getRetryOperation(retryContext).apply(retryContext); if (retryStrategy.getStrategy() == RetryStrategy.Strategy.RESUME) { retryContext.getResult().completeExceptionally(retryStrategy.getError()); } else if (retryStrategy.getStrategy() == RetryStrategy.Strategy.STOP) { final CompletableFuture<R> result = retryContext.getResult(); result.completeExceptionally(retryStrategy.getError()); try { retryContext.getService().close(); } catch (final Exception e) { logger.error("Error occurred while closing service in retry strategy.", e); } } else { final Function<P, CompletionStage<R>> function = retryContext.getFunction(); if (retryStrategy.getStrategy() == RetryStrategy.Strategy.RETRY_IMMEDIATELY) { final Object parameter = retryStrategy.getParameter(); final CompletionStage<R> completionStage = forceApply(function, parameter); handleResultAndEnqueueErrorHandlingAgain(completionStage, parameter, retryContext); } else if (retryStrategy.getStrategy() == RetryStrategy.Strategy.RETRY_SCHEDULED) { final Duration duration = retryStrategy.getDuration(); final Object parameter = retryStrategy.getParameter(); retryContext.schedule(() -> { final CompletionStage<R> completionStage = forceApply(function, parameter); handleResultAndEnqueueErrorHandlingAgain(completionStage, parameter, retryContext); }, duration); } else { throw new IllegalStateException("illegal state for " + retryStrategy); } } <START> } <END></code><technical_language>refactor this</technical_language>

Target:
private <P, R> void handle(final RetryContextImpl<P, R> retryContext) { final RetryStrategy retryStrategy = applyContext(retryContext); final StrategyType strategyType = retryStrategy.getStrategyType(); if (strategyType == StrategyType.RESUME || strategyType == StrategyType.STOP) { retryContext.getResult().completeExceptionally(retryStrategy.getError()); if (strategyType == StrategyType.STOP) { closeService(retryContext); } } else { final Function<P, CompletionStage<R>> function = retryContext.getFunction(); final Object parameter = retryStrategy.getParameter(); if (strategyType == StrategyType.RETRY_IMMEDIATELY) { retry(retryContext, function, parameter); } else if (strategyType == StrategyType.RETRY_SCHEDULED) { final Duration duration = retryStrategy.getDuration(); retryContext.schedule(() -> retry(retryContext, function, parameter), duration); } else { throw new IllegalStateException("illegal state for " + retryStrategy); } } }
Source:
<code>public AsyncCleanerService(Elide elide, Integer maxRunTimeMinutes, Integer queryCleanupDays, AsyncQueryDAO asyncQueryDao) { <START> int queryRunTimeThresholdMinutes = maxRunTimeMinutes * 2; <END> ScheduledExecutorService cleaner = AsyncCleanerService.getInstance().getExecutorService(); AsyncQueryCleanerThread cleanUpTask = new AsyncQueryCleanerThread(queryRunTimeThresholdMinutes, elide, queryCleanupDays, asyncQueryDao); Random random = new Random(); int initialDelayMinutes = random.ints(0, MAX_CLEANUP_INTIAL_DELAY_MINUTES).limit(1).findFirst().getAsInt(); log.debug("Initial Delay for cleaner service is {}", initialDelayMinutes); cleaner.scheduleWithFixedDelay(cleanUpTask, initialDelayMinutes, Math.max(DEFAULT_CLEANUP_DELAY_MINUTES, queryRunTimeThresholdMinutes), TimeUnit.MINUTES); }</code><technical_language>Spacing is in this function</technical_language>

Target:
private AsyncCleanerService(Elide elide, Integer maxRunTimeMinutes, Integer queryCleanupDays, AsyncQueryDAO asyncQueryDao) { int queryRunTimeThresholdMinutes = maxRunTimeMinutes * 2; ScheduledExecutorService cleaner = Executors.newSingleThreadScheduledExecutor(); AsyncQueryCleanerThread cleanUpTask = new AsyncQueryCleanerThread(queryRunTimeThresholdMinutes, elide, queryCleanupDays, asyncQueryDao); Random random = new Random(); int initialDelayMinutes = random.ints(0, maxCleanupInitialDelayMinutes).limit(1).findFirst().getAsInt(); log.debug("Initial Delay for cleaner service is {}", initialDelayMinutes); cleaner.scheduleWithFixedDelay(cleanUpTask, initialDelayMinutes, Math.max(defaultCleanupDelayMinutes, queryRunTimeThresholdMinutes), TimeUnit.MINUTES); }
Source:
<code>public void setInitializationData(IConfigurationElement config, String propertyName, Object data) { if (data instanceof <START> Hashtable) { <END> Hashtable<?, ?> table = (Hashtable<?, ?>) data; color = (String) table.get("color"); } }</code><technical_language>Better: Map</technical_language>

Target:
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) { if (data instanceof Hashtable<?, ?>) { Hashtable<?, ?> map = (Hashtable<?, ?>) data; color = (String) map.get("color"); } }
Source:
<code>public void stitch() { for (Todo todo : getTodoList()) { Object entityInstance = todo.getEntityInstance(); String relationshipName = todo.getRelationshipName(); Object foreignKey = todo.getForeignKey(); <START> Class<?> relationshipType = getEntityDictionary().getType(entityInstance, relationshipName); <END> Object relationshipValue = getObjectLookups().get(relationshipType).get(foreignKey); getEntityDictionary().setValue(entityInstance, relationshipName, relationshipValue); } }</code><technical_language>This getParameterizedType</technical_language>

Target:
public void stitch() { for (Todo todo : getTodoList()) { Object entityInstance = todo.getEntityInstance(); String relationshipName = todo.getRelationshipName(); Object foreignKey = todo.getForeignKey(); Class<?> relationshipType = getEntityDictionary().getParameterizedType(entityInstance, relationshipName); Object relationshipValue = getObjectLookups().get(relationshipType).get(foreignKey); getEntityDictionary().setValue(entityInstance, relationshipName, relationshipValue); } }
Source:
<code>protected void navigateToAbsoluteUrl(String url, String domain, String login, String password) { if (isIE() && !isLocalFile(url)) { url = makeUniqueUrlToAvoidIECaching(url, System.nanoTime()); if (!domain.isEmpty()) domain += "\\"; } else { if (!domain.isEmpty()) domain += "%5C"; if (!login.isEmpty()) login += ":"; if (!password.isEmpty()) password += "@"; int idx1 = url.indexOf(" url = url.substring(0, idx1 - 2) + " + domain + login + password + url.substring(idx1); } SelenideLog log = SelenideLogger.beginStep("open", url); try { WebDriver webdriver = getAndCheckWebDriver(); webdriver.navigate().to(url); <START> if (isIE()) Selenide.switchTo().alert().authenticateUsing(new UserAndPassword(domain + login, password)); <END> collectJavascriptErrors((JavascriptExecutor) webdriver); SelenideLogger.commitStep(log, PASS); } catch (WebDriverException e) { SelenideLogger.commitStep(log, e); e.addInfo("selenide.url", url); e.addInfo("selenide.baseUrl", baseUrl); throw e; } catch (RuntimeException e) { SelenideLogger.commitStep(log, e); throw e; } catch (Error e) { SelenideLogger.commitStep(log, e); throw e; } }</code><technical_language>Hey Guys, in case if BasicAuth is required exception thrown able switch alert. handle this case additional try-catch block (without exception throwing) introduce new Configuration property</technical_language>

Target:
protected void navigateToAbsoluteUrl(String url, String domain, String login, String password) { if (isIE() && !isLocalFile(url)) { url = makeUniqueUrlToAvoidIECaching(url, System.nanoTime()); if (!domain.isEmpty()) domain += "\\"; } else { if (!domain.isEmpty()) domain += "%5C"; if (!login.isEmpty()) login += ":"; if (!password.isEmpty()) password += "@"; int idx1 = url.indexOf("://") + 3; url = (idx1 < 3 ? "" : (url.substring(0, idx1 - 3) + "://")) + domain + login + password + (idx1 < 3 ? url : url.substring(idx1)); } SelenideLog log = SelenideLogger.beginStep("open", url); try { WebDriver webdriver = getAndCheckWebDriver(); webdriver.navigate().to(url); if (isIE()) Selenide.switchTo().alert().authenticateUsing(new UserAndPassword(domain + login, password)); collectJavascriptErrors((JavascriptExecutor) webdriver); SelenideLogger.commitStep(log, PASS); } catch (WebDriverException e) { SelenideLogger.commitStep(log, e); e.addInfo("selenide.url", url); e.addInfo("selenide.baseUrl", baseUrl); throw e; } catch (RuntimeException e) { SelenideLogger.commitStep(log, e); throw e; } catch (Error e) { SelenideLogger.commitStep(log, e); throw e; } }
Source:
<code>public void setUp(TestUtils setup, TestReference testReference) throws Exception { setup.loginAsSuperAdmin(); setup.deletePage(testReference); setup.createPageWithAttachment(testReference, "", "Test Attachments", "deletedFile1.txt", <START> new ByteArrayInputStream("attachment content1".getBytes()), TestUtils.SUPER_ADMIN_CREDENTIALS); <END> ViewPage testPage = setup.gotoPage(testReference); AttachmentsPane attachmentsPane = testPage.openAttachmentsDocExtraPane(); attachmentsPane.deleteAttachmentByFileByName("deletedFile1.txt"); }</code><technical_language>do need superadmin credentials if logged in superadmin</technical_language>

Target:
void setUp(TestUtils setup, TestReference testReference) throws Exception { setup.loginAsSuperAdmin(); setup.deletePage(testReference); setup.createPageWithAttachment(testReference, "", "Test Attachments", "deletedFile1.txt", new ByteArrayInputStream("attachment content1".getBytes())); ViewPage testPage = setup.gotoPage(testReference); AttachmentsPane attachmentsPane = testPage.openAttachmentsDocExtraPane(); attachmentsPane.deleteAttachmentByFileByName("deletedFile1.txt"); }
Source:
<code>public void testEmptySimpleText_ACK() throws Exception { Path file1 = new Path(source.toString() + "/file_empty.txt"); createTextFile(file1, 0); Path file2 = new Path(source.toString() + "/file.txt"); createTextFile(file2, 5); try (AutoCloseableHdfsSpout closeableSpout = makeSpout(Configs.TEXT, TextFileReader.defaultFields)) { HdfsSpout spout = closeableSpout.spout; <START> spout.setCommitFrequencyCount(1); <END> spout.setCommitFrequencySec(1); Map<String, Object> conf = getCommonConfigs(); conf.put(Config.TOPOLOGY_ACKER_EXECUTORS, "1"); openSpout(spout, 0, conf); runSpout(spout, "r6"); Path arc1 = new Path(archive.toString() + "/file_empty.txt"); checkCollectorOutput_txt((MockCollector) spout.getCollector(), arc1); runSpout(spout, "r5", "a0", "a1", "a2", "a3", "a4"); Path arc2 = new Path(archive.toString() + "/file.txt"); checkCollectorOutput_txt((MockCollector) spout.getCollector(), arc1, arc2); } }</code><technical_language>Is reason set commit frequency count commit frequency sec</technical_language>

Target:
public void testEmptySimpleText_ACK() throws Exception { Path file1 = new Path(source.toString() + "/file_empty.txt"); createTextFile(file1, 0); Path file2 = new Path(source.toString() + "/file.txt"); createTextFile(file2, 5); try (AutoCloseableHdfsSpout closeableSpout = makeSpout(Configs.TEXT, TextFileReader.defaultFields)) { HdfsSpout spout = closeableSpout.spout; spout.setCommitFrequencyCount(1); Map<String, Object> conf = getCommonConfigs(); conf.put(Config.TOPOLOGY_ACKER_EXECUTORS, "1"); openSpout(spout, 0, conf); runSpout(spout, "r1"); Path arc1 = new Path(archive.toString() + "/file_empty.txt"); checkCollectorOutput_txt((MockCollector) spout.getCollector(), arc1); runSpout(spout, "r5", "a0", "a1", "a2", "a3", "a4"); Path arc2 = new Path(archive.toString() + "/file.txt"); checkCollectorOutput_txt((MockCollector) spout.getCollector(), arc1, arc2); } }
Source:
<code>private void raiseAlert( HttpMessage msg, String name, int id, String description, String param, int risk, String evidence, boolean multipleCsp, boolean hasReportUri, String policy) { String alertName = StringUtils.isEmpty(name) ? getName() : getName() + ": " + name; String otherInfo = ""; <START> if (multipleCsp) { otherInfo = Constant.messages.getString(MESSAGE_PREFIX + "otherinfo", policy); } <END> if (hasReportUri) { otherInfo = Constant.messages.getString(MESSAGE_PREFIX + "otherinfo.nomerge"); } newAlert() .setName(alertName) .setRisk(risk) .setConfidence(Alert.CONFIDENCE_MEDIUM) .setDescription(description) .setParam(param) .setOtherInfo(otherInfo) .setSolution(getSolution()) .setReference(getReference()) .setEvidence(evidence) .setCweId(16) .setWascId(15) .raise(); }</code><technical_language>This done else if of following, clearer hasReportUri takes precedence way</technical_language>

Target:
private void raiseAlert( HttpMessage msg, String name, int id, String description, String param, int risk, String evidence, boolean multipleCsp, boolean hasReportUri, String policy) { String alertName = StringUtils.isEmpty(name) ? getName() : getName() + ": " + name; String otherInfo = ""; if (hasReportUri) { otherInfo = Constant.messages.getString(MESSAGE_PREFIX + "otherinfo.nomerge"); } else if (multipleCsp) { otherInfo = Constant.messages.getString(MESSAGE_PREFIX + "otherinfo", policy); } newAlert() .setName(alertName) .setRisk(risk) .setConfidence(Alert.CONFIDENCE_MEDIUM) .setDescription(description) .setParam(param) .setOtherInfo(otherInfo) .setSolution(getSolution()) .setReference(getReference()) .setEvidence(evidence) .setCweId(16) .setWascId(15) .raise(); }
Source:
<code>private static Map<String, String> fromJson(String json) { <START> Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create(); <END> try { return gson.fromJson(decode(json, UTF_8.name()), JSON_MAP_TYPE); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } }</code><technical_language>is pretty printing needed</technical_language>

Target:
private static Map<String, String> fromJson(String json) { Gson gson = new GsonBuilder().create(); try { return gson.fromJson(decode(json, UTF_8.name()), JSON_MAP_TYPE); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } }
Source:
<code>public RealmResults<DynamicRealmObject> linkingObjects(String srcClassName, String srcFieldName) { final DynamicRealm realm = (DynamicRealm) proxyState.getRealm$realm(); realm.checkIfValid(); proxyState.getRow$realm().checkIfAttached(); final RealmSchema schema = realm.getSchema(); final RealmObjectSchema realmObjectSchema = schema.get(srcClassName); if (realmObjectSchema == null) { throw new IllegalArgumentException("Class not found: " + srcClassName); } if (srcFieldName == null) { throw new IllegalArgumentException("Non-null 'srcFieldName' required."); } if (srcFieldName.contains(".")) { throw new IllegalArgumentException(MSG_LINK_QUERY_NOT_SUPPORTED); } final RealmFieldType fieldType = realmObjectSchema.getFieldType(srcFieldName); if (fieldType != RealmFieldType.OBJECT && fieldType != RealmFieldType.LIST) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Unexpected field type: %1$s. Field type should be either %2$s.%3$s or %2$s.%4$s.", fieldType.name(), RealmFieldType.class.getSimpleName(), RealmFieldType.OBJECT.name(), RealmFieldType.LIST.name())); } <START> return RealmResults.createDynamicBacklinkResults(realm, proxyState.getRow$realm(), realmObjectSchema.getTable(), srcFieldName); <END> }</code><technical_language>mention it, separating call based a cast (UncheckedRow) (CheckedRow) **is** super brittle</technical_language>

Target:
public RealmResults<DynamicRealmObject> linkingObjects(String srcClassName, String srcFieldName) { final DynamicRealm realm = (DynamicRealm) proxyState.getRealm$realm(); realm.checkIfValid(); proxyState.getRow$realm().checkIfAttached(); final RealmSchema schema = realm.getSchema(); final RealmObjectSchema realmObjectSchema = schema.get(srcClassName); if (realmObjectSchema == null) { throw new IllegalArgumentException("Class not found: " + srcClassName); } if (srcFieldName == null) { throw new IllegalArgumentException("Non-null 'srcFieldName' required."); } if (srcFieldName.contains(".")) { throw new IllegalArgumentException(MSG_LINK_QUERY_NOT_SUPPORTED); } final RealmFieldType fieldType = realmObjectSchema.getFieldType(srcFieldName); if (fieldType != RealmFieldType.OBJECT && fieldType != RealmFieldType.LIST) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Unexpected field type: %1$s. Field type should be either %2$s.%3$s or %2$s.%4$s.", fieldType.name(), RealmFieldType.class.getSimpleName(), RealmFieldType.OBJECT.name(), RealmFieldType.LIST.name())); } return RealmResults.createDynamicBacklinkResults(realm, (CheckedRow) proxyState.getRow$realm(), realmObjectSchema.getTable(), srcFieldName); }
Source:
<code>public EventHandler<ActiveContext> getFirstContextActiveHandlerForWorker(final boolean addedEval) { return new EventHandler<ActiveContext>() { @Override public void onNext(final ActiveContext activeContext) { LOG.log(Level.INFO, "Worker-side DataLoad context - {0}", activeContext); rootContexts.put(activeContext.getId(), activeContext); final int workerIndex = workerContextIndexCounter.getAndIncrement(); <START> final String contextId = WORKER_CONTEXT_ID + "-" + workerIndex; <END> final Configuration contextConf = Configurations.merge( ContextConfiguration.CONF .set(ContextConfiguration.IDENTIFIER, contextId) .build(), psDriver.getWorkerContextConfiguration(), workerEMWrapper.getConf().getContextConfiguration(), aggregationManager.getContextConfiguration()); final Configuration serviceConf = Configurations.merge( psDriver.getWorkerServiceConfiguration(contextId), getEMServiceConfForWorker(contextId, addedEval), aggregationManager.getServiceConfigurationWithoutNameResolver(), MetricsCollectionService.getServiceConfiguration()); final Configuration traceConf = traceParameters.getConfiguration(); final Configuration otherParamConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(NumWorkerThreads.class, Integer.toString(numWorkerThreads)) .build(); activeContext.submitContextAndService(contextConf, Configurations.merge(serviceConf, traceConf, paramConf, otherParamConf, emWorkerClientConf)); } }; }</code><technical_language>useful a method create contextId workerIndex, for case of naming changes</technical_language>

Target:
public EventHandler<ActiveContext> getFirstContextActiveHandlerForWorker(final boolean addedEval) { return new EventHandler<ActiveContext>() { @Override public void onNext(final ActiveContext activeContext) { LOG.log(Level.INFO, "Worker-side DataLoad context - {0}", activeContext); contextIdToRootContexts.put(activeContext.getId(), activeContext); final int workerIndex = workerContextIndexCounter.getAndIncrement(); final String contextId = getWorkerContextId(workerIndex); final Configuration contextConf = Configurations.merge( ContextConfiguration.CONF .set(ContextConfiguration.IDENTIFIER, contextId) .build(), psDriver.getWorkerContextConfiguration(), workerEMWrapper.getConf().getContextConfiguration(), aggregationManager.getContextConfiguration()); final Configuration serviceConf = Configurations.merge( psDriver.getWorkerServiceConfiguration(contextId), getEMServiceConfForWorker(contextId, addedEval), aggregationManager.getServiceConfigurationWithoutNameResolver(), MetricsCollectionService.getServiceConfiguration()); final Configuration traceConf = traceParameters.getConfiguration(); final Configuration otherParamConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(NumWorkerThreads.class, Integer.toString(numWorkerThreads)) .build(); activeContext.submitContextAndService(contextConf, Configurations.merge(serviceConf, traceConf, paramConf, otherParamConf, workerConf, emWorkerClientConf)); } }; }
Source:
<code>public void moreMdevs() { vm.setCustomProperties(String.format("key=value;mdev_type=%s;key2=value", MDEV_NAME_1, <START> MDEV_NAME_3)); <END> List<VDS> result = filter(); assertEquals(2, result.size()); assertThat(result.contains(vdsWithMdevs)); assertThat(result.contains(vdsWithMixedMdevs)); }</code><technical_language>This parameter is in format string</technical_language>

Target:
public void moreMdevs() { vm.setCustomProperties(String.format("key=value;mdev_type=%s,%s;key2=value", MDEV_NAME_1, MDEV_NAME_3)); List<VDS> result = filter(); assertEquals(2, result.size()); assertThat(result.contains(vdsWithMdevs)); assertThat(result.contains(vdsWithMixedMdevs)); }
Source:
<code><START> public Page<ModuleMetadata> findAllByModuleId(String moduleId) { <END> try { return new PageImpl<ModuleMetadata>(findAll(moduleId)); } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }</code><technical_language>I understand difference this public List<ModuleMetadata> findAll(String moduleIdToUse) (apart (cheated) pagination stuff) This name kept, ambiguous findAll dropped IMHO</technical_language>

Target:
public Page<ModuleMetadata> findAllByModuleId(String moduleId) { try { List<ModuleMetadata> results = new ArrayList<ModuleMetadata>(); for (String containerId : getAvailableContainerIds()) { ModuleMetadata metadata = findOne(containerId, moduleId); if (metadata != null) { results.add(metadata); } } return new PageImpl<ModuleMetadata>(results); } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }
Source:
<code>protected void SyncSearch() { super.SyncSearch(); Frontend.RunQuery(VdcQueryType.GetAllVmsAndVmPools, new VdcQueryParametersBase(), new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object returnValue) { UserPortalListModel userPortalListModel = (UserPortalListModel) model; ArrayList<VM> vms = new ArrayList<VM>(); ArrayList<vm_pools> pools = new ArrayList<vm_pools>(); VdcQueryReturnValue retValue = (VdcQueryReturnValue) returnValue; if (retValue != null && retValue.getSucceeded()) { List<Object> list = (ArrayList<Object>) retValue.getReturnValue(); <START> for (Object object : list) { <END> if (object instanceof VM) { vms.add((VM) object); } else if (object instanceof vm_pools) { pools.add((vm_pools) object); } } } userPortalListModel.setvms(vms); userPortalListModel.setpools(pools); userPortalListModel.OnVmAndPoolLoad(); } })); }</code><technical_language>list null..which NPE (GetAllVmsAndVmPoolsQuery line 40)</technical_language>

Target:
protected void SyncSearch() { super.SyncSearch(); Frontend.RunQuery(VdcQueryType.GetAllVmsAndVmPools, new VdcQueryParametersBase(), new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object returnValue) { UserPortalListModel userPortalListModel = (UserPortalListModel) model; ArrayList<VM> vms = new ArrayList<VM>(); ArrayList<vm_pools> pools = new ArrayList<vm_pools>(); VdcQueryReturnValue retValue = (VdcQueryReturnValue) returnValue; if (retValue != null && retValue.getSucceeded()) { List<Object> list = (ArrayList<Object>) retValue.getReturnValue(); if (list != null) { for (Object object : list) { if (object instanceof VM) { vms.add((VM) object); } else if (object instanceof vm_pools) { pools.add((vm_pools) object); } } } } userPortalListModel.setvms(vms); userPortalListModel.setpools(pools); userPortalListModel.OnVmAndPoolLoad(); } })); }
Source:
<code>public static WaypointType convertWaypointSym2Type(final String sym) { <START> if ("parking area".equals(sym)) <END> return WaypointType.PKG; else if ("stages of a multicache".equals(sym)) return WaypointType.STAGE; else if ("question to answer".equals(sym)) return WaypointType.PUZZLE; else if ("trailhead".equals(sym)) return WaypointType.TRAILHEAD; else if ("final location".equals(sym)) return WaypointType.FLAG; else return WaypointType.WAYPOINT; }</code><technical_language>Please "equalsIgnoreCase" for String comparisons. more fault tolerant, if capitalization is in future if other cache websites implement this feature. Please braces if/else statements. added automatically code formatting rules for this part of project checked in git. changed settings locally? If yes, please revert that</technical_language>

Target:
public static WaypointType convertWaypointSym2Type(final String sym) { if ("parking area".equalsIgnoreCase(sym)) { return WaypointType.PKG; } else if ("stages of a multicache".equalsIgnoreCase(sym)) { return WaypointType.STAGE; } else if ("question to answer".equalsIgnoreCase(sym)) { return WaypointType.PUZZLE; } else if ("trailhead".equalsIgnoreCase(sym)) { return WaypointType.TRAILHEAD; } else if ("final location".equalsIgnoreCase(sym)) { return WaypointType.FLAG; } else { return WaypointType.WAYPOINT; } }
Source:
<code>private void initializeViews() { mProjectLayout = (LinearLayout) findViewById(R.id.project_list_layout); mNewProjectButton = (Button) findViewById(R.id.new_project_button); mAddProject = (ImageView) findViewById(R.id.new_project_fab); mProjectList = (ListView) findViewById(R.id.project_list); mAddProject.setOnClickListener(btnClick); mNewProjectButton.setOnClickListener(btnClick); hideProjectsIfEmpty(mNumProjects); if (mNumProjects > 0) { <START> calculateProjectsProgress(); <END> Project recent = initializeRecentProject(); populateProjectList(recent); } }</code><technical_language>I want put this here; work start this activity need change happen time. progress is "wrong" filesystem database out of sync, correct? add a resultcode resync return changed, change do calculate project progress</technical_language>

Target:
private void initializeViews() { mProjectLayout = (LinearLayout) findViewById(R.id.project_list_layout); mNewProjectButton = (Button) findViewById(R.id.new_project_button); mAddProject = (ImageView) findViewById(R.id.new_project_fab); mProjectList = (ListView) findViewById(R.id.project_list); mAddProject.setOnClickListener(btnClick); mNewProjectButton.setOnClickListener(btnClick); hideProjectsIfEmpty(mNumProjects); if (mNumProjects > 0) { Project recent = initializeRecentProject(); populateProjectList(recent); } }
Source:
<code><START> public void testGenerateFilesinPuppetMaster() throws InstallatorException, NodeExecutionException, KeyManagementException, NoSuchAlgorithmException, IOException { <END> when(statusLine.getStatusCode()).thenReturn(200); when(httpsClient.doHttpsPost(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(200); when(httpsClient.doHttpsGet(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(200); puppetInstallator.generateFilesinPuppetMaster(host, "test", productRelease, "install", "token"); }</code><technical_language>gt 120</technical_language>

Target:
public void testGenerateFilesinPuppetMaster() throws InstallatorException, NodeExecutionException, KeyManagementException, NoSuchAlgorithmException, IOException { when(statusLine.getStatusCode()).thenReturn(200); when( httpsClient.doHttps(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), (Map<String, String>) Mockito.anyObject())).thenReturn(200); puppetInstallator.generateFilesinPuppetMaster(host, "test", productRelease, "install", "token"); }
Source:
<code>private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException { int size = 0; List<Ref> refs = repo.getRefDatabase().getRefs(); if (writeLogs) { for (Ref r : refs) { ReflogReader rlr = repo.getReflogReader(r.getName()); <START> size = Math.max( <END> rlr == null ? 0 : rlr.getReverseEntries().size(), size); } } w.setMinUpdateIndex(1).setMaxUpdateIndex(size + 1).begin(); try (RevWalk rw = new RevWalk(repo)) { List<Ref> toWrite = new ArrayList<>(refs.size()); for (Ref r : refs) { toWrite.add(refForWrite(rw, r)); } w.sortAndWriteRefs(toWrite); } if (writeLogs) { for (Ref r : refs) { long idx = size; ReflogReader reader = repo.getReflogReader(r.getName()); if (reader == null) { continue; } for (ReflogEntry e : reader.getReverseEntries()) { w.writeLog(r.getName(), idx, e.getWho(), e.getOldId(), e.getNewId(), e.getComment()); idx--; } } } }</code><technical_language>maybe, for quicker reading: if (rlr != null) { size = max(rlr.getReverseEntries().size(), size); }</technical_language>

Target:
private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException { int size = 0; List<Ref> refs = repo.getRefDatabase().getRefs(); if (writeLogs) { for (Ref r : refs) { ReflogReader rlr = repo.getReflogReader(r.getName()); if (rlr != null) { size = Math.max(rlr.getReverseEntries().size(), size); } } } w.setMinUpdateIndex(1).setMaxUpdateIndex(size + 1).begin(); try (RevWalk rw = new RevWalk(repo)) { List<Ref> toWrite = new ArrayList<>(refs.size()); for (Ref r : refs) { toWrite.add(refForWrite(rw, r)); } w.sortAndWriteRefs(toWrite); } if (writeLogs) { for (Ref r : refs) { long idx = size; ReflogReader reader = repo.getReflogReader(r.getName()); if (reader == null) { continue; } for (ReflogEntry e : reader.getReverseEntries()) { w.writeLog(r.getName(), idx, e.getWho(), e.getOldId(), e.getNewId(), e.getComment()); idx--; } } } }
Source:
<code>public synchronized void writeIssues(Iterator<Issue> issues, File file) { while (issues.hasNext()) { Issue issue = issues.next(); IssueEntry entry = IssueEntry.from(issue, file); if (expectedIssues.expects(entry)) { <START> continue; <END> } output.accept(entry.createExcerpt()); } }</code><technical_language>@inverno I this style: I a continue here</technical_language>

Target:
public synchronized void writeIssues(Iterator<Issue> issues, File file) { while (issues.hasNext()) { Issue issue = issues.next(); IssueEntry entry = IssueEntry.from(issue, file); if (!expectedIssues.expects(entry)) { output.accept(entry.createExcerpt()); } } }
Source:
<code>public CoapClient useExecutor() { boolean failed = true; ExecutorService executor = ExecutorsUtil.newFixedThreadPool(1, new NamedThreadFactory("CoapClient(main)#")); <START> ScheduledThreadPoolExecutor secondaryExecutor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("CoapClient(secondary)#")); <END> synchronized (this) { if (this.executor == null && this.secondaryExecutor == null) { this.executor = executor; this.secondaryExecutor = secondaryExecutor; this.detachExecutor = false; failed = false; } } if (failed) { executor.shutdownNow(); throw new IllegalStateException("Executor already set or used!"); } executor.execute(new Runnable() { public void run() { LOGGER.info("using a SingleThreadExecutor for the CoapClient"); }; }); return this; }</code><technical_language>if (failed) { executor.shutdownNow(); throw new IllegalStateException("Executor set used!"); } extended for secondaryExecutor</technical_language>

Target:
public CoapClient useExecutor() { boolean failed = true; ExecutorService executor = ExecutorsUtil.newFixedThreadPool(1, new NamedThreadFactory("CoapClient(main)#")); ScheduledThreadPoolExecutor secondaryExecutor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("CoapClient(secondary)#")); synchronized (this) { if (this.executor == null && this.secondaryExecutor == null) { this.executor = executor; this.secondaryExecutor = secondaryExecutor; this.detachExecutor = false; failed = false; } } if (failed) { executor.shutdownNow(); secondaryExecutor.shutdown(); throw new IllegalStateException("Executor already set or used!"); } executor.execute(new Runnable() { public void run() { LOGGER.info("using a SingleThreadExecutor for the CoapClient"); }; }); return this; }
Source:
<code>public void notifyLeaderAddress(LeaderInformation leaderInformation) { final UUID newLeaderSessionID = leaderInformation.getLeaderSessionID(); final String newLeaderAddress = leaderInformation.getLeaderAddress(); synchronized (lock) { if (running) { if (!Objects.equals(newLeaderAddress, lastLeaderAddress) || !Objects.equals(newLeaderSessionID, lastLeaderSessionID)) { if (LOG.isDebugEnabled()) { if (newLeaderAddress == null && newLeaderSessionID == null) { LOG.debug("Leader information was lost: The listener will be notified accordingly."); } else { LOG.debug( "New leader information: Leader={}, session ID={}.", newLeaderAddress, newLeaderSessionID); } } lastLeaderAddress = newLeaderAddress; lastLeaderSessionID = newLeaderSessionID; <START> leaderListener.notifyLeaderAddress(newLeaderAddress, newLeaderSessionID); <END> } } else { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring notification since the has already been closed.", leaderRetrievalDriver); } } } }</code><technical_language>running this call of lock safer in order avoid deadlocks</technical_language>

Target:
public void notifyLeaderAddress(LeaderInformation leaderInformation) { final UUID newLeaderSessionID = leaderInformation.getLeaderSessionID(); final String newLeaderAddress = leaderInformation.getLeaderAddress(); synchronized (lock) { if (running) { if (!Objects.equals(newLeaderAddress, lastLeaderAddress) || !Objects.equals(newLeaderSessionID, lastLeaderSessionID)) { if (LOG.isDebugEnabled()) { if (newLeaderAddress == null && newLeaderSessionID == null) { LOG.debug("Leader information was lost: The listener will be notified accordingly."); } else { LOG.debug( "New leader information: Leader={}, session ID={}.", newLeaderAddress, newLeaderSessionID); } } lastLeaderAddress = newLeaderAddress; lastLeaderSessionID = newLeaderSessionID; } } else { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring notification since the has already been closed.", leaderRetrievalDriver); } } } leaderListener.notifyLeaderAddress(newLeaderAddress, newLeaderSessionID); }
Source:
<code>public void addPartitions(String databaseName, String tableName, List<Partition> partitions) { try { List<List<Partition>> batchedPartitions = Lists.partition(partitions, BATCH_CREATE_PARTITION_MAX_PAGE_SIZE); List<Future<BatchCreatePartitionResult>> futures = new ArrayList<>(); for (List<Partition> partitionBatch : batchedPartitions) { List<PartitionInput> partitionInputs = partitionBatch.stream().map(GlueInputConverter::convertPartition).collect(toList()); futures.add(glueClient.batchCreatePartitionAsync(new BatchCreatePartitionRequest() .withDatabaseName(databaseName) .withTableName(tableName) .withPartitionInputList(partitionInputs))); } <START> <END> for (Future<BatchCreatePartitionResult> future : futures) { BatchCreatePartitionResult result = future.get(); propagatePartitionErrorToPrestoException(databaseName, tableName, result.getErrors()); } } catch (AmazonServiceException | InterruptedException | ExecutionException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }</code><technical_language>a timeout Future.get() call, in case client a bug future completes</technical_language>

Target:
public void addPartitions(String databaseName, String tableName, List<Partition> partitions) { try { List<List<Partition>> batchedPartitions = Lists.partition(partitions, BATCH_CREATE_PARTITION_MAX_PAGE_SIZE); List<Future<BatchCreatePartitionResult>> futures = new ArrayList<>(); for (List<Partition> partitionBatch : batchedPartitions) { List<PartitionInput> partitionInputs = partitionBatch.stream().map(GlueInputConverter::convertPartition).collect(toList()); futures.add(glueClient.batchCreatePartitionAsync(new BatchCreatePartitionRequest() .withDatabaseName(databaseName) .withTableName(tableName) .withPartitionInputList(partitionInputs))); } for (Future<BatchCreatePartitionResult> future : futures) { BatchCreatePartitionResult result = future.get(); propagatePartitionErrorToPrestoException(databaseName, tableName, result.getErrors()); } } catch (AmazonServiceException | InterruptedException | ExecutionException e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } throw new PrestoException(HIVE_METASTORE_ERROR, e); } }
Source:
<code>public Response doImport(Action action) { <START> validateParameters(action, "cluster.id|name", "storageDomain.id|name"); <END> Guid destStorageDomainId = getDestStorageDomainId(action); ImportVmTemplateParameters params = new ImportVmTemplateParameters(parent.getDataCenterId(destStorageDomainId), parent.getStorageDomainId(), destStorageDomainId, getClusterId(action), getEntity()); params.setImageToDestinationDomainMap(getDiskToDestinationMap(action)); params.setForceOverride(action.isSetExclusive() ? action.isExclusive() : false); if (action.isSetClone()){ params.setImportAsNewEntity(action.isClone()); if(action.isSetTemplate() && action.getTemplate().isSetName()) { params.getVmTemplate().setName(action.getTemplate().getName()); } } return doAction(VdcActionType.ImportVmTemplate, params, action); }</code><technical_language>making storage_domain mandatory? - this break api, import() default logic SD specified</technical_language>

Target:
public Response doImport(Action action) { validateParameters(action, "cluster.id|name"); Guid destStorageDomainId = getDestStorageDomainId(action); ImportVmTemplateParameters params = new ImportVmTemplateParameters(parent.getDataCenterId(destStorageDomainId), parent.getStorageDomainId(), destStorageDomainId, getClusterId(action), getEntity()); params.setImageToDestinationDomainMap(getDiskToDestinationMap(action)); params.setForceOverride(action.isSetExclusive() ? action.isExclusive() : false); if (action.isSetClone()){ params.setImportAsNewEntity(action.isClone()); if(action.isSetTemplate() && action.getTemplate().isSetName()) { params.getVmTemplate().setName(action.getTemplate().getName()); } } return doAction(VdcActionType.ImportVmTemplate, params, action); }
Source:
<code>public void testRDotTxtEntryCompareTo() { ImmutableList<RDotTxtEntry> entries = ImmutableList.of( new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBar", null), new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBarLayout", "0x7f060008"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_background", "2"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_contentInsetEnd", "0"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBarLayout_android", "0"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_backgroundStack", "1") ); ImmutableList<RDotTxtEntry> sortedEntries = ImmutableList.copyOf( Ordering.natural().sortedCopy(entries) ); assertEquals( <START> sortedEntries, <END> ImmutableList.of( new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBar", null), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_background", "2"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_backgroundStack", "1"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_contentInsetEnd", "0"), new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBarLayout", "0x7f060008"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBarLayout_android", "0") ) ); }</code><technical_language>Expected argument, actual second</technical_language>

Target:
public void testRDotTxtEntryCompareTo() { ImmutableList<RDotTxtEntry> entries = ImmutableList.of( new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBar", null), new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBarLayout", "0x7f060008"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_background", "2"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_contentInsetEnd", "0"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBarLayout_android", "0"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_backgroundStack", "1") ); ImmutableList<RDotTxtEntry> sortedEntries = ImmutableList.copyOf( Ordering.natural().sortedCopy(entries) ); assertEquals( ImmutableList.of( new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBar", null), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_background", "2"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_backgroundStack", "1"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBar_contentInsetEnd", "0"), new RDotTxtEntry(IdType.INT_ARRAY, RType.STYLEABLE, "ActionBarLayout", "0x7f060008"), new RDotTxtEntry(IdType.INT, RType.STYLEABLE, "ActionBarLayout_android", "0") ), sortedEntries ); }
Source:
<code>protected Map<String, Pair<String, String>> getSharedLocks() { if (getDisk() == null) { return null; } <START> if (getDisk().getVmEntityType() != null) { <END> switch (getDisk().getVmEntityType()) { case VM: return createSharedLocksForVmDisk(); case TEMPLATE: return createSharedLocksForTemplateDisk(); } } log.warnFormat("No shared locks are taken while removing disk of entity: {0}", getDisk().getVmEntityType()); return null; }</code><technical_language>yeah, I this.. prefer add clause (i check in line 356) that: getDisk() == null || getDisk().getVmEntityType() == null ? a matter of style, think.</technical_language>

Target:
protected Map<String, Pair<String, String>> getSharedLocks() { if (getDisk() == null) { return null; } if (getDisk().getVmEntityType() != null) { switch (getDisk().getVmEntityType()) { case VM: return createSharedLocksForVmDisk(); case TEMPLATE: return createSharedLocksForTemplateDisk(); } } return null; }
Source:
<code>public Call<ResponseBody> setProfileImage(@NonNull String username, @NonNull final File file) { final String mimeType = "image/jpeg"; return userService.setProfileImage( username, "attachment;filename=filename." + MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType), <START> RequestBody.create(MediaType.parse("image/jpeg"), file)); <END> }</code><technical_language>mimeType instead of "image/jpeg"</technical_language>

Target:
public Call<ResponseBody> setProfileImage(@NonNull String username, @NonNull final File file) { final String mimeType = "image/jpeg"; return userService.setProfileImage( username, "attachment;filename=filename." + MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType), RequestBody.create(MediaType.parse(mimeType), file)); }
Source:
<code>public final boolean equals(Object obj) { if (super.equals(obj)) { final RangePredicate<?> other = (RangePredicate<?>) obj; return Objects.equals(lower(), other.lower()) && Objects.equals(upper(), other.upper()) <START> && Objects.equals(isIncludeLower(), other.isIncludeLower()) <END> && Objects.equals(isIncludeUpper(), other.isIncludeUpper()); } else { return false; } }</code><technical_language>Method call box primitive values Boolean here</technical_language>

Target:
public final boolean equals(Object obj) { if (super.equals(obj)) { final RangePredicate<?> other = (RangePredicate<?>) obj; return Objects.equals(lower(), other.lower()) && Objects.equals(upper(), other.upper()) && isIncludeLower() == other.isIncludeLower() && isIncludeUpper() == other.isIncludeUpper(); } else { return false; } }
Source:
<code>public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { Set<Node> nodes = nodeManager.getRequiredWorkerNodes(); checkState(!nodes.isEmpty(), "No TPCDS nodes available"); <START> return new ConnectorBucketNodeMap(nodes.size() * splitsPerNode); <END> }</code><technical_language>sure, nodes.size() * splitsPerNode overflow (they integers)</technical_language>

Target:
public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { Set<Node> nodes = nodeManager.getRequiredWorkerNodes(); checkState(!nodes.isEmpty(), "No TPCDS nodes available"); return createBucketNodeMap(toIntExact((long) nodes.size() * splitsPerNode)); }