auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean deleteTasks(String taskId) throws MambuApiException { String urlString = new String(mambuAPIService.createUrl(TASKS + "/" + taskId)); String jsonResponse = mambuAPIService.executeRequest(urlString, Method.DELETE); boolean deletionStatus = false; MambuApiResponseMessage response = new MambuApiResponseMessage(jsonResponse); <START> if (response.getReturnCode() == 0) <END> deletionStatus = true; return deletionStatus; }</code><technical_language>Please add {..}</technical_language>

Target:
public boolean deleteTasks(String taskId) throws MambuApiException { String urlString = new String(mambuAPIService.createUrl(TASKS + "/" + taskId)); String jsonResponse = mambuAPIService.executeRequest(urlString, Method.DELETE); boolean deletionStatus = false; MambuApiResponseMessage response = new MambuApiResponseMessage(jsonResponse); if (response.getReturnCode() == 0) { deletionStatus = true; } return deletionStatus; }
Source:
<code>private void assertAccountMapEquals(Collection<Account> expectedAccounts, Map<String, String> accountMap) throws Exception { Set<Account> expectedAccountSet = new HashSet<>(expectedAccounts); for (String accountJsonString : accountMap.values()) { JSONObject accountJson = new JSONObject(accountJsonString); Account account = Account.fromJson(accountJson); assertTrue("unexpected account in map: " + accountJson.toString(), expectedAccountSet.contains(account)); } <START> } <END></code><technical_language>Need verify sets size well</technical_language>

Target:
private void assertAccountMapEquals(Collection<Account> expectedAccounts, Map<String, String> accountMap) throws Exception { Set<Account> expectedAccountSet = new HashSet<>(expectedAccounts); assertEquals("Number of accounts mismatch", expectedAccountSet.size(), accountMap.size()); for (String accountJsonString : accountMap.values()) { JSONObject accountJson = new JSONObject(accountJsonString); Account account = Account.fromJson(accountJson); assertTrue("unexpected account in map: " + accountJson.toString(), expectedAccountSet.contains(account)); } }
Source:
<code>public static void loadDimensionDataMap(@Nullable NBTTagCompound compound) { usedDimensionIds.clear(); lastUsedDimensionId = 0; if (compound == null) { dimensionTypeByDimensionId.keySet().stream().filter(dimensionId -> dimensionId >= 0).forEach(usedDimensionIds::add); } else { <START> for (int id : compound.getIntArray("UsedIDs")) { <END> usedDimensionIds.add(id); } int[] intArray = compound.getIntArray("DimensionArray"); for (int i = 0; i < intArray.length; i++) { int data = intArray[i]; if (data == 0) continue; for (int j = 0; j < Integer.SIZE; j++) { if ((data & (1 << j)) != 0) usedDimensionIds.add(i * Integer.SIZE + j); } } } }</code><technical_language>If store constants NbtDataUtil.Forge, that'd perfect (it's store a bunch of string constants for NbtData, clearer migrations if provide ways upgrade data forge sponge vanilla vice versa)</technical_language>

Target:
public static void loadDimensionDataMap(@Nullable NBTTagCompound compound) { usedDimensionIds.clear(); lastUsedDimensionId = 0; if (compound == null) { dimensionTypeByDimensionId.keySet().stream().filter(dimensionId -> dimensionId >= 0).forEach(usedDimensionIds::add); } else { for (int id : compound.getIntArray(NbtDataUtil.USED_DIMENSION_IDS)) { usedDimensionIds.add(id); } int[] intArray = compound.getIntArray(NbtDataUtil.LEGACY_DIMENSION_ARRAY); for (int i = 0; i < intArray.length; i++) { int data = intArray[i]; if (data == 0) continue; for (int j = 0; j < Integer.SIZE; j++) { if ((data & (1 << j)) != 0) usedDimensionIds.add(i * Integer.SIZE + j); } } } }
Source:
<code>public static ActiveMQQueue createQueue(final String address) { <START> <END> if (ArtemisSystemProperties.getInstance().is1XPrefix()) { return new ActiveMQQueue(PacketImpl.OLD_QUEUE_PREFIX + address); } else { return new ActiveMQQueue(address); } }</code><technical_language>Hot path (esp for spring users)</technical_language>

Target:
public static ActiveMQQueue createQueue(final String address) { return new ActiveMQQueue(address); }
Source:
<code>public String getHelp() { <START> return new TextComponentTranslation("commands.bloodmagic.bind.help").getFormattedText(); <END> }</code><technical_language>Pretty this is supposed localization key</technical_language>

Target:
public String getHelp() { return "commands.bloodmagic.bind.help"; }
Source:
<code><START> static KeyspaceMetadata ensureExists(String keyspace, boolean searchEnabled, Session session) { <END> session.getCluster().getMetadata().getAllHosts().forEach((host) -> { Preconditions.checkState( 0 < VersionNumber.parse("3.11.2").compareTo(host.getCassandraVersion()), "All Cassandra nodes must be running 3.11.3+"); }); KeyspaceMetadata result = session.getCluster().getMetadata().getKeyspace(keyspace); if (result == null || result.getTable(Schema.TABLE_SPAN) == null) { LOG.info("Installing schema for keyspace {}", SCHEMA_RESOURCE, keyspace); applyCqlFile(keyspace, session, SCHEMA_RESOURCE); if (searchEnabled) { LOG.info("Installing indexes for keyspace {}", INDEX_RESOURCE, keyspace); applyCqlFile(keyspace, session, INDEX_RESOURCE); } result = session.getCluster().getMetadata().getKeyspace(keyspace); } return result; }</code><technical_language>this means ask automatically install schema, crash if older version. Sounds fine long ENSURE_SCHEMA=false kill others</technical_language>

