auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void processElement(ProcessContext context) { if (converter == null) { AvroRegistry registry = new AvroRegistry(); converter = registry.createIndexedRecordConverter(context.element().getClass()); } <START> IndexedRecord inputRecord = (IndexedRecord) converter.convertToAvro(context.element()); <END> Schema schema = inputRecord.getSchema(); String columnToNormalize = properties.columnToNormalize.getValue(); String delim = properties.fieldSeparator.getValue(); boolean discardTrailingEmptyStr = properties.discardTrailingEmptyStr.getValue(); boolean trim = properties.trim.getValue(); if (!StringUtils.isEmpty(columnToNormalize)) { int indexColumnToNormalize = schema.getField(columnToNormalize).pos(); List<Object> inputValues = getInputFields(inputRecord, columnToNormalize); if (inputValues.size() == 1) { String[] strs = delimit(inputValues.get(0), delim, discardTrailingEmptyStr, trim); for (int i=0; i<strs.length; i++) { GenericRecord outputRecord = new GenericData.Record(schema); for(int j=0; j<schema.getFields().size(); j++) { if(j != indexColumnToNormalize) { outputRecord.put(j, inputRecord.get(j)); } } outputRecord.put(indexColumnToNormalize, strs[i]); context.output(outputRecord); } } } }</code><technical_language>context.element() IndexedRecord, discuss in</technical_language>

Target:
public void processElement(ProcessContext context) throws Exception { IndexedRecord inputRecord = context.element(); String columnToNormalize = properties.columnToNormalize.getValue(); boolean isList = properties.isList.getValue(); String delim = null; if (!isList) { try { NormalizeDelimiter normalizeDelimiter = NormalizeDelimiter.valueOf(properties.fieldSeparator.getValue()); delim = normalizeDelimiter.getDelimiter(); } catch (IllegalArgumentException ex) { if (NormalizeConstant.Delimiter.OTHER.equals(properties.fieldSeparator.getValue())) { delim = properties.otherSeparator.getValue(); } } } boolean isDiscardTrailingEmptyStr = properties.discardTrailingEmptyStr.getValue(); boolean isTrim = properties.trim.getValue(); if (StringUtils.isNotEmpty(columnToNormalize)) { String[] path = columnToNormalize.split("\\."); List<Object> normalizedFields = NormalizeUtils.getInputFields(inputRecord, columnToNormalize); Schema schema = NormalizeUtils.transformSchema(inputRecord.getSchema(), path, 0); if (NormalizeUtils.isSimpleField(normalizedFields)) { normalizedFields = NormalizeUtils.delimit(String.valueOf(normalizedFields.get(0)), delim, isDiscardTrailingEmptyStr, isTrim); } for (Object outputValue : normalizedFields) { GenericRecord outputRecord = NormalizeUtils.generateNormalizedRecord(context.element(), context.element().getSchema(), schema, path, 0, outputValue); context.output(outputRecord); } } }
Source:
<code>public Icu4jRules(String[] args) throws IOException { if (args.length < 3) { throw new IllegalArgumentException(COMMAND_USAGE); } Path <START> fullWhitelistedApiFile = <END> null; if ("--full-whitelisted-api".equals(args[0])) { fullWhitelistedApiFile = Paths.get(args[1]); if (args.length < 5) { throw new IllegalArgumentException(COMMAND_USAGE); } String[] newArgs = new String[args.length - 2]; System.arraycopy(args, 2, newArgs, 0, args.length - 2); args = newArgs; } String[] inputDirNames = new String[args.length - 2]; System.arraycopy(args, 0, inputDirNames, 0, args.length - 2); inputFileGenerator = Icu4jTransformRules.createInputFileGenerator(inputDirNames); Path corePlatformApiFile = Paths.get(args[args.length - 1]); rules = createTransformRules(corePlatformApiFile, fullWhitelistedApiFile); outputSourceFileGenerator = Icu4jTransformRules.createOutputFileGenerator(args[args.length - 2]); }</code><technical_language>Ack. I considered effect generated source</technical_language>

Target:
public Icu4jRules(String[] args) throws IOException { if (args.length < 3) { throw new IllegalArgumentException(COMMAND_USAGE); } Path whitelistedApiPath = null; if ("--hide-non-whitelisted-api".equals(args[0])) { whitelistedApiPath = Paths.get(args[1]); if (args.length < 5) { throw new IllegalArgumentException(COMMAND_USAGE); } String[] newArgs = new String[args.length - 2]; System.arraycopy(args, 2, newArgs, 0, args.length - 2); args = newArgs; } String[] inputDirNames = new String[args.length - 2]; System.arraycopy(args, 0, inputDirNames, 0, args.length - 2); inputFileGenerator = Icu4jTransformRules.createInputFileGenerator(inputDirNames); Path corePlatformApiFile = Paths.get(args[args.length - 1]); rules = createTransformRules(corePlatformApiFile, whitelistedApiPath); outputSourceFileGenerator = Icu4jTransformRules.createOutputFileGenerator(args[args.length - 2]); }
Source:
<code>void askTserverToRemoveWAL(HostAndPort address, AccumuloConfiguration conf, Entry<String,ArrayList<Path>> entry, final GCStatus status) { firstSeenDead.remove(address); Client tserver = null; try { tserver = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf); tserver.removeLogs(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), paths2strings(entry.getValue())); <START> log.debug("asking tserver to delete " + entry.getValue() + " from " + entry.getKey()); <END> status.currentLog.deleted += entry.getValue().size(); } catch (TException e) { log.warn("Error talking to " + address + ": " + e); } finally { if (tserver != null) ThriftUtil.returnClient(tserver); } }</code><technical_language>I asked instead of asking log message is thrift call</technical_language>

Target:
void askTserverToRemoveWAL(HostAndPort address, AccumuloConfiguration conf, Entry<String,ArrayList<Path>> entry, final GCStatus status) { firstSeenDead.remove(address); Client tserver = null; try { tserver = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf); tserver.removeLogs(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), paths2strings(entry.getValue())); log.debug("asked tserver to delete " + entry.getValue() + " from " + entry.getKey()); status.currentLog.deleted += entry.getValue().size(); } catch (TException e) { log.warn("Error talking to " + address + ": " + e); } finally { if (tserver != null) ThriftUtil.returnClient(tserver); } }
Source:
<code>public String resolve(TranscriptConsequence transcriptConsequence) throws EnsemblWebServiceException { String entrezGeneId = null; if (transcriptConsequence != null && transcriptConsequence.getGeneSymbol() != null && !transcriptConsequence.getGeneSymbol().trim().isEmpty()) { <START> entrezGeneId = this.hugoSymbolToEntrezGeneIdMap.get(transcriptConsequence.getGeneSymbol()); <END> } return entrezGeneId; }</code><technical_language>replace this with: suggestion entrezGeneId = this.ensemblService.getEntrezGeneIdByHugoSymbol(transcriptConsequence.getGeneSymbol());</technical_language>

