auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<Metacard> get() { if (!configDirectory.exists()) { <START> LOGGER.debug("Could not locate forms directory"); <END> return Collections.emptyList(); } if (!configDirectory.canRead()) { LOGGER.debug("Forms directory exists but could not be read"); return Collections.emptyList(); } File formsFile = configDirectory.toPath().resolve(FORMS_FILE_NAME).toFile(); File resultsFile = configDirectory.toPath().resolve(RESULTS_FILE_NAME).toFile(); return Stream.concat( loadFile(formsFile, this::formMapper), loadFile(resultsFile, this::resultsMapper)) .collect(Collectors.toList()); }</code><technical_language>want log config directory path. I this logged info</technical_language>

Target:
public List<Metacard> get() { if (!configDirectory.exists()) { LOGGER.warn("Could not locate forms directory [{}]", configDirectory.getAbsolutePath()); return Collections.emptyList(); } File formsFile = configDirectory.toPath().resolve(FORMS_FILE_NAME).toFile(); File resultsFile = configDirectory.toPath().resolve(RESULTS_FILE_NAME).toFile(); return Stream.concat( loadFile(formsFile, this::formMapper), loadFile(resultsFile, this::resultsMapper)) .collect(Collectors.toList()); }
Source:
<code>public CompleteOnRedirectAction() { <START> setLabel("SET-STATE"); <END> }</code><technical_language>specific now, call label COMPLETE</technical_language>

Target:
public CompleteOnRedirectAction() { setLabel("COMPLETE"); }
Source:
<code>public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> machineEntry : internalEnv.getMachines().entrySet()) { final String machineName = machineEntry.getKey(); Map<String, String> containerLabels = new HashMap<>(); for (Map.Entry<String, ServerConfig> serverEntry : machineEntry.getValue().getServers().entrySet()) { <START> final String serverName = serverEntry.getKey().replace('/', '-'); <END> final String host = "Host:" + hostnameBuilder.build(serverName, machineName, identity.getWorkspaceId()); final String serviceName = machineName + "-" + serverName; final String port = serverEntry.getValue().getPort().split("/")[0]; containerLabels.put(format("traefik.%s.port", serviceName), port); containerLabels.put(format("traefik.%s.frontend.entryPoints", serviceName), "http"); containerLabels.put(format("traefik.%s.frontend.rule", serviceName), host); containerLabels.put("traefik.frontend.rule", machineName); } DockerContainerConfig dockerConfig = internalEnv.getContainers().get(machineName); dockerConfig.getLabels().putAll(containerLabels); } }</code><technical_language>I server name other symbols allowed in DNS entry. check a case breaks this code</technical_language>

Target:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> machineEntry : internalEnv.getMachines().entrySet()) { final String machineName = machineEntry.getKey(); Map<String, String> containerLabels = new HashMap<>(); for (Map.Entry<String, ServerConfig> serverEntry : machineEntry.getValue().getServers().entrySet()) { if (parseBoolean(serverEntry.getValue().getAttributes().get(INTERNAL_SERVER_ATTRIBUTE))) { continue; } final String host = hostnameBuilder.build(serverEntry.getKey(), machineName, identity.getWorkspaceId()); final String serviceName = getServiceName(host); final String port = serverEntry.getValue().getPort().split("/")[0]; containerLabels.put(format("traefik.%s.port", serviceName), port); containerLabels.put(format("traefik.%s.frontend.entryPoints", serviceName), "http"); containerLabels.put(format("traefik.%s.frontend.rule", serviceName), "Host:" + host); containerLabels.put("traefik.frontend.rule", machineName); } DockerContainerConfig dockerConfig = internalEnv.getContainers().get(machineName); dockerConfig.getLabels().putAll(containerLabels); } }
Source:
<code>public String toString() { <START> return "Request with " + this.getId() + " id to invoke " + this.getMethod() + " method with " + this.getParams().toString(); <END> }</code><technical_language>s/id/ID</technical_language>

Target:
public String toString() { return "Request with " + this.getId() + " ID to invoke " + this.getMethod() + " method with " + this.getParams().toString(); }
Source:
<code>protected void setTitle(CharSequence title) { <START> mCollapsingToolbarLayoutWeakReference.get().setTitle(title); <END> }</code><technical_language>add null check, I check in OnNavigated, is strong guarantee gc happen in middle</technical_language>

Target:
protected void setTitle(CharSequence title) { CollapsingToolbarLayout collapsingToolbarLayout = mCollapsingToolbarLayoutWeakReference.get(); if (collapsingToolbarLayout != null) { collapsingToolbarLayout.setTitle(title); } }
Source:
<code>private List<MachineDescriptor> processWorkerParameters(final List<EvaluatorParameters> evalParamsList) { final List<MachineDescriptor> machineDescriptors = new ArrayList<>(evalParamsList.size()); for (final EvaluatorParameters evalParams : evalParamsList) { final WorkerEvaluatorParameters workerEvalParams = (WorkerEvaluatorParameters) evalParams; final String id = workerEvalParams.getId(); final int numDataBlocks = workerEvalParams.getDataInfo().getNumBlocks(); final String hostname = workerEvalParams.getMetrics().getHostname().toString(); final double bandwidth = hostToBandwidth.getOrDefault(hostname, defNetworkBandwidth) / 8D; final double cWProc = workerEvalParams.getMetrics().getTotalCompTime(); <START> cWProcInfo.put(hostname, cWProc); <END> machineDescriptors.add( new MachineDescriptor(id, bandwidth, numDataBlocks, cWProc, NUM_EMPTY_BLOCK, hostname)); } return machineDescriptors; }</code><technical_language>This fluctuate time; apply Exponential Moving Average (EMA) this, a large weight values</technical_language>