Target:
static KeyspaceMetadata ensureExists(String keyspace, boolean searchEnabled, Session session) { session.getCluster().getMetadata().getAllHosts().forEach((host) -> { Preconditions.checkState( 0 < VersionNumber.parse("3.11.3").compareTo(host.getCassandraVersion()), "All Cassandra nodes must be running 3.11.3+"); }); KeyspaceMetadata result = session.getCluster().getMetadata().getKeyspace(keyspace); if (result == null || result.getTable(Schema.TABLE_SPAN) == null) { LOG.info("Installing schema for keyspace {}", SCHEMA_RESOURCE, keyspace); applyCqlFile(keyspace, session, SCHEMA_RESOURCE); if (searchEnabled) { LOG.info("Installing indexes for keyspace {}", INDEX_RESOURCE, keyspace); applyCqlFile(keyspace, session, INDEX_RESOURCE); } result = session.getCluster().getMetadata().getKeyspace(keyspace); } return result; }
Source:
<code>public void setValueForField(Table table, int fieldIndex, int lineNumber, Field field, String string, boolean postgresText, String[] transformedStrings) { if (string.isEmpty()) { if (field.isRequired() && !field.isEmptyValuePermitted() && errorStorage != null) { errorStorage.storeError(NewGTFSError.forLine(table, lineNumber, MISSING_FIELD, field.name)); } setFieldToNull(postgresText, transformedStrings, fieldIndex, field); } else { try { Set<NewGTFSError> errors; if (postgresText) { ValidateFieldResult<String> result = field.validateAndConvert(string); if (result.clean == null) setFieldToNull(postgresText, transformedStrings, fieldIndex, field); else transformedStrings[fieldIndex + 1] = result.clean; errors = result.errors; <START> } else errors = field.setParameter(insertStatement, fieldIndex + 2, string); <END> for (NewGTFSError error : errors) { error.entityType = table.getEntityClass(); error.lineNumber = lineNumber; if (errorStorage != null) errorStorage.storeError(error); } } catch (StorageException ex) { if (errorStorage != null) { errorStorage.storeError(NewGTFSError.forLine(table, lineNumber, ex.errorType, ex.badValue)); } setFieldToNull(postgresText, transformedStrings, fieldIndex, field); } } }</code><technical_language>Please braces too</technical_language>

Target:
public void setValueForField(Table table, int fieldIndex, int lineNumber, Field field, String string, boolean postgresText, String[] transformedStrings) { if (string.isEmpty()) { if (field.isRequired() && !field.isEmptyValuePermitted() && errorStorage != null) { errorStorage.storeError(NewGTFSError.forLine(table, lineNumber, MISSING_FIELD, field.name)); } setFieldToNull(postgresText, transformedStrings, fieldIndex, field); } else { try { Set<NewGTFSError> errors; if (postgresText) { ValidateFieldResult<String> result = field.validateAndConvert(string); if (result.clean == null) setFieldToNull(postgresText, transformedStrings, fieldIndex, field); else transformedStrings[fieldIndex + 1] = result.clean; errors = result.errors; } else { errors = field.setParameter(insertStatement, fieldIndex + 2, string); } for (NewGTFSError error : errors) { error.entityType = table.getEntityClass(); error.lineNumber = lineNumber; if (errorStorage != null) errorStorage.storeError(error); } } catch (StorageException ex) { if (errorStorage != null) { errorStorage.storeError(NewGTFSError.forLine(table, lineNumber, ex.errorType, ex.badValue)); } setFieldToNull(postgresText, transformedStrings, fieldIndex, field); } } }
Source:
<code>private void initUnregisteredTemplate() { if (vmTemplateFromConfiguration == null) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getVmTemplateId(), getParameters().getStorageDomainId()); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { FullEntityOvfData fullEntityOvfData = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration = fullEntityOvfData.getVmTemplate(); setVmTemplate(vmTemplateFromConfiguration); images = fullEntityOvfData.getDiskImages(); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); <START> log.debug("Exception", <END> e); } } } }</code><technical_language>Add ":" a space word improve logs readability</technical_language>