Target:
public String resolve(TranscriptConsequence transcriptConsequence) throws EnsemblWebServiceException { String entrezGeneId = null; if (transcriptConsequence != null && transcriptConsequence.getGeneSymbol() != null && !transcriptConsequence.getGeneSymbol().trim().isEmpty()) { entrezGeneId = this.ensemblService.getEntrezGeneIdByHugoSymbol(transcriptConsequence.getGeneSymbol()); } return entrezGeneId; }
Source:
<code>public ParameterExpression(String paramName) { if (paramName == null || paramName.isEmpty()) { <START> throw new IllegalArgumentException("Parameter name cannot be null or empty"); <END> } this.paramName = paramName; }</code><technical_language>i18n</technical_language>

Target:
public ParameterExpression(String paramName) { if (paramName == null || paramName.isEmpty()) { throw log.parameterNameCannotBeNulOrEmpty(); } this.paramName = paramName; }
Source:
<code>public ProcessInstance execute(CommandContext commandContext) { if(this.internalProcessInstance.getStartTime() != null){ <START> throw new ActivitiIllegalArgumentException("Process instance "+this.internalProcessInstance.getProcessInstanceId()+ " has already been started"); <END> } ExecutionEntity processExecution = (ExecutionEntity) this.internalProcessInstance; processInstanceHelper = commandContext.getProcessEngineConfiguration().getProcessInstanceHelper(); processInstanceHelper.startProcessInstance(processExecution, commandContext, processExecution.getVariables(), processExecution.getCurrentFlowElement()); return processExecution; }</code><technical_language>Please, spaces +</technical_language>

Target:
public ProcessInstance execute(CommandContext commandContext) { if(this.internalProcessInstance.getStartTime() != null){ throw new ActivitiIllegalArgumentException("Process instance " + this.internalProcessInstance.getProcessInstanceId() + " has already been started"); } ExecutionEntity processExecution = (ExecutionEntity) this.internalProcessInstance; ProcessInstanceHelper processInstanceHelper = commandContext.getProcessEngineConfiguration().getProcessInstanceHelper(); processInstanceHelper.startProcessInstance(processExecution, commandContext, processExecution.getVariables(), processExecution.getCurrentFlowElement()); return processExecution; }
Source:
<code><START> public void addObjectsTest() throws Exception { <END> Model model = getDepositRecordModel(); DepositRecord record = repository.createDepositRecord(pid, model); Resource res1 = model.createResource(); Resource res2 = model.createResource(); List<Resource> depositedObjs = new ArrayList<>(); depositedObjs.add(res1); depositedObjs.add(res2); record.addIngestedObjects(pid, depositedObjs); assertTrue(record.listDepositedObjects().size() == 2); }</code><technical_language>This test annotated a @Test, is running</technical_language>

Target:
public void addObjectsTest() throws Exception { Model model = getDepositRecordModel(); DepositRecord record = repository.createDepositRecord(pid, model); URI obj1Uri; URI obj2Uri; try (FcrepoResponse response = client.post(URI.create(serverAddress)).perform()) { obj1Uri = response.getLocation(); } try (FcrepoResponse response = client.post(URI.create(serverAddress)).perform()) { obj2Uri = response.getLocation(); } Resource res1 = model.createResource(obj1Uri.toString()); Resource res2 = model.createResource(obj2Uri.toString()); List<Resource> depositedObjs = new ArrayList<>(); depositedObjs.add(res1); depositedObjs.add(res2); record.addIngestedObjects(pid, depositedObjs); assertTrue(record.listDepositedObjects().size() == 2); }
Source:
<code>private SlidingTimeWindowReservoir createIfAbsent(String meterNamePrefix, Tags tags, long window, TimeUnit timeUnit, Clock clock) { String key = meterNamePrefix + tags.stream() .map(tag -> tag.getKey() + tag.getValue()) .reduce(String::concat) .orElse(""); SlidingTimeWindowReservoir value; <START> if ((value = timeWindowedDurationMeasurementsMap.get(key)) == null) { <END> SlidingTimeWindowReservoir newValue = new SlidingTimeWindowReservoir(window, timeUnit, clock); timeWindowedDurationMeasurementsMap.put(key, newValue); return newValue; } return value; }</code><technical_language>If mind serves right, do a putIfAbsent timeWindowedDurationMeasurementsMap too, so: java return timeWindowedDurationMeasurementsMap.putIfAbsent(key, new SlidingTimeWindowReservoir(window, timeUnit, clock));</technical_language>

Target:
private SlidingTimeWindowReservoir createIfAbsent(String meterNamePrefix, Tags tags, long window, TimeUnit timeUnit, Clock clock) { String key = meterNamePrefix + tags.stream() .map(tag -> tag.getKey() + tag.getValue()) .reduce(String::concat) .orElse(""); timeWindowedDurationMeasurementsMap.putIfAbsent(key, new SlidingTimeWindowReservoir(window, timeUnit, clock)); return timeWindowedDurationMeasurementsMap.get(key); }
Source:
<code>private ShardSpecs determineShardSpecs( final TaskToolbox toolbox, final FirehoseFactory firehoseFactory, final File firehoseTempDir ) throws IOException { final ObjectMapper jsonMapper = toolbox.getObjectMapper(); final IndexTuningConfig tuningConfig = ingestionSchema.getTuningConfig(); final IndexIOConfig ioConfig = ingestionSchema.getIOConfig(); final GranularitySpec granularitySpec = ingestionSchema.getDataSchema().getGranularitySpec(); final boolean determineIntervals = !granularitySpec.bucketIntervals().isPresent(); <START> final boolean guaranteedRollup = tuningConfig.isForceGuaranteedRollup() && <END> !tuningConfig.isForceExtendableShardSpecs() && !ioConfig.isAppendToExisting(); final boolean determineNumPartitions = tuningConfig.getNumShards() == null && guaranteedRollup; final boolean useExtendableShardSpec = !guaranteedRollup; if (!determineNumPartitions && !determineIntervals) { log.info("Skipping determine partition scan"); return createShardSpecsWithoutDataScan(jsonMapper, granularitySpec, tuningConfig, useExtendableShardSpec); } return createShardSpecsFromData( jsonMapper, ingestionSchema, firehoseFactory, firehoseTempDir, granularitySpec, tuningConfig, determineIntervals, determineNumPartitions, useExtendableShardSpec ); }</code><technical_language>I throw exception if user sets isForceGuaranteedRollup=true applied, confusing if task succeeds notice rollup "perfect"</technical_language>