Target:
private List<MachineDescriptor> processWorkerParameters(final List<EvaluatorParameters> evalParamsList) { final List<MachineDescriptor> machineDescriptors = new ArrayList<>(evalParamsList.size()); for (final EvaluatorParameters evalParams : evalParamsList) { final WorkerEvaluatorParameters workerEvalParams = (WorkerEvaluatorParameters) evalParams; final String id = workerEvalParams.getId(); final int numDataBlocks = workerEvalParams.getDataInfo().getNumBlocks(); final String hostname = workerEvalParams.getMetrics().getHostname().toString(); final double bandwidth = hostToBandwidth.getOrDefault(hostname, defNetworkBandwidth) / 8D; final double presentCWProc = workerEvalParams.getMetrics().getTotalCompTime(); final double cWProc = hostToCWProc.containsKey(hostname) ? presentCWProc * EMA_ALPHA + hostToCWProc.get(hostname) * (1.0 - EMA_ALPHA) : presentCWProc; hostToCWProc.put(hostname, cWProc); machineDescriptors.add( new MachineDescriptor(id, bandwidth, numDataBlocks, cWProc, NUM_EMPTY_BLOCK, hostname)); } return machineDescriptors; }
Source:
<code>public void testErrorResponseParsing() throws IOException { UrbanAirshipClient client = UrbanAirshipClient.newBuilder() .setKey("ISex_TTJRuarzs9-o_Gkhg") .setSecret("nDq-bQ3CT92PqCIXNtQyCQ") .build(); PartialPushPayload partialPushPayload = PartialPushPayload.newBuilder() .setNotification(Notification.newBuilder() .setAlert("Hello {{FIRST_NAME}} {{LAST_NAME}}, this is a test!") .build() ) .build(); TemplateRequest request = TemplateRequest.newRequest("template-id-123") .setPush(partialPushPayload); try { Response<TemplateResponse> response = client.execute(request); } catch (RuntimeException e) { <START> ClientException ex = (ClientException) e.getCause().getCause(); <END> Assert.assertEquals(400, ex.getStatusCode()); Assert.assertEquals("\"id\" must be a valid GUID", ex.getError().get().getError()); } }</code><technical_language>"expects exception" rule in test, in case exception thrown</technical_language>

Target:
public void testErrorResponseParsing() throws IOException { UrbanAirshipClient client = UrbanAirshipClient.newBuilder() .setKey("ISex_TTJRuarzs9-o_Gkhg") .setSecret("nDq-bQ3CT92PqCIXNtQyCQ") .build(); PartialPushPayload partialPushPayload = PartialPushPayload.newBuilder() .setNotification(Notification.newBuilder() .setAlert("Hello {{FIRST_NAME}} {{LAST_NAME}}, this is a test!") .build() ) .build(); TemplateRequest request = TemplateRequest.newRequest("template-id-123") .setPush(partialPushPayload); try { Response<TemplateResponse> response = client.execute(request); } catch (RuntimeException e) { ClientException ex = (ClientException) e.getCause().getCause(); Assert.assertEquals(400, ex.getStatusCode()); Assert.assertEquals("\"id\" must be a valid GUID", ex.getError().get().getError()); throw e; } }
Source:
<code>public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { if(showBindings) return super.decorateLogger(build, logger); Map<String,String> overrides = new HashMap<String,String>(); <START> List<MultiBinding.Unbinder> unbinders = new ArrayList<MultiBinding.Unbinder>(); <END> for (MultiBinding<?> binding : bindings) { MultiBinding.MultiEnvironment environment = binding.bind(build, build.getWorkspace(), null, null); unbinders.add(environment.getUnbinder()); overrides.putAll(environment.getValues()); } return new BindingStep.Filter(overrides.values()).decorateLogger(build, logger); }</code><technical_language>collecting these? result is unused</technical_language>

Target:
public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { if(showBindings) return super.decorateLogger(build, logger); Map<String,String> overrides = new HashMap<String,String>(); for (MultiBinding<?> binding : bindings) { MultiBinding.MultiEnvironment environment = binding.bind(build, null, null, null); for (String envKey : environment.getValues().keySet()) { if (!environment.getValues().get(envKey).isEmpty()) { overrides.put(envKey, environment.getValues().get(envKey)); } } } if (!overrides.isEmpty()) { return new BindingStep.Filter(overrides.values()).decorateLogger(build, logger); } else { return logger; } }
Source:
<code>public void saveSettings() { super.saveSettings(); final Map<String, String> params = serializeDotComParams(); if (params == null || params.isEmpty()) return; WordPress.getRestClientUtils().setGeneralSiteSettings( String.valueOf(mBlog.getRemoteBlogId()), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Site Settings saved remotely"); notifySavedOnUiThread(null); mRemoteSettings.copyFrom(mSettings); if (response != null) { <START> JSONObject updated = response.optJSONObject("updated"); <END> if (updated == null) return; HashMap<String, Object> properties = new HashMap<>(); Iterator<String> keys = updated.keys(); while (keys.hasNext()) { String currentKey = keys.next(); Object currentValue = updated.opt(currentKey); if (currentValue != null) { properties.put("item_saved_" + currentKey, currentValue); } } AnalyticsUtils.trackWithCurrentBlogDetails( AnalyticsTracker.Stat.SITE_SETTINGS_SAVED_REMOTELY, properties); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error POSTing site settings changes: " + error); notifySavedOnUiThread(error); } }, params); }</code><technical_language>hard-coded string</technical_language>