Target:
private void initUnregisteredTemplate() { if (vmTemplateFromConfiguration == null) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getVmTemplateId(), getParameters().getStorageDomainId()); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { FullEntityOvfData fullEntityOvfData = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration = fullEntityOvfData.getVmTemplate(); setVmTemplate(vmTemplateFromConfiguration); images = fullEntityOvfData.getDiskImages(); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception: ", e); } } } }
Source:
<code>public void workingWithAgents() { Boolean b; dashboardWorkspace.selectTabInWorspaceMenu(TabNames.AGENTS); dashboardWorkspace.selectMachine("Workspace Agents", "dev-machine"); for (String agentName : AgentsList) { dashboardWorkspace.checkAgentExists(agentName); } for (int i = 0; i < AgentsList.size(); i++) { b = dashboardWorkspace.getAgentState(AgentsList.get(i)); <START> Assert.assertEquals(b, AgentsStateList.get(i)); <END> dashboardWorkspace.switchAgentState(AgentsList.get(i)); } clickOnSaveButton(); for (String agentName : AgentsList) { dashboardWorkspace.switchAgentState(agentName); } for (int i = 0; i < AgentsList.size(); i++) { b = dashboardWorkspace.getAgentState(AgentsList.get(i)); Assert.assertEquals(b, AgentsStateList.get(i)); } clickOnSaveButton(); }</code><technical_language>This code rewritten usage of redundant variable **Boolean b**: assertEquals(dashboardWorkspace.getAgentState(AgentsList.get(i)), AgentsStateList.get(i));</technical_language>

Target:
public void workingWithAgents() { dashboardWorkspace.selectTabInWorspaceMenu(TabNames.AGENTS); dashboardWorkspace.selectMachine("Workspace Agents", "dev-machine"); agents.forEach( (name, value) -> { dashboardWorkspace.checkAgentExists(name); }); agents.forEach( (name, value) -> { Assert.assertEquals(dashboardWorkspace.getAgentState(name), value); dashboardWorkspace.switchAgentState(name); }); clickOnSaveButton(); agents.forEach( (name, value) -> { dashboardWorkspace.switchAgentState(name); }); clickOnSaveButton(); agents.forEach( (name, value) -> { Assert.assertEquals(dashboardWorkspace.getAgentState(name), value); }); }
Source:
<code>protected void removeAllDraggableGroupComponent(Collection<FieldDefinition> fields) { Iterator<FieldDefinition> it = fields.iterator(); while (it.hasNext()) { FieldDefinition field = it.next(); try { layoutEditor.removeDraggableGroupComponent(getFormDefinition().getModel().getName(), field.getId()); } catch (JavaScriptException e) { <START> <END> } } }</code><technical_language>is this empty catch block ok</technical_language>

Target:
protected void removeAllDraggableGroupComponent(Collection<FieldDefinition> fields) { String groupId = getFormDefinition().getModel().getName(); Iterator<FieldDefinition> it = fields.iterator(); while (it.hasNext()) { FieldDefinition field = it.next(); if (layoutEditor.hasDraggableGroupComponent(groupId, field.getId())) { layoutEditor.removeDraggableGroupComponent(groupId, field.getId()); } } }
Source:
<code>public int getCurrentTaskThreadPoolSize() { <START> return _record.getIntField(LiveInstanceProperty.CURRENT_TASK_THREAD_POOL_SIZE.name(), CURRENT_TASK_THREAD_POOL_SIZE_NOT_SET); <END> }</code><technical_language>Please try understand proposed design thoroughly. For example, for instance a task thread pool of size -1? (it is meaningless, create a task pool size -1)</technical_language>

Target:
public int getCurrentTaskThreadPoolSize() { return _record.getIntField(LiveInstanceProperty.CURRENT_TASK_THREAD_POOL_SIZE.name(), TaskConstants.DEFAULT_TASK_THREAD_POOL_SIZE); }
Source:
<code>private Path getStagingDir(FileSystem fileSystem) { final String configuredStagingDir = flinkConfiguration.getString(YarnConfigOptions.STAGING_DIRECTORY); <START> return configuredStagingDir != null ? new Path(configuredStagingDir) : fileSystem.getHomeDirectory(); <END> }</code><technical_language>suggestion return configuredStagingDir != null ? fileSystem.makeQualified(new Path(configuredStagingDir)) : fileSystem.getHomeDirectory();</technical_language>

Target:
private Path getStagingDir(FileSystem fileSystem) { final String configuredStagingDir = flinkConfiguration.getString(YarnConfigOptions.STAGING_DIRECTORY); return configuredStagingDir != null ? fileSystem.makeQualified(new Path(configuredStagingDir)) : fileSystem.getHomeDirectory(); }
Source:
<code>public static Map<String, String> sendPutRequest(String url, String params, Map<String, String> headers) throws IDPTokenManagerException { HttpPut httpPut = new HttpPut(url); HttpClient httpClient = getCertifiedHttpClient(); HttpPut httpPutWithHeaders = (HttpPut) buildHeaders(httpPut, headers); Map<String, String> responseParams = new HashMap<String, String>(); if (params != null) { try { httpPutWithHeaders.setEntity(new StringEntity(params)); } catch (UnsupportedEncodingException e) { throw new IDPTokenManagerException("Invalid encoding type.", e); } } try { HttpResponse response = httpClient.execute(httpPutWithHeaders); String status = String.valueOf(response.getStatusLine().getStatusCode()); responseParams.put(Constants.SERVER_RESPONSE_STATUS, status); responseParams.put(Constants.SERVER_RESPONSE_BODY, getResponseBody(response)); } catch (ClientProtocolException e) { <START> throw new IDPTokenManagerException("Invalid client protocol.", e); <END> } catch (IOException e) { responseParams.put(Constants.SERVER_RESPONSE_BODY, "Internal Server Error"); responseParams.put(Constants.SERVER_RESPONSE_STATUS, Constants.INTERNAL_SERVER_ERROR); throw new IDPTokenManagerException("Server connectivity failure.", e); } return responseParams; }</code><technical_language>Do need add parameters configured in next catch block, well</technical_language>

Target:
public static Map<String, String> sendPutRequest(String url, String params, Map<String, String> headers) throws IDPTokenManagerException { HttpPut httpPut = new HttpPut(url); HttpClient httpClient = getCertifiedHttpClient(); httpPut = (HttpPut) buildHeaders(httpPut, headers); Map<String, String> responseParams = new HashMap<String, String>(); if (params != null) { try { httpPut.setEntity(new StringEntity(params)); } catch (UnsupportedEncodingException e) { throw new IDPTokenManagerException("Invalid encoding type.", e); } } try { HttpResponse response = httpClient.execute(httpPut); String status = String.valueOf(response.getStatusLine().getStatusCode()); responseParams.put(Constants.SERVER_RESPONSE_STATUS, status); responseParams.put(Constants.SERVER_RESPONSE_BODY, getResponseBody(response)); } catch (ClientProtocolException e) { String errorMsg = "Error occurred while sending 'Put' request due to an invalid client protocol being used"; responseParams.put(Constants.SERVER_RESPONSE_BODY, "Internal Server Error"); responseParams.put(Constants.SERVER_RESPONSE_STATUS, Constants.INTERNAL_SERVER_ERROR); Log.e(TAG, errorMsg); throw new IDPTokenManagerException(errorMsg, e); } catch (IOException e) { String errorMsg = "Error occurred while sending 'Put' request due to failure of server connection"; responseParams.put(Constants.SERVER_RESPONSE_BODY, "Internal Server Error"); responseParams.put(Constants.SERVER_RESPONSE_STATUS, Constants.INTERNAL_SERVER_ERROR); Log.e(TAG, errorMsg); throw new IDPTokenManagerException(errorMsg, e); } return responseParams; }
Source:
<code>public void setKeepOpen(boolean keepOpen) { <START> log.debug("keep open:" + keepOpen); <END> this.keepOpen.set(keepOpen); }</code><technical_language>{} placeholders in logger</technical_language>

Target:
public void setKeepOpen(boolean keepOpen) { log.debug("keep open: {}", keepOpen); this.keepOpen.set(keepOpen); }
Source:
<code>public void read(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi, @PathVariable("number") int ingestionNumber) throws IOException { <START> ArticleIngestionIdentifier ingestionId = ArticleIngestionIdentifier.create(DoiEscaping.resolve(doi), ingestionNumber); <END> articleCrudService.readArticleMetadata(ingestionId).respond(request, response, entityGson); }</code><technical_language>worth revisiting another maintenance ticket in future</technical_language>

Target:
public void read(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi, @PathVariable("number") int ingestionNumber) throws IOException { ArticleIngestionIdentifier ingestionId = ArticleIngestionIdentifier.create(DoiEscaping.unescape(doi), ingestionNumber); articleCrudService.readArticleMetadata(ingestionId).respond(request, response, entityGson); }
Source:
<code>protected void onLoad(Bundle savedInstanceState) { Timber.v("onLoad"); ButterKnife.bind(this, getView()); setActionBar(); <START> Person person = (Person) visit.included().get(1); <END> Score score = visitResult.included().get(0); int points = score.attributes().pointsForKnock() + score.attributes().pointsForUpdates(); getView().animateScore(points); getView().animateLabels( score.attributes().pointsForKnock(), score.attributes().pointsForUpdates(), person.attributes().firstName()); }</code><technical_language>chance this empty</technical_language>

Target:
protected void onLoad(Bundle savedInstanceState) { Timber.v("onLoad"); ButterKnife.bind(this, getView()); setActionBar(); getView().post(new Runnable() { @Override public void run() { String firstName = null; try { Person person = (Person) visit.included().get(1); firstName = person.attributes().firstName(); } catch (IndexOutOfBoundsException e) { Timber.e(e, "no person update found"); } Score score = visitResult.included().get(0); int points = score.attributes().pointsForKnock() + score.attributes().pointsForUpdates(); getView().animateScore(points); getView().animateLabels( score.attributes().pointsForKnock(), score.attributes().pointsForUpdates(), firstName); } }); }
Source:
<code>public TagOperation(Repository repo, Tag tag, boolean shouldMoveTag) { this.tag = tag; this.repo = repo; <START> tagName = tag.getTag(); <END> this.shouldMoveTag = shouldMoveTag; refName = Constants.R_TAGS + tagName; }</code><technical_language>tagName is redundant. local variablesl if necessary</technical_language>

Target:
public TagOperation(Repository repo, Tag tag, boolean shouldMoveTag) { this.tag = tag; this.repo = repo; this.shouldMoveTag = shouldMoveTag; }
Source:
<code><START> protected IEclipseContext createContext(final Event trigger) { <END> final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); staticContext.set(Event.class, trigger); return staticContext; }</code><technical_language>This method private default is API addition</technical_language>