Target:
private ShardSpecs determineShardSpecs( final TaskToolbox toolbox, final FirehoseFactory firehoseFactory, final File firehoseTempDir ) throws IOException { final ObjectMapper jsonMapper = toolbox.getObjectMapper(); final IndexTuningConfig tuningConfig = ingestionSchema.getTuningConfig(); final IndexIOConfig ioConfig = ingestionSchema.getIOConfig(); final GranularitySpec granularitySpec = ingestionSchema.getDataSchema().getGranularitySpec(); final boolean determineIntervals = !granularitySpec.bucketIntervals().isPresent(); final boolean guaranteedRollup = isGuaranteedRollup(ioConfig, tuningConfig); final boolean determineNumPartitions = tuningConfig.getNumShards() == null && guaranteedRollup; final boolean useExtendableShardSpec = !guaranteedRollup; if (!determineNumPartitions && !determineIntervals) { log.info("Skipping determine partition scan"); return createShardSpecWithoutInputScan(jsonMapper, granularitySpec, tuningConfig, useExtendableShardSpec); } else { return createShardSpecsFromInput( jsonMapper, ingestionSchema, firehoseFactory, firehoseTempDir, granularitySpec, tuningConfig, determineIntervals, determineNumPartitions, useExtendableShardSpec ); } }
Source:
<code>public void testGetInvalidityInfoForSectionName_invalid_returnSpecificErrorString() { String invalidSectionName = "Percent Symbol % Section"; String actual = validator.getInvalidityInfoForSectionName(invalidSectionName); assertEquals("Invalid section name (invalid char) should return error string that is specific to section name", "\"Percent Symbol % Section\" is not acceptable to TEAMMATES as a/an section name " + "because it contains invalid characters. All section name must start with an " + "alphanumeric character, and cannot contain any vertical bar (|) or percent sign " <START> + "(%).", <END> actual); }</code><technical_language>This well</technical_language>

Target:
public void testGetInvalidityInfoForSectionName_invalid_returnSpecificErrorString() { String invalidSectionName = "Percent Symbol % Section"; String actual = validator.getInvalidityInfoForSectionName(invalidSectionName); assertEquals("Invalid section name (invalid char) should return error string that is specific to section name", "\"Percent Symbol % Section\" is not acceptable to TEAMMATES as a/an section name " + "because it contains invalid characters. All section name must start with an " + "alphanumeric character, and cannot contain any vertical bar (|) or percent sign (%).", actual); }
Source:
<code>public Object perform(InvocationContext ctx) throws Throwable { if (valueMatcher == ValueMatcher.MATCH_NEVER) { successful = false; return null; } MVCCEntry<K, V> e = (MVCCEntry<K, V>) ctx.lookupEntry(key); if (e == null) return null; if (prevValue == null && !hasFlag(Flag.COMMAND_RETRY)) { prevValue = e.getValue(); prevMetadata = e.getMetadata(); } <START> Object oldPrevValue = e.getValue(hasFlag(Flag.COMMAND_RETRY)); <END> if (valueUnchanged(oldPrevValue, prevValue, value) || valueRemoved(oldPrevValue, prevValue)) { log.tracef("Execute read-write function on previous value %s and previous metadata %s", prevValue, prevMetadata); R ret = f.apply(value, EntryViews.readWrite(e, prevValue, prevMetadata)); return snapshot(ret); } return f.apply(value, EntryViews.readWrite(e, e.getValue(), e.getMetadata())); }</code><technical_language>this work if command is retried multiple times</technical_language>

Target:
public Object perform(InvocationContext ctx) throws Throwable { if (valueMatcher == ValueMatcher.MATCH_NEVER) { successful = false; return null; } MVCCEntry<K, V> e = (MVCCEntry<K, V>) ctx.lookupEntry(key); if (e == null) return null; if (prevValue == null && !hasFlag(Flag.COMMAND_RETRY)) { prevValue = e.getValue(); prevMetadata = e.getMetadata(); } Object oldPrevValue = e.getValue(); CacheEntry<K, V> copy = e.clone(); R ret = f.apply(value, EntryViews.readWrite(copy, prevValue, prevMetadata)); if (valueMatcher.matches(oldPrevValue, prevValue, copy.getValue(), AnyEquivalence.getInstance())) { log.tracef("Execute read-write function on previous value %s and previous metadata %s", prevValue, prevMetadata); e.setValue(copy.getValue()); e.setMetadata(copy.getMetadata()); e.setChanged(copy.isChanged()); e.setRemoved(copy.isRemoved()); return snapshot(ret); } return f.apply(value, EntryViews.readWrite(e, e.getValue(), e.getMetadata())); }
Source:
<code>private void runExecutableNode(final ExecutableNode node) throws IOException { prepareJobProperties(node); node.setStatus(Status.QUEUED); String jobId = node.getId(); String jobType = Optional.ofNullable(node.getInputProps()).map(props -> props.getString("type")).orElse(null); if (jobType != null && jobId != null) { Props rampProps = this.flow.getRampPropsForJob(jobId, jobType); if (rampProps != null) { this.flowIsRamping = true; logger.info(String.format( <START> "RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s, job.id = %s, job.type = %s, props = %s)", <END> this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName(), jobId, jobType, rampProps.toString())); node.setRampProps(rampProps); } } final JobRunner runner = createJobRunner(node); this.logger.info("Submitting job '" + node.getNestedId() + "' to run."); try { this.executorService.submit(runner); this.activeJobRunners.add(runner); } catch (final RejectedExecutionException e) { this.logger.error(e); } }</code><technical_language>if jobId null, this line if condition jobtype's null check nested in it</technical_language>