Target:
public void saveSettings() { super.saveSettings(); final Map<String, String> params = serializeDotComParams(); if (params == null || params.isEmpty()) return; WordPress.getRestClientUtils().setGeneralSiteSettings( String.valueOf(mBlog.getRemoteBlogId()), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Site Settings saved remotely"); notifySavedOnUiThread(null); mRemoteSettings.copyFrom(mSettings); if (response != null) { JSONObject updated = response.optJSONObject(UPDATED_KEY); if (updated == null) return; HashMap<String, Object> properties = new HashMap<>(); Iterator<String> keys = updated.keys(); while (keys.hasNext()) { String currentKey = keys.next(); Object currentValue = updated.opt(currentKey); if (currentValue != null) { properties.put(SAVED_ITEM_PREFIX + currentKey, currentValue); } } AnalyticsUtils.trackWithCurrentBlogDetails( AnalyticsTracker.Stat.SITE_SETTINGS_SAVED_REMOTELY, properties); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error POSTing site settings changes: " + error); notifySavedOnUiThread(error); } }, params); }
Source:
<code>private static Map<String, String> getCompressionOptions(Optional<TableMetadata> tableMetadata) { Map<String, String> compressionOptions = Maps.newHashMap(); compressionOptions.put( CassandraConstants.CFDEF_COMPRESSION_TYPE_KEY, CassandraConstants.DEFAULT_COMPRESSION_TYPE); int explicitCompressionBlockSizeKb = tableMetadata.map(TableMetadata::getExplicitCompressionBlockSizeKB) .orElse(0); int actualCompressionBlockSizeKb = explicitCompressionBlockSizeKb == 0 ? AtlasDbConstants.MINIMUM_COMPRESSION_BLOCK_SIZE_KB : explicitCompressionBlockSizeKb; compressionOptions.put(CassandraConstants.CFDEF_COMPRESSION_CHUNK_LENGTH_KEY, Integer.toString(actualCompressionBlockSizeKb)); <START> return compressionOptions; <END> }</code><technical_language>put map building code together? e.g. java int explicitCompressionBlockSizeKb = tableMetadata.map(TableMetadata::getExplicitCompressionBlockSizeKB) .orElse(0); int actualCompressionBlockSizeKb = explicitCompressionBlockSizeKb == 0 ? AtlasDbConstants.MINIMUM_COMPRESSION_BLOCK_SIZE_KB : explicitCompressionBlockSizeKb; return ImmutableMap.<String, String>builder() .put(CassandraConstants.CFDEF_COMPRESSION_TYPE_KEY, CassandraConstants.DEFAULT_COMPRESSION_TYPE) .put(CassandraConstants.CFDEF_COMPRESSION_CHUNK_LENGTH_KEY, Integer.toString(actualCompressionBlockSizeKb)) .build();</technical_language>

Target:
private static Map<String, String> getCompressionOptions(Optional<TableMetadata> tableMetadata) { int explicitCompressionBlockSizeKb = tableMetadata.map(TableMetadata::getExplicitCompressionBlockSizeKB) .orElse(0); int actualCompressionBlockSizeKb = explicitCompressionBlockSizeKb == 0 ? AtlasDbConstants.MINIMUM_COMPRESSION_BLOCK_SIZE_KB : explicitCompressionBlockSizeKb; return ImmutableMap.<String, String>builder() .put(CassandraConstants.CFDEF_COMPRESSION_TYPE_KEY, CassandraConstants.DEFAULT_COMPRESSION_TYPE) .put(CassandraConstants.CFDEF_COMPRESSION_CHUNK_LENGTH_KEY, Integer.toString(actualCompressionBlockSizeKb)) .build(); }
Source:
<code>public IRemoteDiceServer newDiceServer() { return PropertiesDiceRoller.builder() <START> .diceRollerUri(ClientSetting.diceRollerUri.getValueOrThrow()) <END> .gameId(gameId.getText()) .toAddress(toAddress.getText()) .ccAddress(ccAddress.getText()) .build(); }</code><technical_language>Correct if wrong, this basically dice server choice independent game a user preference agreement 2 players playing PbF/PbEM, right</technical_language>

Target:
public IRemoteDiceServer newDiceServer() { return MartiDiceRoller.builder() .diceRollerUri(ClientSetting.diceRollerUri.getValueOrThrow()) .gameId(gameId.getText()) .toAddress(toAddress.getText()) .ccAddress(ccAddress.getText()) .build(); }
Source:
<code>public Optional<Encoder<RowData>> createEncoder(WriterContext context) { <START> TableSchema nonPartKeySchema = new TableSchema.Builder() <END> .fields(context.getFieldNamesWithoutPartKeys(), context.getFieldTypesWithoutPartKeys()) .build(); LogicalType[] logicalTypes = Arrays.asList(nonPartKeySchema.getFieldDataTypes()) .stream().map(DataType::getLogicalType).toArray(LogicalType[]::new); RowType nonPartRowType = RowType.of(logicalTypes, nonPartKeySchema.getFieldNames()); return Optional.of(new JsonRowDataEncoder(new JsonRowDataSerializationSchema(nonPartRowType))); }</code><technical_language>need a table schema, Just: LogicalType[] logicalTypes = Arrays.stream(context.getFieldTypesWithoutPartKeys()) .map(DataType::getLogicalType) .toArray(LogicalType[]::new); RowType nonPartRowType = RowType.of(logicalTypes, context.getFieldNamesWithoutPartKeys()); please add a method WriterContext. reuse this in csv</technical_language>

Target:
public Optional<Encoder<RowData>> createEncoder(WriterContext context) { return Optional.of(new JsonRowDataEncoder(new JsonRowDataSerializationSchema(context.getFormatRowType()))); }
Source:
<code>public void enqueueTask(NotificationContext changeContext) throws Exception { <START> if (_periodicTriggerExecutor != null) { <END> _lastInvokeTime = System.currentTimeMillis(); } if (_batchModeEnabled && changeContext.getType() == NotificationContext.Type.CALLBACK) { logger.debug("Enqueuing callback"); if (!isReady()) { logger.info("CallbackHandler is not ready, ignore change callback from path: {}, for " + "listener: {}", _path, _listener); } else { synchronized (this) { if (_batchCallbackProcessor != null) { _batchCallbackProcessor.queueEvent(changeContext.getType(), changeContext); } else { throw new HelixException( "Failed to process callback in batch mode. Batch Callback Processor does not exist."); } } } } else { invoke(changeContext); } if (_monitor != null) { _monitor.increaseCallbackUnbatchedCounters(); } }</code><technical_language>This check is longer valid. interval a boolean (_periodicTriggerEnabled) is clearer</technical_language>