Target:
private IEclipseContext createContext(final Event trigger) { final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); staticContext.set(Event.class, trigger); return staticContext; }
Source:
<code><START> protected String getLockID() { return lockID; } <END></code><technical_language>I of other new 'getter' methods removed in favor of package-private visibility field. Keeping field access simple, creating new methods, future code changes minimizing call stack follow understand is on. However, I this stay, provides access a non-final field, of others final already. package-private, though, instead of protected, need access subclasses</technical_language>

Target:
String getLockID() { return lockID; }
Source:
<code>public DataSet data(DecoratedKey partitionKey) { SimpleDataSet result = new SimpleDataSet(metadata()); Config config = DatabaseDescriptor.getRawConfig(); String setting = null; try { setting = UTF8Type.instance.compose(partitionKey.getKey()); Field field = config.getClass().getDeclaredField(setting); if (!FIELDS.contains(field)) throw new InvalidRequestException("Invalid setting: " + setting); Object value = field.get(config); result.row(setting); if (value != null) result.column(VALUE, value.toString()); } catch (IllegalAccessException | IllegalArgumentException e) <START> { <END> throw new ServerError(e); } catch (NoSuchFieldException e) { throw new InvalidRequestException("No such setting: " + setting); } return result; }</code><technical_language>handle array values other data() implementation</technical_language>

Target:
public DataSet data(DecoratedKey partitionKey) { SimpleDataSet result = new SimpleDataSet(metadata()); String setting = UTF8Type.instance.compose(partitionKey.getKey()); Field field = FIELDS.get(setting); if (field != null) addValue(result, field); else { for (Map.Entry<String, Field> f : FIELDS.entrySet()) { if (setting.startsWith(f.getKey())) { addValue(result, f.getValue()); } } } return result; }
Source:
<code>private void waitForTaskToBeStarted(Future<Void> taskExecutionSubmittedFuture) { try { taskExecutionSubmittedFuture.get(DOTASK_ACTION_TIMEOUT, TimeUnit.MILLISECONDS); } catch (Exception e) { <START> logger.warn("Could not wait for the task to be started on TaskLauncher.", e); <END> } }</code><technical_language>I prefer "Error while waiting for task started.", exception inform if a timeout, etc</technical_language>

Target:
private void waitForTaskToBeStarted(Future<Void> taskExecutionSubmittedFuture) { try { taskExecutionSubmittedFuture.get(DOTASK_ACTION_TIMEOUT, TimeUnit.MILLISECONDS); } catch (Exception e) { logger.warn("Error while waiting for the task to be started.", e); } }
Source:
<code>public void onMatch(RelOptRuleCall call) { Sort sort = call.rel(0); FlinkLogicalTableSourceScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); int offset = sort.offset == null ? 0 : RexLiteral.intValue(sort.offset); int limit = offset + RexLiteral.intValue(sort.fetch); TableSourceTable newTableSourceTable = applyLimit(limit, tableSourceTable); FlinkLogicalTableSourceScan newScan = FlinkLogicalTableSourceScan.create(scan.getCluster(), newTableSourceTable); <START> call.transformTo(sort.copy(sort.getTraitSet(), Collections.singletonList(newScan))); <END> }</code><technical_language>put sort.copy(sort.getTraitSet(), Collections.singletonList(newScan)) in a single line, debugging more easy</technical_language>