Target:
private void runExecutableNode(final ExecutableNode node) throws IOException { prepareJobProperties(node); node.setStatus(Status.QUEUED); String jobId = node.getId(); String jobType = Optional.ofNullable(node.getInputProps()).map(props -> props.getString("type")).orElse(null); if (jobType != null && jobId != null) { Props rampProps = this.flow.getRampPropsForJob(jobId, jobType); if (rampProps != null) { this.flowIsRamping = true; logger.info(String.format( "RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s, job.id = %s, job.type = %s, props = %s)", this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName(), jobId, jobType, rampProps.toString())); node.setRampProps(rampProps); } } else { logger.warn(String.format( "RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s) does not have Job Type or Id", this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName())); } final JobRunner runner = createJobRunner(node); this.logger.info("Submitting job '" + node.getNestedId() + "' to run."); try { this.executorService.submit(runner); this.activeJobRunners.add(runner); } catch (final RejectedExecutionException e) { this.logger.error(e); } }
Source:
<code>public WorkspaceDto addEnvironment(@ApiParam("The workspace id") @PathParam("id") String id, @ApiParam(value = "The new environment", required = true) EnvironmentDto newEnvironment, @ApiParam(value = "The name of the environment", required = true) @QueryParam("name") String envName) throws ServerException, BadRequestException, NotFoundException, ConflictException, ForbiddenException { requiredNotNull(newEnvironment, "New environment"); requiredNotNull(envName, "New environment name"); relativizeRecipeLinks(newEnvironment); workspaceManager.addEnvironment(id, envName, newEnvironment); <START> return linksInjector.injectLinks(asDto(workspaceManager.getWorkspace(id)), getServiceContext()); <END> }</code><technical_language>please elaborate environment validation performed</technical_language>

Target:
public WorkspaceDto addEnvironment(@ApiParam("The workspace id") @PathParam("id") String id, @ApiParam(value = "The new environment", required = true) EnvironmentDto newEnvironment, @ApiParam(value = "The name of the environment", required = true) @QueryParam("name") String envName) throws ServerException, BadRequestException, NotFoundException, ConflictException, ForbiddenException { requiredNotNull(newEnvironment, "New environment"); requiredNotNull(envName, "New environment name"); relativizeRecipeLinks(newEnvironment); final WorkspaceImpl workspace = workspaceManager.getWorkspace(id); if (workspace.getConfig().getEnvironments().put(envName, new EnvironmentImpl(newEnvironment)) != null) { throw new ConflictException(format("Environment '%s' already exists", envName)); } validator.validateConfig(workspace.getConfig()); return linksInjector.injectLinks(asDto(workspaceManager.updateWorkspace(id, workspace)), getServiceContext()); }
Source:
<code>public static String loadResource( final String name ) throws Exception { final InputStream in = VerifierWebWorkerServlet.class.getResourceAsStream( name ); <START> final Reader reader = new InputStreamReader( in ); <END> final StringBuilder text = new StringBuilder(); final char[] buf = new char[1024]; int len = 0; while ( ( len = reader.read( buf ) ) >= 0 ) { text.append( buf, 0, len ); } return text.toString(); }</code><technical_language>I customary add encoding; UTF-8.. IIRC @psiroky codebase a while adding missing encoding... worth checking</technical_language>

Target:
public static String loadResource( final String name ) throws Exception { final InputStream in = VerifierWebWorkerServlet.class.getResourceAsStream( name ); final Reader reader = new InputStreamReader( in, StandardCharsets.UTF_8 ); final StringBuilder text = new StringBuilder(); final char[] buf = new char[1024]; int len = 0; while ( ( len = reader.read( buf ) ) >= 0 ) { text.append( buf, 0, len ); } return text.toString(); }
Source:
<code>protected void zoomEntries(@NonNull Iterable<TimeGraphEntry> entries, long zoomStartTime, long zoomEndTime, long resolution, @NonNull IProgressMonitor monitor) { Sampling sampling = new Sampling(zoomStartTime, zoomEndTime, resolution); for (TimeGraphEntry entry : entries) { if (zoomStartTime <= fStartTime && zoomEndTime >= fEndTime) { entry.setZoomedEventList(null); } else if (!sampling.equals(entry.getSampling())) { List<ITimeEvent> zoomedEventList = getEventList(entry, zoomStartTime, zoomEndTime, resolution, monitor); if (zoomedEventList != null && !monitor.isCanceled()) { entry.setZoomedEventList(zoomedEventList); entry.setSampling(sampling); } <START> } <END> } redraw(); }</code><technical_language>I need set zoomed lists applyResults() runnable? This set zoomed list a cancelled thread, happen line 594 595. Need check if this is issue for ControlFlowView overrides zoomEntries()..</technical_language>

Target:
protected void zoomEntries(@NonNull Iterable<TimeGraphEntry> entries, long zoomStartTime, long zoomEndTime, long resolution, @NonNull IProgressMonitor monitor) { Sampling sampling = new Sampling(zoomStartTime, zoomEndTime, resolution); for (TimeGraphEntry entry : entries) { if (zoomStartTime <= fStartTime && zoomEndTime >= fEndTime) { applyResults(() -> entry.setZoomedEventList(null)); } else if (!sampling.equals(entry.getSampling())) { List<ITimeEvent> zoomedEventList = getEventList(entry, zoomStartTime, zoomEndTime, resolution, monitor); if (zoomedEventList != null && !monitor.isCanceled()) { applyResults(() -> { entry.setZoomedEventList(zoomedEventList); entry.setSampling(sampling); }); } } } redraw(); }
Source:
<code>public Object get(ResultSet resultSet, int column) throws SQLException { switch (this) { case OBJECT: return resultSet.getObject(column + 1); case STRING: return resultSet.getString(column + 1); case INT: return resultSet.getInt(column + 1); case LONG: return resultSet.getLong(column + 1); case DOUBLE: <START> case DECIMAL: <END> return resultSet.getDouble(column + 1); default: throw Util.unexpected(this); } }</code><technical_language>I remember Accessors retrieve resultset values *and* a get() method in TYPE. reason, DECIMAL type getBigDecimal here</technical_language>