Target:
public void enqueueTask(NotificationContext changeContext) throws Exception { if (_periodicTriggerEnabled) { _lastInvokeTime = System.currentTimeMillis(); } if (_batchModeEnabled && changeContext.getType() == NotificationContext.Type.CALLBACK) { logger.debug("Enqueuing callback"); if (!isReady()) { logger.info("CallbackHandler is not ready, ignore change callback from path: {}, for " + "listener: {}", _path, _listener); } else { synchronized (this) { if (_batchCallbackProcessor != null) { _batchCallbackProcessor.queueEvent(changeContext.getType(), changeContext); } else { throw new HelixException( "Failed to process callback in batch mode. Batch Callback Processor does not exist."); } } } } else { invoke(changeContext); } if (_monitor != null) { _monitor.increaseCallbackUnbatchedCounters(); } }
Source:
<code>public static void startServer() throws Exception { XmlConfiguration configuration = new XmlConfiguration( new File("../raox/ru.bmstu.rk9.rao.thinclient/jetty/jetty.xml").toURI().toURL()); configuration.configure(server); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[] { "index.html" }); resourceHandler.setResourceBase("../raox/ru.bmstu.rk9.rao.thinclient/jetty/."); ContextHandler currentTimeContext = createHandler(new CurrentTime(), "/currentTime"); ContextHandler pingContext = createHandler(new Ping(), "/ping"); <START> ContextHandler modelsContext = createHandler(new Models(), "/models"); <END> HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[] { currentTimeContext, pingContext, modelsContext, resourceHandler }); server.setHandler(handlers); server.start(); }</code><technical_language>~~models_names~~</technical_language>

Target:
public static void startServer() throws Exception { XmlConfiguration configuration = new XmlConfiguration( new File("../raox/ru.bmstu.rk9.rao.thinclient/jetty/jetty.xml").toURI().toURL()); configuration.configure(server); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[] { "index.html" }); resourceHandler.setResourceBase("../raox/ru.bmstu.rk9.rao.thinclient/jetty/."); ContextHandler currentTimeContext = createHandler(new CurrentTime(), "/currentTime"); ContextHandler pingContext = createHandler(new Ping(), "/ping"); ContextHandler modelsContext = createHandler(new Models(), "/models"); ContextHandler modelResultsContext = createHandler(new ModelResults(), "/modelResults"); HandlerList handlers = new HandlerList(); handlers.setHandlers( new Handler[] { currentTimeContext, pingContext, modelsContext, modelResultsContext, resourceHandler }); server.setHandler(handlers); server.start(); }
Source:
<code>public CheServiceBuildContextImpl(CheServiceBuildContextImpl buildContext) { this.context = buildContext.getContext(); this.dockerfilePath = buildContext.getDockerfilePath(); this.dockerfileContent = buildContext.getDockerfileContent(); <START> this.args = buildContext.getArgs(); <END> }</code><technical_language>another constructor - copying of map is missing</technical_language>

Target:
public CheServiceBuildContextImpl(CheServiceBuildContextImpl buildContext) { this(buildContext.getContext(), buildContext.getDockerfilePath(), buildContext.getDockerfileContent(), buildContext.getArgs()); }
Source:
<code>public Image getImage(Object element) { if (element instanceof IFile) { <START> if (((IFile) element).exists()) { <END> return PlatformUI.getWorkbench().getSharedImages() .getImage(ISharedImages.IMG_OBJ_FILE); } return removedImage; } else if (element instanceof ResourceNode) { IResource resource = ((ResourceNode) element).getResource(); if (resource.getType() == IResource.PROJECT) { return PlatformUI.getWorkbench().getSharedImages() .getImage(IDE.SharedImages.IMG_OBJ_PROJECT); } return PlatformUI.getWorkbench().getSharedImages() .getImage(ISharedImages.IMG_OBJ_FOLDER); } else if (element instanceof Repository) { return repositoryImage; } else if (element instanceof StagedNode) { return stagedImage; } else if (element instanceof ModifiedNode) { return modifiedImage; } else if (element instanceof UntrackedNode) { return untrackedImage; } return null; }</code><technical_language>style nit: braces, more occurrences</technical_language>

Target:
public Image getImage(Object element) { if (element instanceof IFile) { if (((IFile) element).exists()) return PlatformUI.getWorkbench().getSharedImages() .getImage(ISharedImages.IMG_OBJ_FILE); return removedImage; } else if (element instanceof ResourceNode) { IResource resource = ((ResourceNode) element).getResource(); if (resource.getType() == IResource.PROJECT) return PlatformUI.getWorkbench().getSharedImages() .getImage(IDE.SharedImages.IMG_OBJ_PROJECT); return PlatformUI.getWorkbench().getSharedImages() .getImage(ISharedImages.IMG_OBJ_FOLDER); } else if (element instanceof Repository) return repositoryImage; else if (element instanceof StagedNode) return stagedImage; else if (element instanceof ModifiedNode) return modifiedImage; else if (element instanceof UntrackedNode) return untrackedImage; return null; }
Source:
<code>private TransitRegionStateProcedure forceCreateUnssignProcedure(RegionStateNode regionNode) { regionNode.lock(); try { if (!regionStates.include(regionNode, false) || regionStates.isRegionOffline(regionNode.getRegionInfo())) { return null; } <START> if (regionNode.getProcedure() != null) { <END> regionNode.unsetProcedure(regionNode.getProcedure()); } TransitRegionStateProcedure proc = TransitRegionStateProcedure .unassign(getProcedureEnvironment(), regionNode.getRegionInfo()); regionNode.setProcedure(proc); return proc; } finally { regionNode.unlock(); } }</code><technical_language>I remember this worked. is a technique stop current procedure regionNode running? is procedure is regionNode? Is put in place? expected? a random procedure running? I remember this part of code</technical_language>

Target:
private TransitRegionStateProcedure forceCreateUnssignProcedure(RegionStateNode regionNode) { regionNode.lock(); try { if (!regionStates.include(regionNode, false) || regionStates.isRegionOffline(regionNode.getRegionInfo())) { return null; } if (regionNode.getProcedure() != null) { regionNode.unsetProcedure(regionNode.getProcedure()); } return regionNode.setProcedure(TransitRegionStateProcedure.unassign(getProcedureEnvironment(), regionNode.getRegionInfo())); } finally { regionNode.unlock(); } }
Source:
<code>public ConditionalUniqueColumnCombination(ColumnCombination columnCombination, List<ColumnCondition> columnConditions) { <START> this(); <END> this.columnCombination = columnCombination; for (ColumnCondition columnCondition : columnConditions) { this.conditionList.add(columnCondition); } }</code><technical_language>Constructors call other</technical_language>