Target:
public void onMatch(RelOptRuleCall call) { Sort sort = call.rel(0); FlinkLogicalTableSourceScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); int offset = sort.offset == null ? 0 : RexLiteral.intValue(sort.offset); int limit = offset + RexLiteral.intValue(sort.fetch); TableSourceTable newTableSourceTable = applyLimit(limit, tableSourceTable); FlinkLogicalTableSourceScan newScan = FlinkLogicalTableSourceScan.create(scan.getCluster(), newTableSourceTable); Sort newSort = sort.copy(sort.getTraitSet(), Collections.singletonList(newScan)); call.transformTo(newSort); }
Source:
<code>public void store(Collection<Branch> branches) throws OseeCoreException { Callable<IStatus> task = new StoreBranchDatabaseCallable(getLogger(), session, getDatabaseService(), getExecutorAdmin(), getEventService(), branches); try { IStatus status = task.call(); <START> if (!status.isOK()) { <END> throw new OseeStateException("Error storing branches"); } else { for (Branch branch : branches) { branch.clearDirty(); } Map<String, Object> eventData = new HashMap<String, Object>(); eventData.put(OrcsConstants.ORCS_BRANCH_EVENT_DATA, Collections.unmodifiableCollection(branches)); getEventService().sendEvent(OrcsConstants.ORCS_BRANCH_MODIFIED_EVENT, eventData); } } catch (Exception ex) { OseeExceptions.wrapAndThrow(ex); } }</code><technical_language>switch condition of this if for readability</technical_language>

Target:
public void store(Collection<Branch> branches) throws OseeCoreException { Callable<IStatus> task = new StoreBranchDatabaseCallable(getLogger(), session, getDatabaseService(), getExecutorAdmin(), getEventService(), branches); try { IStatus status = task.call(); if (status.isOK()) { for (Branch branch : branches) { branch.clearDirty(); } Map<String, Object> eventData = new HashMap<String, Object>(); eventData.put(OrcsConstants.ORCS_BRANCH_EVENT_DATA, Collections.unmodifiableCollection(branches)); getEventService().sendEvent(OrcsConstants.ORCS_BRANCH_MODIFIED_EVENT, eventData); } else { throw new OseeStateException("Error storing branches"); } } catch (Exception ex) { OseeExceptions.wrapAndThrow(ex); } }
Source:
<code>public RoutingResponse route(Router router) { List<Itinerary> itineraries = new ArrayList<>(); List<RoutingError> routingErrors = new ArrayList<>(); try { itineraries.addAll(DirectStreetRouter.route(router, request)); <START> } catch (Exception e) { <END> routingErrors.add( new RoutingError( RoutingErrorCode.SYSTEM_ERROR, "An error occurred during direct street routing.", null) ); } try { itineraries.addAll(routeTransit(router)); } catch (NoStopsInRangeException e) { for (String missing : e.getMissing()) { routingErrors.add( new RoutingError( RoutingErrorCode.NO_STOPS_IN_RANGE, "Unable to find any stops in range of the location.", missing) ); } } catch (Exception e) { routingErrors.add( new RoutingError( RoutingErrorCode.SYSTEM_ERROR, "An error occurred during transit routing.", null) ); } long startTimeFiltering = System.currentTimeMillis(); itineraries = filterChain().filter(itineraries); LOG.debug("Filtering took ms", System.currentTimeMillis() - startTimeFiltering); LOG.debug("Return TripPlan with itineraries", itineraries.size()); return new RoutingResponse( TripPlanMapper.mapTripPlan(request, itineraries), responseMetadata, routingErrors ); }</code><technical_language>catch business specific exceptions mapped a RoutingError</technical_language>