Target:
public Object get(ResultSet resultSet, int column) throws SQLException { switch (this) { case OBJECT: return resultSet.getObject(column + 1); case STRING: return resultSet.getString(column + 1); case INT: return resultSet.getInt(column + 1); case LONG: return resultSet.getLong(column + 1); case DOUBLE: return resultSet.getDouble(column + 1); case DECIMAL: BigDecimal decimal = resultSet.getBigDecimal( column + 1 ); return decimal == null ? null : decimal.doubleValue(); default: throw Util.unexpected(this); } }
Source:
<code>public CompletableFuture<CoordinationResponse> sendCoordinationRequest( JobID jobId, OperatorID operatorId, CoordinationRequest request) { ClientCoordinationHeaders headers = ClientCoordinationHeaders.getInstance(); ClientCoordinationMessageParameters params = new ClientCoordinationMessageParameters(); params.jobPathParameter.resolve(jobId); params.operatorPathParameter.resolve(operatorId); SerializedValue<CoordinationRequest> serializedRequest; try { serializedRequest = new SerializedValue<>(request); } catch (IOException e) { return FutureUtils.completedExceptionally(e); } ClientCoordinationRequestBody requestBody = new ClientCoordinationRequestBody(serializedRequest); return sendRequest(headers, params, requestBody).thenApply( responseBody -> { try { return responseBody .getSerializedCoordinationResponse() .deserializeValue(getClass().getClassLoader()); } catch (IOException | ClassNotFoundException e) { <START> throw new RuntimeException("Failed to deserialize coordination response", e); <END> } }); }</code><technical_language>throw CompletionException getAccumulators method</technical_language>

Target:
public CompletableFuture<CoordinationResponse> sendCoordinationRequest( JobID jobId, OperatorID operatorId, CoordinationRequest request) { ClientCoordinationHeaders headers = ClientCoordinationHeaders.getInstance(); ClientCoordinationMessageParameters params = new ClientCoordinationMessageParameters(); params.jobPathParameter.resolve(jobId); params.operatorPathParameter.resolve(operatorId); SerializedValue<CoordinationRequest> serializedRequest; try { serializedRequest = new SerializedValue<>(request); } catch (IOException e) { return FutureUtils.completedExceptionally(e); } ClientCoordinationRequestBody requestBody = new ClientCoordinationRequestBody(serializedRequest); return sendRequest(headers, params, requestBody).thenApply( responseBody -> { try { return responseBody .getSerializedCoordinationResponse() .deserializeValue(getClass().getClassLoader()); } catch (IOException | ClassNotFoundException e) { throw new CompletionException("Failed to deserialize coordination response", e); } }); }
Source:
<code>public void testBasicSoftwareProcessStopEverythingExplicitly() throws Exception { MyService entity = app.createAndManageChild(EntitySpec.create(MyService.class)); entity.start(ImmutableList.of(loc)); SimulatedDriver d = (SimulatedDriver) entity.getDriver(); Location machine = Iterables.getOnlyElement(entity.getLocations()); d.events.clear(); <START> TaskAdaptable<Void> t1 = Entities.submit(entity, Effectors.invocation(entity, Startable.STOP, <END> ConfigBag.newInstance().configure(StopSoftwareParameters.STOP_MACHINE, StopMachineMode.TRUE))); t1.asTask().get(); assertEquals(d.events, ImmutableList.of("stop")); assertEquals(entity.getLocations().size(), 0); assertTrue(loc.getAvailable().contains(machine)); }</code><technical_language>This is fine, for future reference is a Entities.invokeEffector(...) executes task for you, returns submitted task</technical_language>

Target:
public void testBasicSoftwareProcessStopEverythingExplicitly() throws Exception { MyService entity = app.createAndManageChild(EntitySpec.create(MyService.class)); entity.start(ImmutableList.of(loc)); SimulatedDriver d = (SimulatedDriver) entity.getDriver(); Location machine = Iterables.getOnlyElement(entity.getLocations()); d.events.clear(); TaskAdaptable<Void> t1 = Entities.submit(entity, Effectors.invocation(entity, Startable.STOP, ConfigBag.newInstance().configure(StopSoftwareParameters.STOP_MACHINE, true))); t1.asTask().get(); assertEquals(d.events, ImmutableList.of("stop")); assertEquals(entity.getLocations().size(), 0); assertTrue(loc.getAvailable().contains(machine)); }
Source:
<code>public void setSelectedElement(ObjectId objectId) { <START> if (null == objectId) { <END> return; } for (int i = 0; i < commits.size(); i++) if (objectId.equals(commits.get(i).objectId)) { combo.select(i); break; } }</code><technical_language>more straightforward objectId == null? (this C)</technical_language>

Target:
public void setSelectedElement(ObjectId objectId) { if (objectId == null) { return; } for (int i = 0; i < commits.size(); i++) if (objectId.equals(commits.get(i).objectId)) { combo.select(i); break; } }
Source:
<code>public void setQueues(Queue... queues) { <START> final String[] queueNames = new String[queues.length]; <END> for (int i = 0; i < queues.length; i++) { Assert.notNull(queues[i], "Queue (" + i + ") must not be null."); queueNames[i] = queues[i].getName(); } setQueueNames(queueNames); }</code><technical_language>Arrays.stream(queues).map(Queue::getName) instead</technical_language>

Target:
public final void setQueues(Queue... queues) { setQueueNames(collectQueueNames(queues)); }
Source:
<code>protected EPackage createModel(EPackage parent, TestRemoteEPackage remotePackage) { EPackage pckg = EcoreFactory.eINSTANCE.createEPackage(); pckg.setName(remotePackage.name.replaceAll("Remote", "Local")); <START> System.err.println(pckg); <END> return pckg; }</code><technical_language>Remove in <LINK_0></technical_language>

Target:
protected EPackage createModel(EPackage parent, TestRemoteEPackage remotePackage) { EPackage pckg = EcoreFactory.eINSTANCE.createEPackage(); pckg.setName(remotePackage.name.replaceAll("Remote", "Local")); return pckg; }
Source:
<code>private void testStayLocalIfAllSegmentsPresentLocally(boolean rehashAware) throws Exception { Cache<Object, String> cache0 = cache(0, CACHE_NAME); ClusterStreamManager clusterStreamManager = replaceWithSpy(cache0); IntStream.rangeClosed(0, 499).boxed().forEach(i -> cache0.put(i, i.toString())); ConsistentHash ch = cache0.getAdvancedCache().getDistributionManager().getConsistentHash(); Set<Integer> segmentsCache0 = ch.getSegmentsForOwner(cache0.getCacheManager().getAddress()); CacheStream<Map.Entry<Object, String>> stream = cache0.entrySet().stream(); <START> if (!rehashAware) stream.disableRehashAware(); <END> Map<Object, String> entries = mapFromIterator(stream.filterKeySegments(segmentsCache0).iterator()); Map<Integer, Set<Map.Entry<Object, String>>> entriesPerSegment = generateEntriesPerSegment(ch, entries.entrySet()); assertEquals(segmentsCache0, entriesPerSegment.keySet()); verify(clusterStreamManager, never()).awaitCompletion(any(UUID.class), anyLong(), any(TimeUnit.class)); }</code><technical_language>reassign stream return value</technical_language>