Target:
public ConditionalUniqueColumnCombination(ColumnCombination columnCombination, List<ColumnCondition> columnConditions) { this(columnCombination, columnConditions.toArray(new ColumnCondition[columnConditions.size()])); }
Source:
<code>public boolean isValid() { boolean result = conf.size() == ConfigurationKey.values().length; if (!result) { <START> logger.error("Invalid Compiler configuration"); <END> } return result; }</code><technical_language>need more details is invalid configuration (e.g. keys missing)</technical_language>

Target:
public boolean isValid() { boolean result = conf.keySet().containsAll(EnumSet.allOf(ConfigurationKey.class)); if (!result) { logger.error("Invalid Compiler configuration"); } return result; }
Source:
<code>private ActionResult handleRequestWithEmailAndCourse() throws EntityDoesNotExistException { String email; String courseId; try { email = getStudentEmailFromRequest(); courseId = getCourseIdFromRequest(); } catch (InvalidParametersException e) { <START> throw new EntityDoesNotExistException(e.getMessage()); END> } log.info("email: " + email + ", course: " + courseId); StudentAttributes student = getStudentForGivenParameters(courseId, email); gateKeeper.verifyAccessibleForCurrentUserAsInstructorOrTeamMember(account, courseId, student.section, email); return createImageResult(getPictureKeyForStudent(student)); }</code><technical_language>Is this a EntityDoesNotExistException? a log message instead/as well</technical_language>

Target:
private ActionResult handleRequestWithEmailAndCourse() throws EntityDoesNotExistException { String email; String courseId; try { email = getStudentEmailFromRequest(); courseId = getCourseIdFromRequest(); } catch (InvalidParametersException e) { log.warning("Attempting to decrypt malformed ciphertext when retrieving email or course id from request."); throw new EntityDoesNotExistException(e); } log.info("email: " + email + ", course: " + courseId); StudentAttributes student = getStudentForGivenParameters(courseId, email); gateKeeper.verifyAccessibleForCurrentUserAsInstructorOrTeamMember(account, courseId, student.section, email); return createImageResult(getPictureKeyForStudent(student)); }
Source:
<code>private AmbariConfig ambariConfigFromHostgroups() { AmbariConfig config = new AmbariConfig(); <START> for (Entity entity : getChildren()) { <END> if (entity instanceof AmbariHostGroup) { Collection<Entity> children = entity.getAttribute(AmbariHostGroup.AMBARI_AGENTS).getChildren(); config.add( entity.getDisplayName(), getHostFQDNs(children), entity.getConfig(AmbariHostGroup.HADOOP_COMPONENTS) ); } } return config; }</code><technical_language>express for/if Entities.descendents(this, AmbariHostGroup.class)</technical_language>

Target:
private AmbariConfig ambariConfigFromHostgroups() { AmbariConfig config = new AmbariConfig(); for (AmbariHostGroup hostGroup : getHostGroups()) { config.add( hostGroup.getDisplayName(), hostGroup.getHostFQDNs(), hostGroup.getConfig(AmbariHostGroup.HADOOP_COMPONENTS) ); } return config; }
Source:
<code>public byte[] getCacheKey() { try { <START> final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); <END> outputStream.write(HavingSpecUtil.CACHE_TYPE_ID_GREATER_THAN); if (!Strings.isNullOrEmpty(aggregationName)) { outputStream.write(StringUtils.toUtf8(aggregationName)); } outputStream.write(HavingSpecUtil.STRING_SEPARATOR); outputStream.write(StringUtils.toUtf8(String.valueOf(value))); if (aggregators == null) { return outputStream.toByteArray(); } for (Map.Entry<String, AggregatorFactory> entry : aggregators.entrySet()) { final String key = entry.getKey(); final AggregatorFactory val = entry.getValue(); if (!Strings.isNullOrEmpty(key)) { outputStream.write(StringUtils.toUtf8(key)); } outputStream.write(HavingSpecUtil.STRING_SEPARATOR); byte[] aggregatorBytes = val.getCacheKey(); outputStream.write(aggregatorBytes); } return outputStream.toByteArray(); } catch (IOException ex) { throw new RuntimeException(ex); } }</code><technical_language>CacheKeyBuilder work for this (and similar method)</technical_language>

Target:
public byte[] getCacheKey() { return new CacheKeyBuilder(HavingSpecUtil.CACHE_TYPE_ID_GREATER_THAN) .appendString(aggregationName) .appendByteArray(StringUtils.toUtf8(String.valueOf(value))) .build(); }
Source:
<code>public void testUnderscoreBucket() throws Exception { Configuration config = new Configuration(); config.setBoolean(S3_PATH_STYLE_ACCESS, true); try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); fs.initialize(new URI("s3n://test-bucket_underscore/"), config); fs.setS3Client(s3); ObjectMetadata objectMetadata = fs.getS3ObjectMetadata(new Path("/test/path")); <START> assertEquals(null, objectMetadata); <END> } }</code><technical_language>this test case? fs.getS3ObjectMetatada return null (looking MockAmazonS3 class). this test fail code changes</technical_language>

Target:
public void testUnderscoreBucket() throws Exception { Configuration config = new Configuration(); config.setBoolean(S3_PATH_STYLE_ACCESS, true); try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); String expectedBucketName = "test-bucket_underscore"; fs.initialize(new URI("s3n://" + expectedBucketName + "/"), config); fs.setS3Client(s3); fs.getS3ObjectMetadata(new Path("/test/path")); assertEquals(expectedBucketName, s3.getGetObjectMetadataRequest().getBucketName()); } }
Source:
<code>void testGetterTypedAggregateIdentifier() { assertThrows( AxonConfigurationException.class, <START> () -> AnnotatedAggregateMetaModelFactory.inspectAggregate(TypedIdentifierAggregate.class)); <END> }</code><technical_language>GetterTypedIdentifierAggregate for this test instead of TypedIdentifierAggregate</technical_language>