Target:
public RoutingResponse route(Router router) { List<Itinerary> itineraries = new ArrayList<>(); List<RoutingError> routingErrors = new ArrayList<>(); try { itineraries.addAll(DirectStreetRouter.route(router, request)); } catch (RoutingValidationException e) { routingErrors.addAll(e.getRoutingErrors()); } try { itineraries.addAll(routeTransit(router)); } catch (RoutingValidationException e) { routingErrors.addAll(e.getRoutingErrors()); } long startTimeFiltering = System.currentTimeMillis(); itineraries = filterChain().filter(itineraries); LOG.debug("Filtering took ms", System.currentTimeMillis() - startTimeFiltering); LOG.debug("Return TripPlan with itineraries", itineraries.size()); return new RoutingResponse( TripPlanMapper.mapTripPlan(request, itineraries), responseMetadata, routingErrors ); }
Source:
<code>private void openRowGroup() throws IOException { if (!dictionaryOpen && dictionarySize > 0) { if (dictionary.length < dictionarySize) { dictionary = new long[dictionarySize]; <START> systemMemoryContext.setBytes(sizeOf(dictionary)); <END> } LongInputStream dictionaryStream = dictionaryDataStreamSource.openStream(); if (dictionaryStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Dictionary is not empty but data stream is not present"); } dictionaryStream.next(dictionary, dictionarySize); if (filter != null && !nonDeterministicFilter) { dictionaryFilterStatus = ensureCapacity(dictionaryFilterStatus, dictionarySize); Arrays.fill(dictionaryFilterStatus, 0, dictionarySize, FILTER_NOT_EVALUATED); } } dictionaryOpen = true; presentStream = presentStreamSource.openStream(); inDictionaryStream = inDictionaryStreamSource.openStream(); dataStream = dataStreamSource.openStream(); rowGroupOpen = true; }</code><technical_language>This change right is part of nulling member variables in close</technical_language>

Target:
private void openRowGroup() throws IOException { if (!dictionaryOpen && dictionarySize > 0) { if (dictionary.length < dictionarySize) { dictionary = new long[dictionarySize]; } LongInputStream dictionaryStream = dictionaryDataStreamSource.openStream(); if (dictionaryStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Dictionary is not empty but data stream is not present"); } dictionaryStream.nextLongVector(dictionarySize, dictionary); if (filter != null && !nonDeterministicFilter) { dictionaryFilterStatus = ensureCapacity(dictionaryFilterStatus, dictionarySize); Arrays.fill(dictionaryFilterStatus, 0, dictionarySize, FILTER_NOT_EVALUATED); } } dictionaryOpen = true; presentStream = presentStreamSource.openStream(); inDictionaryStream = inDictionaryStreamSource.openStream(); dataStream = dataStreamSource.openStream(); rowGroupOpen = true; }
Source:
<code>public <F> void testServerException() throws Exception{ SessionFactory<F> sf = mock(SessionFactory.class); CachingSessionFactory<F> csf = new CachingSessionFactory<F>(sf, 2); FileTransferringMessageHandler<F> handler = new FileTransferringMessageHandler<F>(csf); Session<F> session1 = newSession(); Session<F> session2 = newSession(); Session<F> session3 = newSession(); <START> when(sf.getSession()).thenReturn(session1).thenReturn(session2).thenReturn(session3); <END> handler.setRemoteDirectoryExpression(new LiteralExpression("foo")); handler.afterPropertiesSet(); for (int i = 0; i < 3; i++) { try { handler.handleMessage(new GenericMessage<String>("hello")); } catch (Exception e) { assertEquals("test", e.getCause().getCause().getMessage()); } } verify(session1, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session2, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session3, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); SimplePool<?> pool = TestUtils.getPropertyValue(csf, "pool", SimplePool.class); assertEquals(1, pool.getAllocatedCount()); assertEquals(1, pool.getIdleCount()); assertSame(session3, TestUtils.getPropertyValue(pool, "allocated", Set.class).iterator().next()); }</code><technical_language>simplified: when(sf.getSession()).thenReturn(session1, session2, session3);</technical_language>

Target:
public <F> void testServerException() throws Exception{ SessionFactory<F> sf = mock(SessionFactory.class); CachingSessionFactory<F> csf = new CachingSessionFactory<F>(sf, 2); FileTransferringMessageHandler<F> handler = new FileTransferringMessageHandler<F>(csf); Session<F> session1 = newSession(); Session<F> session2 = newSession(); Session<F> session3 = newSession(); when(sf.getSession()).thenReturn(session1, session2, session3); handler.setRemoteDirectoryExpression(new LiteralExpression("foo")); handler.afterPropertiesSet(); for (int i = 0; i < 3; i++) { try { handler.handleMessage(new GenericMessage<String>("hello")); } catch (Exception e) { assertEquals("test", e.getCause().getCause().getMessage()); } } verify(session1, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session2, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session3, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); SimplePool<?> pool = TestUtils.getPropertyValue(csf, "pool", SimplePool.class); assertEquals(1, pool.getAllocatedCount()); assertEquals(1, pool.getIdleCount()); assertSame(session3, TestUtils.getPropertyValue(pool, "allocated", Set.class).iterator().next()); }
Source:
<code>public List<Offer> getOffers(String direction, String fiatCurrencyCode) { List<Offer> offers = offerBookService.getOffers().stream() .filter(o -> !o.getDirection().name().equalsIgnoreCase(direction) <START> && o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode)) <END> .collect(Collectors.toList()); if (direction.equals(BUY.name())) offers.sort(Comparator.comparing(Offer::getPrice)); else offers.sort(Comparator.comparing(Offer::getPrice).reversed()); return offers; }</code><technical_language>predicates moved descriptive intermediate variables for sake of readability. o -> { var offerOfWantedDirection = !o.getDirection().name().equalsIgnoreCase(direction); var offerInWantedCurrency = o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode); return offerOfWantedDirection && offerInWantedCurrency; }</technical_language>

Target:
public List<Offer> getOffers(String direction, String fiatCurrencyCode) { List<Offer> offers = offerBookService.getOffers().stream() .filter(o -> { var offerOfWantedDirection = o.getDirection().name().equalsIgnoreCase(direction); var offerInWantedCurrency = o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode); return offerOfWantedDirection && offerInWantedCurrency; }) .collect(Collectors.toList()); if (direction.equalsIgnoreCase(BUY.name())) offers.sort(Comparator.comparing(Offer::getPrice).reversed()); else offers.sort(Comparator.comparing(Offer::getPrice)); return offers; }
Source:
<code>public Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, int itemsPerPage) throws GitLabApiException { Form formData = new GitLabApiForm() .withParam("ref_name", ref) .withParam("since", ISO8601.toString(since, false)) .withParam("until", ISO8601.toString(until, false)); <START> return (new Pager<Commit>(this, Commit.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "commits")); <END> }</code><technical_language>Yes, this a good idea</technical_language>

Target:
public Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, int itemsPerPage) throws GitLabApiException { return getCommits(projectId, ref, since,until, null, itemsPerPage); }
Source:
<code>public Optional<Urlset> getChangeList(@Nullable User user, String ownerId, String dataSetId) throws IOException { Urlset changeList = null; Optional<DataSet> maybeDataSet = dataSetRepository.getDataSet(user, ownerId, dataSetId); if (maybeDataSet.isPresent()) { DataSetMetaData dataSetMetaData = maybeDataSet.get().getMetadata(); RsMd rsMd = new RsMd(Capability.CHANGELIST.xmlValue); changeList = new Urlset(rsMd) .addLink(new RsLn(REL_UP, rsUriHelper.uriForRsDocument(dataSetMetaData, Capability.CAPABILITYLIST))); UpdatedPerPatchStore updatedPerPatchStore = maybeDataSet.get().getUpdatedPerPatchStore(); <START> ChangesRetriever changesRetriever = new ChangesRetriever( <END> updatedPerPatchStore, null, dataSetMetaData.getBaseUri()); Supplier<List<Integer>> versionsSupplier = () -> { try (Stream<Integer> versions = updatedPerPatchStore.getVersions()) { return versions.collect(Collectors.toList()); } }; List<String> changeFileNames = changesRetriever.retrieveChangeFileNames(versionsSupplier); for (String changeFileName : changeFileNames) { UrlItem item = new UrlItem(dataSetMetaData.getBaseUri() + "/" + dataSetMetaData.getOwnerId() + "/" + dataSetMetaData.getDataSetId() + "/changes/" + changeFileName) .withMetadata(new RsMd() .withChange("updated")); changeList.addItem(item); } } return Optional.ofNullable(changeList); }</code><technical_language>Add changesretriever dataset</technical_language>

Target:
public Optional<Urlset> getChangeList(@Nullable User user, String ownerId, String dataSetId) throws IOException { Urlset changeList = null; Optional<DataSet> maybeDataSet = dataSetRepository.getDataSet(user, ownerId, dataSetId); if (maybeDataSet.isPresent()) { DataSetMetaData dataSetMetaData = maybeDataSet.get().getMetadata(); LogList loglist = maybeDataSet.get().getImportManager().getLogList(); RsMd rsMd = new RsMd(Capability.CHANGELIST.xmlValue) .withFrom(ZonedDateTime.parse(loglist.getLastImportDate())); List<LogEntry> logEntries = loglist.getEntries(); changeList = new Urlset(rsMd) .addLink(new RsLn(REL_UP, rsUriHelper.uriForRsDocument(dataSetMetaData, Capability.CAPABILITYLIST))); ChangeListBuilder changeListBuilder = new ChangeListBuilder(dataSetMetaData.getBaseUri()); ChangesRetriever changesRetriever = maybeDataSet.get().getChangesRetriever(); List<String> changeFileNames = changeListBuilder.retrieveChangeFileNames( changesRetriever.getVersions() ); for (String changeFileName : changeFileNames) { LogEntry logEntry = logEntries.get(getVersionFromFileId(changeFileName)); UrlItem item = new UrlItem(rsUriHelper.uriForChanges(dataSetMetaData, changeFileName)) .withMetadata(new RsMd() .withChange("updated") .withType("application/vnd.timbuctoo-rdf.nquads_unified_diff") .withDateTime(ZonedDateTime.parse(logEntry.getImportStatus().getDate()))); changeList.addItem(item); } } return Optional.ofNullable(changeList); }
Source:
<code>public void dispatchInvalidateOptionsMenu() { if (BuildConfig.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); mActivity.getWindow().invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); <START> if (mMenu != null) { mMenu.invalidate(); } <END> }</code><technical_language>brackets put invalidate line</technical_language>