Target:
private void testStayLocalIfAllSegmentsPresentLocally(boolean rehashAware) throws Exception { Cache<Object, String> cache0 = cache(0, CACHE_NAME); ClusterStreamManager clusterStreamManager = replaceWithSpy(cache0); IntStream.rangeClosed(0, 499).boxed().forEach(i -> cache0.put(i, i.toString())); ConsistentHash ch = cache0.getAdvancedCache().getDistributionManager().getConsistentHash(); Set<Integer> segmentsCache0 = ch.getSegmentsForOwner(cache0.getCacheManager().getAddress()); CacheStream<Map.Entry<Object, String>> stream = cache0.entrySet().stream(); if (!rehashAware) stream = stream.disableRehashAware(); Map<Object, String> entries = mapFromIterator(stream.filterKeySegments(segmentsCache0).iterator()); Map<Integer, Set<Map.Entry<Object, String>>> entriesPerSegment = generateEntriesPerSegment(ch, entries.entrySet()); assertEquals(segmentsCache0, entriesPerSegment.keySet()); verify(clusterStreamManager, never()).awaitCompletion(any(UUID.class), anyLong(), any(TimeUnit.class)); }
Source:
<code>public void openSpecialDesignerPage(String wikiURL) { <START> getUrl(wikiURL+"wiki/Special:ThemeDesigner"); <END> PageObjectLogging.log("openSpecialDesignerPage", "special designer page opened", true, driver); }</code><technical_language>move URLsContent</technical_language>

Target:
public void openSpecialDesignerPage(String wikiURL) { getUrl(wikiURL+URLsContent.specialThemeDesigner); PageObjectLogging.log("openSpecialDesignerPage", "special designer page opened", true, driver); }
Source:
<code>private int hash(String nodePinValue) { <START> return Hashing.consistentHash(Hashing.crc32c().hashString(nodePinValue, StandardCharsets.UTF_8), nodes.size()); <END> }</code><technical_language>I guess I need read here, crc? Curious do envoy use</technical_language>

Target:
private int hash(String nodePinValue) { return Hashing.consistentHash(Hashing.murmur3_32().hashString(nodePinValue, StandardCharsets.UTF_8), nodes.size()); }
Source:
<code>public CommitCombo(Composite parent, int style) { super(parent, style); <START> combo = new Combo(this, style | SWT.DROP_DOWN); <END> commits = new ArrayList<ComboCommitEnt>(); setLayout(GridLayoutFactory.swtDefaults().create()); setLayoutData(GridDataFactory.fillDefaults().create()); GridData totalLabelData = new GridData(); totalLabelData.horizontalAlignment = SWT.FILL; totalLabelData.grabExcessHorizontalSpace = true; combo.setLayoutData(totalLabelData); ContentProposalAdapter adapter = new ContentProposalAdapter(combo, new ComboContentAdapter(), new CommitContentProposalProvider(), null, null); adapter.setPropagateKeys(true); adapter .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }</code><technical_language>want style for combo. This is asking for trouble. for parameters</technical_language>

Target:
public CommitCombo(Composite parent, int style) { super(parent, style); combo = new Combo(this, SWT.DROP_DOWN); commits = new ArrayList<ComboCommitEnt>(); setLayout(GridLayoutFactory.swtDefaults().create()); setLayoutData(GridDataFactory.fillDefaults().create()); GridData totalLabelData = new GridData(); totalLabelData.horizontalAlignment = SWT.FILL; totalLabelData.grabExcessHorizontalSpace = true; combo.setLayoutData(totalLabelData); combo.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { if (null == getValue()) combo.setText(""); } }); UIUtils.addBulbDecorator(combo, UIText.CommitCombo_showSuggestedCommits); ContentProposalAdapter adapter = new ContentProposalAdapter(combo, new ComboContentAdapter(), new CommitContentProposalProvider(), null, null); adapter.setPropagateKeys(true); adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }
Source:
<code>public void validate() throws APITemplateException, APIManagementException { super.validate(); if (api != null) { JSONParser parser = new JSONParser(); <START> String config_json = api.getEndpointConfig(); <END> if (config_json != null && !"".equals(config_json)) { try { Object config = parser.parse(config_json); JSONObject endpointConfig = (JSONObject) config; if (endpointConfig.get(APIConstants.ENDPOINT_SECURITY) != null) { JSONObject endpointSecurity = (JSONObject) endpointConfig.get(APIConstants.ENDPOINT_SECURITY); if (endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_PRODUCTION) != null) { productionEndpointSecurity = (JSONObject) endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_PRODUCTION); } if (endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_SANDBOX) != null) { sandboxEndpointSecurity = (JSONObject) endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_SANDBOX); } } } catch (ParseException e) { this.handleException("Unable to pass the endpoint JSON config"); } } } }</code><technical_language>camel case variable types</technical_language>