Target:
void testGetterTypedAggregateIdentifier() { assertThrows( AxonConfigurationException.class, () -> AnnotatedAggregateMetaModelFactory.inspectAggregate(GetterTypedIdentifierAggregate.class) ); }
Source:
<code>public void onSplashPotion(PotionSplashEvent event) { for(PotionEffect effect : event.getPotion().getEffects()) { if (effect.getType() == INVISIBILITY) { Entity e = event.getEntity(); if (e instanceof Player) { Player player = (Player) e; playerMsg(player, "You are not permitted to use splash invisibility potions!", ChatColor.RED); event.setCancelled(true); } } if (effect.getType() == HEAL) { Entity e = event.getEntity(); if (e instanceof Player) { Player player = (Player) e; playerMsg(player, "You are not permitted to use Instant Death potions!", ChatColor.RED); event.setCancelled(true); } } if (effect.getType() == HEALTH_BOOST) { Entity e = event.getEntity(); if (e instanceof Player) { Player player = (Player) e; playerMsg(player, "You are not permitted to use Death potions!", ChatColor.RED); event.setCancelled(true); } } <START> <END> } }</code><technical_language>Blank here, there, shouldnt be</technical_language>

Target:
public void onSplashPotion(PotionSplashEvent event) { for(PotionEffect effect : event.getPotion().getEffects()) { if (effect.getType() == INVISIBILITY) { Entity i = event.getEntity(); if (i instanceof Player) { Player player = (Player) i; playerMsg(player, "You are not permitted to use splash invisibility potions!", ChatColor.RED); event.setCancelled(true); } } if (effect.getType() == HEAL) { Entity d = event.getEntity(); if (d instanceof Player) { Player player = (Player) d; playerMsg(player, "You are not permitted to use Instant Death potions!", ChatColor.RED); event.setCancelled(true); } } if (effect.getType() == HEALTH_BOOST) { Entity d = event.getEntity(); if (d instanceof Player) { Player player = (Player) d; playerMsg(player, "You are not permitted to use Death potions!", ChatColor.RED); event.setCancelled(true); } } } }
Source:
<code>protected String explainPlanForNode(String indent) { if (m_highVolume) { assert(m_parents.size() == 0); return "WRITE RESULTS TO DISK"; } else { if (m_parents.size() == 0) return "RETURN RESULTS TO STORED PROCEDURE"; else return "SEND PARTITION RESULTS TO COORDINATOR"; <START> } <END> }</code><technical_language>Please else a return</technical_language>

Target:
protected String explainPlanForNode(String indent) { String explanation = ""; if (m_highVolume) { assert(m_parents.size() == 0); explanation = "WRITE RESULTS TO DISK"; } else { if (m_parents.size() == 0) { explanation = "RETURN RESULTS TO STORED PROCEDURE"; } else { explanation = "SEND PARTITION RESULTS TO COORDINATOR"; } } return explanation; }
Source:
<code>public Boolean dataStreamExists(PID pid, String dsID) { UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(this.getFedoraContextUrl()); builder.pathSegment("objects"); builder.pathSegment(pid.getPid()); builder.pathSegment("datastreams"); builder.pathSegment(dsID); HttpHead method = new HttpHead(builder.build().encode().toUriString()); try (CloseableHttpResponse httpResp = httpClient.execute(method)) { int statusCode = httpResp.getStatusLine().getStatusCode(); if (statusCode == 200) { return true; } return false; <START> } catch (Exception e) { <END> return false; } }</code><technical_language>Do want log exceptions get thrown execute() fails</technical_language>

Target:
public Boolean dataStreamExists(PID pid, String dsID) { UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(this.getFedoraContextUrl()); builder.pathSegment("objects"); builder.pathSegment(pid.getPid()); builder.pathSegment("datastreams"); builder.pathSegment(dsID); builder.pathSegment("content"); HttpHead method = new HttpHead(builder.build().encode().toUriString()); try (CloseableHttpResponse httpResp = httpClient.execute(method)) { int statusCode = httpResp.getStatusLine().getStatusCode(); if (statusCode == 200) { return true; } return false; } catch (Exception e) { log.debug("HEAD request could not be completed", e); return false; } }
Source:
<code>public void setDataNodeId(ClusterMap clusterMap, String hostname, int port, boolean enableVerboseLogging) { <START> if (partitionId == null) { <END> throw new IllegalStateException("Partition must be defined before setting data node id"); } dataNodeId = clusterMap.getDataNodeId(hostname, port); if (dataNodeId == null) { throw new IllegalArgumentException("Node at " + hostname + ":" + port + " not found"); } boolean inPartition = false; for (ReplicaId replicaId : partitionId.getReplicaIds()) { if (replicaId.getDataNodeId().equals(dataNodeId)) { inPartition = true; break; } } if (!inPartition) { throw new IllegalArgumentException("Node at " + hostname + ":" + port + " not in partition"); } if (enableVerboseLogging) { System.out.println("Chosen node " + dataNodeId); } }</code><technical_language>I this check is unnecessary. checks ensure partitionId is non-null this call is made</technical_language>

Target:
private void setDataNodeId(ClusterMap clusterMap, String hostname, int port, boolean enableVerboseLogging) { dataNodeId = clusterMap.getDataNodeId(hostname, port); if (dataNodeId == null) { throw new IllegalArgumentException("Node at " + hostname + ":" + port + " not found"); } boolean inPartition = false; for (ReplicaId replicaId : partitionId.getReplicaIds()) { if (replicaId.getDataNodeId().equals(dataNodeId)) { inPartition = true; break; } } if (!inPartition) { throw new IllegalArgumentException("Node at " + hostname + ":" + port + " not in partition " + partitionId); } if (enableVerboseLogging) { System.out.println("Chosen node " + dataNodeId); } }
Source:
<code>private void removeUnusedImages() { Set<Guid> imageIdsUsedByActiveSnapshot = new HashSet<>(); for (DiskImage diskImage : getImagesList()) { imageIdsUsedByActiveSnapshot.add(diskImage.getId()); } List<DiskImage> imagesToRemove = new ArrayList<>(); for (Guid snapshotToRemove : snapshotsToRemove) { List<DiskImage> snapshotDiskImages = getDiskImageDao().getAllSnapshotsForVmSnapshot(snapshotToRemove); imagesToRemove.addAll(snapshotDiskImages); } Set<Guid> removeInProcessImageIds = new HashSet<>(); for (DiskImage diskImage : imagesToRemove) { if (imageIdsUsedByActiveSnapshot.contains(diskImage.getId()) || removeInProcessImageIds.contains(diskImage.getId())) { continue; } VdcReturnValueBase retValue = runAsyncTask(VdcActionType.RemoveImage, new RemoveImageParameters(diskImage.getImageId())); if (retValue.getSucceeded()) { removeInProcessImageIds.add(diskImage.getImageId()); } else { <START> log.error("Failed to remove image <{}>", diskImage.getImageId()); <END> } } }</code><technical_language>'{}'</technical_language>