Target:
public void dispatchInvalidateOptionsMenu() { if (BuildConfig.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); mActivity.getWindow().invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); if (mMenu != null) mMenu.invalidate(); }
Source:
<code>protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { getReturnValue().setFault(new VdcFault(e, e.getVdsError().getCode())); log.errorFormat("Image {0} does not exist in domain {1}. Removing disk from DB.", getDiskImage().getId(), <START> getParameters().getStorageDomainId()); <END> } else { throw e; } } if (getParameters().isRemoveDuringExecution() && getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { removeImageFromDB(false); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }</code><technical_language>end method executed if task created..otherwise run</technical_language>

Target:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { getReturnValue().setFault(new VdcFault(e, e.getVdsError().getCode())); log.errorFormat("Image {0} does not exist in domain {1}. Removing disk from DB.", getDiskImage().getId(), getParameters().getStorageDomainId()); endCommand(); } else { throw e; } } if (getParameters().isRemoveDuringExecution() && getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { removeImageFromDB(false); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
<code>public void checkFileCopied() { container.start(); try { String filesList = container.execInContainer("ls","/opt/mappable-resource").getStdout(); Assert.assertTrue(filesList.contains(fileName)); } catch (Exception e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Please exception thrown test method, important</technical_language>

Target:
public void checkFileCopied() throws IOException, InterruptedException { try( GenericContainer container = new GenericContainer("alpine:latest") .withCommand("sleep","3000") .withCopyFileToContainer(MountableFile.forClasspathResource("/mappable-resource/"), containerPath) ) { container.start(); String filesList = container.execInContainer("ls","/tmp/mappable-resource").getStdout(); Assert.assertTrue(filesList.contains(fileName)); } }
Source:
<code>public void shouldReturnGeneratedToken() throws Exception { LoginInput loginInput = new LoginInput(); loginInput.setUsername("admin"); <START> loginInput.setPassword("$2a$10$WqtVx7Iio0cndyR1lEaKW.SWhUYmF/zHHG5hkAXvH5hUmklM7QfMO"); <END> RestAssuredMockMvc.given() .contentType("application/json") .header("Accept", "application/json") .body(loginInput) .when() .post("/api/login") .peek() .then() .body("token", CoreMatchers.any(String.class)) .body("authorities", hasSize(greaterThan(0))) .statusCode(200); }</code><technical_language>is this changed a hash? I understand, send JSON login controller raw user credentials simulate a real login request</technical_language>

Target:
public void shouldReturnGeneratedToken() throws Exception { LoginInput loginInput = new LoginInput(); loginInput.setUsername("admin"); loginInput.setPassword("password"); RestAssuredMockMvc.given() .contentType("application/json") .header("Accept", "application/json") .body(loginInput) .when() .post("/api/login") .peek() .then() .body("token", CoreMatchers.any(String.class)) .body("authorities", hasSize(greaterThan(0))) .statusCode(200); }
Source:
<code>public Set<Symbol> getOut(CFG.Block block) { <START> return ImmutableSet.copyOf(out.get(block)); <END> }</code><technical_language>@benzonico copy done of getter - end of analysis</technical_language>

Target:
public Set<Symbol> getOut(CFG.Block block) { return out.get(block); }
Source:
<code>SessionPayload(Collection<SessionCount> sessionCounts, Configuration configuration) { <START> this.sessionCounts.addAll(sessionCounts); <END> diagnostics = new Diagnostics(configuration); }</code><technical_language>initialize ArrayList sessionCounts instead of calling addAll? initializing result in potentially array resizing</technical_language>

Target:
SessionPayload(Collection<SessionCount> sessionCounts, Configuration configuration) { this.sessionCounts = sessionCounts; diagnostics = new Diagnostics(configuration); }
Source:
<code>protected String getPagePhrase(SyntaxContainer syntax, String pageNumber) { String result = ""; Integer page = IntegerCompat.tryParse(pageNumber); if (page == null) { page = 1; } PagingType pagingType = getPagingType(); if (pagingType != null) { String pagingSyntax = Config.<String> getValue(ConfigValues.DBPagingSyntax); switch (pagingType) { case Range: result = StringFormat.format(pagingSyntax, BigInteger.valueOf((page - 1) * syntax.getMaxCount() + 1), <START> BigInteger.valueOf(page * syntax.getMaxCount())); <END> break; case Offset: result = StringFormat.format(pagingSyntax, BigInteger.valueOf((page - 1) * syntax.getMaxCount() + 1), syntax.getMaxCount()); break; } } return result; }</code><technical_language>This advantage of BigInteger, calculation is done plain integers, overflow calling BigInteger.valueOf. need do this: BigInteger bigPage = BigInteger.valueOf(page); BigInteger bigCount = BigInteger.valueOf(sytanx.getMaxCount()); BigInteger bigX = bigPage.subtract(BigInteger.ONE).multiply(bigCount).add(BigInteger.ONE); BigInteger bigY = bigPage.multiply(bigCount); result = StringFormat.format(pagingSyntax, bigX, bigY); is ugly, hard read, I know, 100% overflows in JVM</technical_language>

Target:
protected String getPagePhrase(SyntaxContainer syntax, String pageNumber) { String result = ""; Integer page = IntegerCompat.tryParse(pageNumber); if (page == null) { page = 1; } PagingType pagingType = getPagingType(); if (pagingType != null) { String pagingSyntax = Config.<String> getValue(ConfigValues.DBPagingSyntax); BigInteger bigPage = BigInteger.valueOf(page); BigInteger bigCount = BigInteger.valueOf(syntax.getMaxCount()); BigInteger bigX = bigPage.subtract(BigInteger.ONE).multiply(bigCount).add(BigInteger.ONE); BigInteger bigY = bigPage.multiply(bigCount); switch (pagingType) { case Range: result = StringFormat.format(pagingSyntax, bigX, bigY); break; case Offset: result = StringFormat.format(pagingSyntax, bigX, bigCount); break; } } return result; }
Source:
<code>public Worker(WorkerAbstract worker) throws WorkerException { try { <START> loadProperties(); <END> } catch (IOException e) { throw new WorkerException(e); } worker.initialize(properties); worker.onStartUp(); this.worker = worker; }</code><technical_language>this in method loadProperties()</technical_language>

Target:
public Worker(WorkerAbstract worker) throws WorkerException, GravitonCommunicationException { try { loadProperties(); } catch (IOException e) { throw new WorkerException(e); } worker.initialize(properties); worker.onStartUp(); this.worker = worker; }
Source:
<code>public abstract void toExecute(JobExecutionContext context) throws JobExecutionException; public static JobStatus scheduleJob(JobCurator jobCurator, Scheduler scheduler, JobDetail detail, Trigger trigger) throws SchedulerException { scheduler.getListenerManager().addJobListenerMatcher( PinsetterJobListener.LISTENER_NAME, jobNameEquals(detail.getKey().getName())); JobStatus status = null; try { status = jobCurator.create(new JobStatus(detail, trigger == null)); if (trigger != null) { scheduler.scheduleJob(detail, trigger); } else { scheduler.addJob(detail, false); } } catch (EntityExistsException e) { status = jobCurator.find(detail.getKey().getName()); jobCurator.merge(status); } catch (RuntimeException e) { status.setState(JobStatus.JobState.FAILED); jobCurator.merge(status); throw e; } <START> <END> return status; }</code><technical_language>@vritant issue throwing in log</technical_language>

Target:
public abstract void toExecute(JobExecutionContext context) throws JobExecutionException; public static JobStatus scheduleJob(JobCurator jobCurator, Scheduler scheduler, JobDetail detail, Trigger trigger) throws SchedulerException { scheduler.getListenerManager().addJobListenerMatcher( PinsetterJobListener.LISTENER_NAME, jobNameEquals(detail.getKey().getName())); JobStatus status = null; try { status = jobCurator.create(new JobStatus(detail, trigger == null)); if (trigger != null) { scheduler.scheduleJob(detail, trigger); } else { scheduler.addJob(detail, false); } } catch (EntityExistsException e) { status = jobCurator.find(detail.getKey().getName()); jobCurator.merge(status); } catch (RuntimeException e) { failStatus(jobCurator, status); throw e; } catch (SchedulerException e) { failStatus(jobCurator, status); throw e; } return status; }
Source:
<code>public void fillMsqMinSelectableChoices(int qnNumber, String value) { WebElement inputBox = getMsqMinSelectableChoicesBox(qnNumber); String id = inputBox.getAttribute("id"); <START> fillTextBox(browser.driver.findElement(By.id(id)), value); <END> }</code><technical_language>i replace browser.driver.findElement(By.id(id)) inputBox</technical_language>

Target:
public void fillMsqMinSelectableChoices(int qnNumber, String value) { WebElement inputBox = getMsqMinSelectableChoicesBox(qnNumber); fillTextBox(inputBox, value); executeScript("$(arguments[0]).change();", inputBox); }