Target:
public void validate() throws APITemplateException, APIManagementException { super.validate(); if (api != null) { JSONParser parser = new JSONParser(); String apiEndpointConfig = api.getEndpointConfig(); if (StringUtils.isNotEmpty(apiEndpointConfig)) { try { Object config = parser.parse(apiEndpointConfig); JSONObject endpointConfig = (JSONObject) config; if (endpointConfig.get(APIConstants.ENDPOINT_SECURITY) != null) { JSONObject endpointSecurity = (JSONObject) endpointConfig.get(APIConstants.ENDPOINT_SECURITY); if (endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_PRODUCTION) != null) { productionEndpointSecurity = (JSONObject) endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_PRODUCTION); } if (endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_SANDBOX) != null) { sandboxEndpointSecurity = (JSONObject) endpointSecurity.get(APIConstants.ENDPOINT_SECURITY_SANDBOX); } } } catch (ParseException e) { this.handleException("Unable to pass the endpoint JSON config"); } } } }
Source:
<code>public void testGetCommandIdsByEntity() { Guid storageId = Guid.newGuid(); CommandEntity cmdEntity1 = generateNewEntity(); dao.save(cmdEntity1); Set<CommandAssociatedEntity> cocoCmdEntities1 = new HashSet<>(); cocoCmdEntities1.add(new CommandAssociatedEntity(cmdEntity1.getId(), VdcObjectType.Storage, storageId)); cocoCmdEntities1.add(new CommandAssociatedEntity(cmdEntity1.getId(), VdcObjectType.Disk, Guid.newGuid())); dao.insertCommandAssociatedEntities(cocoCmdEntities1); CommandEntity cmdEntity2 = generateNewEntity(); dao.save(cmdEntity2); Set<CommandAssociatedEntity> cocoCmdEntities2 = new HashSet<>(); cocoCmdEntities2.add(new CommandAssociatedEntity(cmdEntity2.getId(), VdcObjectType.Storage, storageId)); cocoCmdEntities2.add(new CommandAssociatedEntity(cmdEntity2.getId(), VdcObjectType.Disk, Guid.newGuid())); dao.insertCommandAssociatedEntities(cocoCmdEntities2); List<Guid> cmIds = dao.getCommandIdsByEntity(storageId); assertNotNull(cmIds); <START> assertEquals(2, cmIds.size()); <END> assertTrue(cmIds.contains(cmdEntity1.getId())); assertTrue(cmIds.contains(cmdEntity2.getId())); }</code><technical_language>replaced with: assertThat(cmdIds, hasSize(2));</technical_language>

Target:
public void testGetCommandIdsByEntity() { Guid storageId = Guid.newGuid(); CommandEntity cmdEntity1 = generateNewEntity(); dao.save(cmdEntity1); Set<CommandAssociatedEntity> cocoCmdEntities1 = new HashSet<>(); cocoCmdEntities1.add(new CommandAssociatedEntity(cmdEntity1.getId(), VdcObjectType.Storage, storageId)); cocoCmdEntities1.add(new CommandAssociatedEntity(cmdEntity1.getId(), VdcObjectType.Disk, Guid.newGuid())); dao.insertCommandAssociatedEntities(cocoCmdEntities1); CommandEntity cmdEntity2 = generateNewEntity(); dao.save(cmdEntity2); Set<CommandAssociatedEntity> cocoCmdEntities2 = new HashSet<>(); cocoCmdEntities2.add(new CommandAssociatedEntity(cmdEntity2.getId(), VdcObjectType.Storage, storageId)); cocoCmdEntities2.add(new CommandAssociatedEntity(cmdEntity2.getId(), VdcObjectType.Disk, Guid.newGuid())); dao.insertCommandAssociatedEntities(cocoCmdEntities2); List<Guid> cmIds = dao.getCommandIdsByEntity(storageId); assertNotNull(cmIds); assertThat(cmIds, hasSize(2)); assertThat(cmIds, hasItems(cmdEntity1.getId(), cmdEntity2.getId())); }
Source:
<code>private boolean isKnoxSSOEnabled() { Collection realmsList = SecurityUtils.getRealmsList(); if (realmsList != null) { for (Iterator<Realm> iterator = realmsList.iterator(); iterator.hasNext(); ) { Realm realm = iterator.next(); <START> String name = realm.getClass().getName(); <END> LOG.debug("RealmClass.getName: " + name); if (realm instanceof KnoxJwtRealm) { return true; } } } return false; }</code><technical_language>name removed is again</technical_language>

Target:
private boolean isKnoxSSOEnabled() { Collection realmsList = SecurityUtils.getRealmsList(); if (realmsList != null) { for (Iterator<Realm> iterator = realmsList.iterator(); iterator.hasNext(); ) { Realm realm = iterator.next(); if (realm instanceof KnoxJwtRealm) { return true; } } } return false; }
Source:
<code>private void prestartVms(VmPool vmPool, int numOfVmsToPrestart) { AtomicInteger failedAttempts = new AtomicInteger(0); <START> AtomicInteger prestartedVmsCounter = new AtomicInteger(0); <END> int maxFailedAttempts = Config.<Integer> getValue(ConfigValues.VmPoolMonitorMaxAttempts); Map<String, Set<Guid>> failureReasons = new HashMap<>(); Iterator<Guid> iterator = vmPoolHandler .selectNonPrestartedVms(vmPool.getVmPoolId(), (vmId, messages) -> collectVmPrestartFailureReasons(vmId, failureReasons, messages)) .iterator(); while (failedAttempts.intValue() < maxFailedAttempts && prestartedVmsCounter.intValue() < numOfVmsToPrestart && iterator.hasNext()) { Guid vmId = iterator.next(); if (prestartVm(vmId, !vmPool.isStateful(), vmPool.getName())) { prestartedVmsCounter.incrementAndGet(); failedAttempts.set(0); } else { failedAttempts.incrementAndGet(); } } logResultOfPrestartVms(prestartedVmsCounter.intValue(), numOfVmsToPrestart, vmPool.getVmPoolId(), failureReasons); if (prestartedVmsCounter.intValue() == 0) { log.info("No VMs available for prestarting"); } }</code><technical_language>do need AtomicInteger? is concurrency here.</technical_language>