Target:
private void removeUnusedImages() { Set<Guid> imageIdsUsedByActiveSnapshot = new HashSet<>(); for (DiskImage diskImage : getImagesList()) { imageIdsUsedByActiveSnapshot.add(diskImage.getId()); } List<DiskImage> imagesToRemove = new ArrayList<>(); for (Guid snapshotToRemove : snapshotsToRemove) { List<DiskImage> snapshotDiskImages = getDiskImageDao().getAllSnapshotsForVmSnapshot(snapshotToRemove); imagesToRemove.addAll(snapshotDiskImages); } Set<Guid> removeInProcessImageIds = new HashSet<>(); for (DiskImage diskImage : imagesToRemove) { if (imageIdsUsedByActiveSnapshot.contains(diskImage.getId()) || removeInProcessImageIds.contains(diskImage.getId())) { continue; } VdcReturnValueBase retValue = runAsyncTask(VdcActionType.RemoveImage, new RemoveImageParameters(diskImage.getImageId())); if (retValue.getSucceeded()) { removeInProcessImageIds.add(diskImage.getImageId()); } else { log.error("Failed to remove image '{}'", diskImage.getImageId()); } } }
Source:
<code><START> T tupleConvertFilter(List<String> input, Set<String> fields, T result) { <END> if (input == null) { return result; } for (int i = 1; i < input.size(); i += 2) { if (fields == null || fields.contains(input.get(i))) { result.put(input.get(i), new StringByteIterator(input.get(i + 1))); } } return result; }</code><technical_language>introduce out parameter here</technical_language>

Target:
void tupleConvertFilter(List<String> input, Set<String> fields, T result) { if (input == null) { return; } for (int i = 1; i < input.size(); i += 2) { if (fields == null || fields.contains(input.get(i))) { result.put(input.get(i), new StringByteIterator(input.get(i + 1))); } } }
Source:
<code>public void open(TestWorkspace testWorkspace) throws Exception { URL workspaceUrl = testWorkspaceUrlResolver.resolve(testWorkspace); seleniumWebDriver.get(workspaceUrl.toString()); entrance.login(testWorkspace.getOwner()); try { <START> projectExplorer.waitProjectExplorer(60); <END> } catch (TimeoutException ex) { browserLogsUtil.appendBrowserLogs(); fail("Known issue <LINK_0>", ex); } }</code><technical_language>timeout constant here</technical_language>

Target:
public void open(TestWorkspace testWorkspace) throws Exception { URL workspaceUrl = testWorkspaceUrlResolver.resolve(testWorkspace); seleniumWebDriver.get(workspaceUrl.toString()); entrance.login(testWorkspace.getOwner()); }
Source:
<code>public Object perform(InvocationContext ctx) throws Throwable { Map<Object, Object> previousValues = new HashMap<>(); for (Entry<Object, Object> e : map.entrySet()) { Object key = e.getKey(); <START> Object newValue = e.getValue(); <END> MVCCEntry contextEntry = lookupMvccEntry(ctx, key); if (contextEntry != null) { Object previousValue = contextEntry.getValue(); previousValues.put(key, previousValue); Metadata previousMetadata = contextEntry.getMetadata(); if (contextEntry.isCreated()) { notifier.notifyCacheEntryCreated(key, newValue, metadata, true, ctx, this); } notifier.notifyCacheEntryModified(key, newValue, metadata, previousValue, previousMetadata, true, ctx, this); contextEntry.setValue(newValue); updateMetadata(contextEntry, metadata); contextEntry.setChanged(true); } } return previousValues; }</code><technical_language>do this in if well</technical_language>

Target:
public Object perform(InvocationContext ctx) throws Throwable { Map<Object, Object> previousValues = new HashMap<>(); for (Entry<Object, Object> e : map.entrySet()) { Object key = e.getKey(); MVCCEntry contextEntry = lookupMvccEntry(ctx, key); if (contextEntry != null) { Object newValue = e.getValue(); Object previousValue = contextEntry.getValue(); Metadata previousMetadata = contextEntry.getMetadata(); previousValues.put(key, previousValue); if (contextEntry.isCreated()) { notifier.notifyCacheEntryCreated(key, newValue, metadata, true, ctx, this); } notifier.notifyCacheEntryModified(key, newValue, metadata, previousValue, previousMetadata, true, ctx, this); contextEntry.setValue(newValue); Metadatas.updateMetadata(contextEntry, metadata); contextEntry.setChanged(true); } } return previousValues; }
Source:
<code>public WorldBorder build() throws IllegalStateException { <START> checkNotNull(this.centre, "A centre needs to be specified"); <END> net.minecraft.world.border.WorldBorder border = new net.minecraft.world.border.WorldBorder(); border.setCenter(this.centre.getX(), this.centre.getZ()); border.setDamageAmount(this.damageAmount); border.setDamageBuffer(this.damageThreshold); border.setTransition(this.diameter); border.setWarningDistance(this.warningDistance); border.setWarningTime(this.warningTime); return (WorldBorder) border; }</code><technical_language>checkState(this.centre != null, "A centre needs specified");</technical_language>