Target:
private void prestartVms(VmPool vmPool, int numOfVmsToPrestart) { int failedAttempts = 0; int prestartedVms = 0; int maxFailedAttempts = Config.<Integer> getValue(ConfigValues.VmPoolMonitorMaxAttempts); Map<String, Set<Guid>> failureReasons = new HashMap<>(); Iterator<Guid> iterator = vmPoolHandler .selectNonPrestartedVms(vmPool.getVmPoolId(), (vmId, messages) -> collectVmPrestartFailureReasons(vmId, failureReasons, messages)) .iterator(); while (failedAttempts < maxFailedAttempts && prestartedVms < numOfVmsToPrestart && iterator.hasNext()) { Guid vmId = iterator.next(); if (prestartVm(vmId, !vmPool.isStateful(), vmPool.getName())) { prestartedVms++; failedAttempts = 0; } else { failedAttempts++; } } logResultOfPrestartVms(prestartedVms, numOfVmsToPrestart, vmPool.getVmPoolId(), failureReasons); if (prestartedVms == 0) { log.info("No VMs available for prestarting"); } }
Source:
<code>private void dispatchEvent(long startTimeOfNewAggregates, BaseIncrementalValueStore aBaseIncrementalValueStore) { if (aBaseIncrementalValueStore.isProcessed()) { ComplexEventChunk<StreamEvent> eventChunk = new ComplexEventChunk<>(true); ComplexEventChunk<StreamEvent> tableEventChunk = new ComplexEventChunk<>(true); eventChunk.add(aBaseIncrementalValueStore.createStreamEvent()); tableEventChunk.add(aBaseIncrementalValueStore.createStreamEvent()); if (LOG.isDebugEnabled()) { LOG.debug("Event dispatched by " + this.duration + " incremental executor: " + eventChunk.toString()); } if (isProcessingExecutor) { executorService.execute(() -> { try { table.addEvents(tableEventChunk, 1); } catch (Throwable t) { <START> LOG.error("Exception occurred when writing to aggregation table of duration '" + <END> this.duration + "'. This should be investigated as this can cause accuracy loss.", t); } }); } if (getNextExecutor() != null) { next.execute(eventChunk); } } cleanBaseIncrementalValueStore(startTimeOfNewAggregates, aBaseIncrementalValueStore); }</code><technical_language>Please add siddhiApp name aggregation name</technical_language>

Target:
private void dispatchEvent(long startTimeOfNewAggregates, BaseIncrementalValueStore aBaseIncrementalValueStore) { if (aBaseIncrementalValueStore.isProcessed()) { ComplexEventChunk<StreamEvent> eventChunk = new ComplexEventChunk<>(true); ComplexEventChunk<StreamEvent> tableEventChunk = new ComplexEventChunk<>(true); eventChunk.add(aBaseIncrementalValueStore.createStreamEvent()); tableEventChunk.add(aBaseIncrementalValueStore.createStreamEvent()); if (LOG.isDebugEnabled()) { LOG.debug("Event dispatched by " + this.duration + " incremental executor: " + eventChunk.toString()); } if (isProcessingExecutor) { executorService.execute(() -> { try { table.addEvents(tableEventChunk, 1); } catch (Throwable t) { LOG.error("Exception occurred at siddhi app '" + siddhiAppContext.getName() + "' when performing table writes of aggregation '" + this.aggregatorName + "' for duration '" + this.duration + "'. This should be investigated as this can " + "cause accuracy loss.", t); } }); } if (getNextExecutor() != null) { next.execute(eventChunk); } } cleanBaseIncrementalValueStore(startTimeOfNewAggregates, aBaseIncrementalValueStore); }
Source:
<code>public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException { return root.retrieve() <START> .method("POST") <END> .with("subscribed", subscribed) .with("ignored", ignored) .method("PUT") .withUrlPath(subscription_url) .to(GHSubscription.class) .wrapUp(root); }</code><technical_language>redundant method("POST")</technical_language>

Target:
public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException { return root.createRequest() .method("PUT") .with("subscribed", subscribed) .with("ignored", ignored) .withUrlPath(subscription_url) .fetch(GHSubscription.class) .wrapUp(root); }
Source:
<code>private Set<String> getIndexSequencesWithMinimumEditDistance(int minimumDistance) { Set<String> sequences = new HashSet<>(); List<PoolableElementView> views = new ArrayList<>(getPoolableElementViews()); for (int i = 0; i < views.size(); i++) { String sequence1 = getCombinedIndexSequences(views.get(i)); for (int j = i + 1; j < views.size(); j++) { String sequence2 = getCombinedIndexSequences(views.get(j)); if ((Index.checkEditDistance(sequence1, sequence2) < minimumDistance) && <START> !((hasFakeSequence(views.get(i)) || hasFakeSequence(views.get(j))) && minimumDistance > 1)) { <END> sequences.add(sequence1); sequences.add(sequence2); } } } return sequences; }</code><technical_language>hasFakeSequence is a pretty cheap check compared checkEditDistance, do avoid more intense check. Also, a pool a mix of fake real sequences. Actually, a new class of error consider. For now, check start: if (views.stream().anyMatch(PoolImpl::hasFakeSequence)) { return Collections.emptySet(); }</technical_language>

Target:
private Set<String> getIndexSequencesWithMinimumEditDistance(int minimumDistance) { Set<String> sequences = new HashSet<>(); List<PoolableElementView> views = new ArrayList<>(getPoolableElementViews()); if (minimumDistance > 1 && views.stream().anyMatch(PoolImpl::hasFakeSequence)) return Collections.emptySet(); for (int i = 0; i < views.size(); i++) { String sequence1 = getCombinedIndexSequences(views.get(i)); for (int j = i + 1; j < views.size(); j++) { String sequence2 = getCombinedIndexSequences(views.get(j)); if (Index.checkEditDistance(sequence1, sequence2) < minimumDistance) { sequences.add(sequence1); sequences.add(sequence2); } } } return sequences; }
Source:
<code>public CreateStack build() { String missing = ""; if (name == null) { missing += " name"; } if (template == null && templateUrl == null) { missing += " template and templateUrl"; } <START> if (!missing.isEmpty()) { <END> throw new IllegalStateException("Missing required properties:" + missing); } CreateStack result = new AutoValue_CreateStack( this.name, this.template != null ? template : null, this.templateUrl != null ? templateUrl : null, this.parameters != null ? ImmutableMap.copyOf(this.parameters) : null, this.disableRollback, this.files != null ? ImmutableMap.copyOf(this.files) : null, this.environment != null ? environment : null ); return result; }</code><technical_language>In general, moving client-side validation possible</technical_language>

Target:
public CreateStack build() { CreateStack result = new AutoValue_CreateStack( this.name, this.template, this.templateUrl, this.parameters != null ? ImmutableMap.copyOf(this.parameters) : null, this.disableRollback, this.files != null ? ImmutableMap.copyOf(this.files) : null, this.environment); return result; }
Source:
<code>public String getSubnetHostname() { <START> String publicHostname = jcloudsParent.getPrivateHostname(node, Optional.<HostAndPort>absent(), config().getBag()); <END> return publicHostname; }</code><technical_language>Rename variable</technical_language>

Target:
public String getSubnetHostname() { String privateHostname = jcloudsParent.getPrivateHostname(node, Optional.<HostAndPort>absent(), config().getBag()); return privateHostname; }