Target:
public WorldBorder build() throws IllegalStateException { net.minecraft.world.border.WorldBorder border = new net.minecraft.world.border.WorldBorder(); border.setCenter(this.center.getX(), this.center.getZ()); border.setDamageAmount(this.damageAmount); border.setDamageBuffer(this.damageThreshold); border.setTransition(this.diameter); border.setWarningDistance(this.warningDistance); border.setWarningTime(this.warningTime); return (WorldBorder) border; }
Source:
<code>public GdbConsoleTerminateLaunchAction(ILaunch launch) { fLaunch = launch; setText(ConsoleMessages.ConsoleTerminateLaunchAction_name); setToolTipText(ConsoleMessages.ConsoleTerminateLaunchAction_description); setImageDescriptor(GdbUIPlugin.getImageDescriptor(IConsoleImagesConst.IMG_CONSOLE_TERMINATE_ACTIVE_COLOR)); setDisabledImageDescriptor(GdbUIPlugin.getImageDescriptor(IConsoleImagesConst.IMG_CONSOLE_TERMINATE_DISABLED_COLOR)); <START> DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); <END> }</code><technical_language>I a race here. launch technically terminated. fLaunch.isTerminated() if disable action</technical_language>

Target:
public GdbConsoleTerminateLaunchAction(ILaunch launch) { fLaunch = launch; setText(ConsoleMessages.ConsoleTerminateLaunchAction_name); setToolTipText(ConsoleMessages.ConsoleTerminateLaunchAction_description); setImageDescriptor(GdbUIPlugin.getImageDescriptor(IConsoleImagesConst.IMG_CONSOLE_TERMINATE_ACTIVE_COLOR)); setDisabledImageDescriptor(GdbUIPlugin.getImageDescriptor(IConsoleImagesConst.IMG_CONSOLE_TERMINATE_DISABLED_COLOR)); if (fLaunch.isTerminated()) { setEnabled(false); } else { DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); } }
Source:
<code>public void initialize(ServerConfiguration conf, LedgerManager ledgerManager, LedgerDirsManager ledgerDirsManager, LedgerDirsManager indexDirsManager, StateManager stateManager, CheckpointSource checkpointSource, Checkpointer checkpointer, StatsLogger statsLogger) throws IOException { super.initialize( conf, ledgerManager, ledgerDirsManager, indexDirsManager, stateManager, checkpointSource, checkpointer, statsLogger); this.memTable = new EntryMemTable(conf, checkpointSource, statsLogger); this.scheduler = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() .setNameFormat("SortedLedgerStorage-%d") .setPriority((Thread.NORM_PRIORITY + Thread.MAX_PRIORITY) / 2).build()); this.stateManager = stateManager; <START> this.isTransactionalCompactionEnabled = conf.getUseTransactionalCompaction(); <END> }</code><technical_language>Separate change, in this patch</technical_language>

Target:
public void initialize(ServerConfiguration conf, LedgerManager ledgerManager, LedgerDirsManager ledgerDirsManager, LedgerDirsManager indexDirsManager, StateManager stateManager, CheckpointSource checkpointSource, Checkpointer checkpointer, StatsLogger statsLogger) throws IOException { super.initialize( conf, ledgerManager, ledgerDirsManager, indexDirsManager, stateManager, checkpointSource, checkpointer, statsLogger); this.memTable = new EntryMemTable(conf, checkpointSource, statsLogger); this.scheduler = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() .setNameFormat("SortedLedgerStorage-%d") .setPriority((Thread.NORM_PRIORITY + Thread.MAX_PRIORITY) / 2).build()); this.stateManager = stateManager; }
Source:
<code>public List<TaskRequest> lockSharedAgentTasks(int count, String agentId, int lockSeconds, long maxSleepMillis) { for (int siteId : autoCommit((handle, dao) -> dao.getActiveSiteIdList())) { List<Long> taskLockIds = tryLockSharedAgentTasks(siteId, count, agentId, lockSeconds); if (!taskLockIds.isEmpty()) { ImmutableList.Builder<TaskRequest> builder = ImmutableList.builder(); for (long taskLockId : taskLockIds) { byte[] data = autoCommit((handle, dao) -> dao.getTaskData(taskLockId)); if (data == null) { } else { String lockId = formatSharedTaskLockId(taskLockId); builder.add(decodeLockedTaskObject(data, lockId)); } } <START> return builder.build(); <END> } } if (maxSleepMillis >= 0) { sleepForEnqueue(maxSleepMillis); } return ImmutableList.of(); }</code><technical_language>// is 2 transactions. If happen, next site id this? List<TaskRequest> taskRequests = builder.build(); if (taskRequests.isEmpty()) { continue; } return taskRequests;</technical_language>

Target:
public List<TaskQueueLock> lockSharedAgentTasks(int count, String agentId, int lockSeconds, long maxSleepMillis) { for (int siteId : autoCommit((handle, dao) -> dao.getActiveSiteIdList())) { List<Long> taskLockIds = tryLockSharedAgentTasks(siteId, count, agentId, lockSeconds); if (!taskLockIds.isEmpty()) { ImmutableList.Builder<TaskQueueLock> builder = ImmutableList.builder(); for (long taskLockId : taskLockIds) { ImmutableTaskQueueLock data = autoCommit((handle, dao) -> dao.getTaskData(taskLockId)); if (data == null) { } else { String lockId = formatSharedTaskLockId(taskLockId); builder.add(data.withLockId(lockId)); } } return builder.build(); } } if (maxSleepMillis >= 0) { sleepForEnqueue(maxSleepMillis); } return ImmutableList.of(); }
Source:
<code>private void answer(HttpServletRequest request, Job job, List<String> jobId, Object question) throws ResourceReferenceHandlerException { try { this.beans.populate(question, extractParameters(request, question)); } catch (PropertyException e) { <START> throw new ResourceReferenceHandlerException("Failed to populate question object for job with id " + jobId); <END> } if (job.getStatus() instanceof CancelableJobStatus && Boolean.parseBoolean((String) request.getParameter(CANCEL))) { ((CancelableJobStatus) job.getStatus()).cancel(); } job.getStatus().answered(); }</code><technical_language>this is good, removed information nested exception! :)</technical_language>

Target:
private void answer(HttpServletRequest request, Job job, List<String> jobId, Object question) throws ResourceReferenceHandlerException { try { this.beans.populate(question, extractParameters(request, question)); } catch (PropertyException e) { throw new ResourceReferenceHandlerException( String.format("Failed to populate question object for job with id [%s]", jobId), e); } if (job.getStatus() instanceof CancelableJobStatus && Boolean.parseBoolean((String) request.getParameter(CANCEL))) { ((CancelableJobStatus) job.getStatus()).cancel(); } job.getStatus().answered(); }