auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public DiffStyler setFiles(final Collection<CommitFile> files) { diffs.clear(); if (files == null || files.isEmpty()) return this; for (CommitFile file : files) { String patch = file.getPatch(); if (TextUtils.isEmpty(patch)) continue; int start = 0; int end = patch.indexOf('\n'); StyledText styled = new StyledText(); while (end != -1) { String line = patch.substring(start, end + 1); <START> if (line.length() == 0) { <END> continue; } switch (line.charAt(0)) { case '@': styled.foreground(line, markerColor); break; case '+': styled.foreground(line, addColor); break; case '-': styled.foreground(line, removeColor); break; default: styled.append(line); break; } start = end + 1; end = patch.indexOf('\n', start); } diffs.put(file.getFilename(), styled); } return this; }</code><technical_language>I comparing start end+1 creating line string saves call substring altogether</technical_language>

Target:
public DiffStyler setFiles(final Collection<CommitFile> files) { diffs.clear(); if (files == null || files.isEmpty()) return this; for (CommitFile file : files) { String patch = file.getPatch(); if (TextUtils.isEmpty(patch)) continue; int start = 0; int end = patch.indexOf('\n'); StyledText styled = new StyledText(); while (end != -1) { if (end + 1 - start > 0) { String line = patch.substring(start, end + 1); switch (line.charAt(0)) { case '@': styled.foreground(line, markerColor); break; case '+': styled.foreground(line, addColor); break; case '-': styled.foreground(line, removeColor); break; default: styled.append(line); break; } } start = end + 1; end = patch.indexOf('\n', start); } diffs.put(file.getFilename(), styled); } return this; }
Source:
<code>public List<String> getDeploymentBrowsedContentItems() { By selector = ByJQuery.selector("table.browse-content tr"); <START> List<String> items = new ArrayList(); <END> List<WebElement> webElements = getContentRoot().findElements(selector); for (WebElement webElement : webElements ) { items.add(webElement.getText()); } return items; }</code><technical_language>Please add String type args: new ArrayList<String>()</technical_language>

Target:
public List<String> getDeploymentBrowsedContentItems() { By selector = ByJQuery.selector("table.browse-content tr"); List<String> items = new ArrayList<>(); List<WebElement> webElements = getContentRoot().findElements(selector); for (WebElement webElement : webElements ) { items.add(webElement.getText()); } return items; }
Source:
<code><START> public int hashCode() { <END> int result; long temp; temp = Double.doubleToLongBits(x); result = (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(y); result = 31 * result + (int) (temp ^ (temp >>> 32)); return result; }</code><technical_language>Consider Objects.hash(x, y) implementation of this method, rolling hash function: <LINK_0></technical_language>

Target:
public int hashCode() { return Objects.hash(x, y); }
Source:
<code>private List<Module> getModules(Guice guice, Injector parentInjector, Class<?> testClass) { List<Module> result = Lists.newArrayList(); for (Class<? extends Module> moduleClass : guice.modules()) { List<Module> modules = context.getGuiceModules(moduleClass); if (modules != null && !modules.isEmpty()) { result.addAll(modules); } else { Module instance = parentInjector.getInstance(moduleClass); result.add(instance); context.getGuiceModules(moduleClass).add(instance); } } Class<? extends IModuleFactory> factory = guice.moduleFactory(); if (factory != IModuleFactory.class) { IModuleFactory factoryInstance = parentInjector.getInstance(factory); Module module = factoryInstance.createModule(context, testClass); if (module != null) { result.add(module); } } <START> ServiceLoader.load(IModule.class).forEach(result::add); <END> return result; }</code><technical_language>happen module is loaded multiple times of multiple SPI references in CLASSPATH</technical_language>

Target:
private List<Module> getModules(Guice guice, Injector parentInjector, Class<?> testClass) { List<Module> result = Lists.newArrayList(); for (Class<? extends Module> moduleClass : guice.modules()) { List<Module> modules = context.getGuiceModules(moduleClass); if (modules != null && !modules.isEmpty()) { result.addAll(modules); } else { Module instance = parentInjector.getInstance(moduleClass); result.add(instance); context.getGuiceModules(moduleClass).add(instance); } } Class<? extends IModuleFactory> factory = guice.moduleFactory(); if (factory != IModuleFactory.class) { IModuleFactory factoryInstance = parentInjector.getInstance(factory); Module module = factoryInstance.createModule(context, testClass); if (module != null) { result.add(module); } } result.addAll(LazyHolder.getSpiModules()); return result; }
Source:
<code>public boolean removeAll(@NonNull Collection<?> collection) { <START> final boolean succeeded = networks.removeAll(collection); <END> final boolean btSuccess = btNets.removeAll(collection); final boolean leSuccess = leNets.removeAll(collection); final boolean wifiSuccess = wifiNets.removeAll(collection); final boolean cellSuccess = cellNets.removeAll(collection); return succeeded && (btSuccess || leSuccess || wifiSuccess || cellSuccess); }</code><technical_language>this work networks.clear() re-add sets .removeAll()</technical_language>

Target:
public boolean removeAll(@NonNull Collection<?> collection) { boolean succeeded = false; Iterator netIter = collection.iterator(); while (netIter.hasNext()) { succeeded |= remove(netIter.next()); } return succeeded; }
Source:
<code>protected void executeCommand() { <START> log.debug("Triggred <END> Refreshing Gluster self heal data of cluster"); Cluster cluster = clusterDao.get(getParameters().getClusterId()); if (cluster.supportsGlusterService()) { try { glusterSyncJob.refreshSelfHealData(cluster); } catch (Exception e) { log.error("Error while refreshing Gluster self heal data of cluster '{}': {}", cluster.getName(), e.getMessage()); log.debug("Exception", e); } setSucceeded(true); } }</code><technical_language>is this required</technical_language>

Target:
protected void executeCommand() { Cluster cluster = clusterDao.get(getParameters().getClusterId()); if (cluster.supportsGlusterService()) { try { glusterSyncJob.refreshSelfHealData(cluster); } catch (Exception e) { log.error("Error while refreshing Gluster self heal data of cluster '{}': {}", cluster.getName(), e.getMessage()); log.debug("Exception", e); } setSucceeded(true); } }
Source:
<code>private void populateContactEmail(PaymentWorksVendor pmwVendor, VendorDetail vendorDetail) { List<VendorContact> vendorInformationContacts = findAllActiveVendorInformationContacts(vendorDetail.getVendorContacts()); <START> if (vendorInformationContacts.size() == 1) { <END> VendorContact vendorContact = vendorInformationContacts.get(0); pmwVendor.setVendorInformationEmail(vendorContact.getVendorContactEmailAddress()); } else { LOG.error("populateContactEmail: KFS Approved PVEN does not contain one and only one Active Vendor Information Contact for vendor " + vendorDetail.getVendorHeaderGeneratedIdentifier() + "-" + vendorDetail.getVendorDetailAssignedIdentifier()); } }</code><technical_language>do need check for nulls here</technical_language>

Target:
private void populateContactEmail(PaymentWorksVendor pmwVendor, VendorDetail vendorDetail) { List<VendorContact> vendorInformationContacts = findAllActiveVendorInformationContacts(vendorDetail.getVendorContacts()); if (ObjectUtils.isNotNull(vendorInformationContacts) && vendorInformationContacts.size() == 1) { VendorContact vendorContact = vendorInformationContacts.get(0); pmwVendor.setVendorInformationEmail(vendorContact.getVendorContactEmailAddress()); } else { LOG.error("populateContactEmail: KFS Approved PVEN does not contain one and only one Active Vendor Information Contact for vendor " + vendorDetail.getVendorHeaderGeneratedIdentifier() + "-" + vendorDetail.getVendorDetailAssignedIdentifier()); } }
Source:
<code>public void testConvertStaticFields() throws Exception { final String resourcePath = "dtables/src/main/resources/guvnor/feature/dtables/StaticFieldsTable.xls"; final ConversionResult conversionResult = convertResource(resourcePath); final List<ConversionMessage> messages = conversionResult.getMessages(); Assertions.assertThat(messages).hasSize(2); SoftAssertions.assertSoftly(softly -> { softly.assertThat(messages.get(0).getMessage()) .isEqualTo("Unable to convert value 'Message.GOODBYE' to NUMERIC_INTEGER. Cell (F11)"); softly.assertThat(messages.get(1).getMessage()) .startsWith("Created Guided Decision Table 'StaticFieldsTable (converted on"); softly.assertThat(messages.get(1).getMessage()) .endsWith(").gdst'"); <START> softly.assertAll(); <END> }); }</code><technical_language>This line is necessary. automatically end of assertSoftly() call</technical_language>

Target:
public void testConvertStaticFields() throws Exception { final String resourcePath = "dtables/src/main/resources/guvnor/feature/dtables/StaticFieldsTable.xls"; final ConversionResult conversionResult = convertResource(resourcePath); final List<ConversionMessage> messages = conversionResult.getMessages(); Assertions.assertThat(messages).hasSize(2); SoftAssertions.assertSoftly(softly -> { softly.assertThat(messages.get(0).getMessage()) .isEqualTo("Unable to convert value 'Message.GOODBYE' to NUMERIC_INTEGER. Cell (F11)"); softly.assertThat(messages.get(1).getMessage()) .startsWith("Created Guided Decision Table 'StaticFieldsTable (converted on"); softly.assertThat(messages.get(1).getMessage()) .endsWith(").gdst'"); }); }
Source:
<code>public void display(final Change change, final Set<ApprovalCategory.Id> need, final List<ApprovalDetail> rows) { changeId = change.getId(); final int oldcnt = table.getRowCount(); table.resizeRows(1 + rows.size()); if (oldcnt < 1 + rows.size()) { for (int row = oldcnt; row < 1 + rows.size(); row++) { applyEdgeStyles(row); applyScoreStyles(row); } } if (rows.isEmpty()) { table.setVisible(false); } else { table.setVisible(true); for (int i = 0; i < rows.size(); i++) { displayRow(i + 1, rows.get(i)); } } missing.clear(); missing.setVisible(false); if (need != null) { for (final ApprovalType at : types) { if (need.contains(at.getCategory().getId())) { final Label l = new Label(Util.M.needApproval(at.getCategory().getName())); l.setStyleName("gerrit-Change-MissingApproval"); missing.add(l); missing.setVisible(true); } } } if (Gerrit.isSignedIn() && change.getStatus().isOpen()) { addReviewer.setVisible(true); } else { <START> addReviewer.setVisible(false); <END> } }</code><technical_language>say: addReviewer.setVisible(Gerrit.isSignedIn() && change.getStatus().isOpen()); save a lot of code</technical_language>

Target:
public void display(final Change change, final Set<ApprovalCategory.Id> need, final List<ApprovalDetail> rows) { changeId = change.getId(); final int oldcnt = table.getRowCount(); table.resizeRows(1 + rows.size()); if (oldcnt < 1 + rows.size()) { for (int row = oldcnt; row < 1 + rows.size(); row++) { applyEdgeStyles(row); applyScoreStyles(row); } } if (rows.isEmpty()) { table.setVisible(false); } else { table.setVisible(true); for (int i = 0; i < rows.size(); i++) { displayRow(i + 1, rows.get(i)); } } missing.clear(); missing.setVisible(false); if (need != null) { for (final ApprovalType at : types) { if (need.contains(at.getCategory().getId())) { final Label l = new Label(Util.M.needApproval(at.getCategory().getName())); l.setStyleName("gerrit-Change-MissingApproval"); missing.add(l); missing.setVisible(true); } } } addReviewer.setVisible(Gerrit.isSignedIn() && change.getStatus().isOpen()); }
Source:
<code>public Response getNearbyCities(@PathParam("wkt") String wkt) { try { String jsonString = geoCoderService.getNearbyCities(wkt); if (jsonString != null) { return Response.ok(jsonString).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } } catch (GeoEntryQueryException e) { LOGGER.debug("Error querying GeoNames resource with wkt:{}", wkt, e); <START> return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); <END> } }</code><technical_language>this internal error a bad request</technical_language>

Target:
public Response getNearbyCities(@PathParam("wkt") String wkt) { try { String jsonString = geoCoderService.getNearbyCities(wkt); if (jsonString != null) { return Response.ok(jsonString).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } } catch (GeoEntryQueryException e) { LOGGER.debug("Error querying GeoNames resource with wkt:{}", wkt, e); return Response.status(Response.Status.BAD_REQUEST).build(); } }
Source:
<code>public Scheduler scheduler(DbSchedulerCustomizer customizer) { log.info("Creating DB Scheduler using tasks from Spring context: {}", configuredTasks); if (existingDataSource instanceof TransactionAwareDataSourceProxy) { log.info("Using a transaction aware DataSource"); } else { <START> log.info("The configured DataSource is not transaction aware: {}", existingDataSource); <END> } final SchedulerBuilder builder = Scheduler.create(existingDataSource, configuredTasks); builder.threads(config.getThreads()); builder.pollingInterval(config.getPollingInterval()); config.getPollingLimit().ifPresent(builder::pollingLimit); builder.heartbeatInterval(config.getHeartbeatInterval()); if (customizer.schedulerName().isPresent()) { builder.schedulerName(customizer.schedulerName().get()); } else if (config.getSchedulerName() != null) { builder.schedulerName(new SchedulerName.Fixed(config.getSchedulerName())); } builder.tableName(config.getTableName()); customizer.serializer().ifPresent(builder::serializer); if (config.isImmediateExecution()) { builder.enableImmediateExecution(); } customizer.executorService().ifPresent(builder::executorService); return builder.build(); }</code><technical_language>consequences here, i.e. operations schedule, reschedule, cancel effect of spanning transaction</technical_language>

Target:
public Scheduler scheduler(DbSchedulerCustomizer customizer) { log.info("Creating db-scheduler using tasks from Spring context: {}", configuredTasks); DataSource transactionalDataSource = configureDataSource(existingDataSource); final SchedulerBuilder builder = Scheduler.create(transactionalDataSource, nonStartupTasks(configuredTasks)); builder.threads(config.getThreads()); builder.pollingInterval(config.getPollingInterval()); config.getPollingLimit().ifPresent(builder::pollingLimit); builder.heartbeatInterval(config.getHeartbeatInterval()); if (customizer.schedulerName().isPresent()) { builder.schedulerName(customizer.schedulerName().get()); } else if (config.getSchedulerName() != null) { builder.schedulerName(new SchedulerName.Fixed(config.getSchedulerName())); } builder.tableName(config.getTableName()); customizer.serializer().ifPresent(builder::serializer); if (config.isImmediateExecutionEnabled()) { builder.enableImmediateExecution(); } customizer.executorService().ifPresent(builder::executorService); builder.startTasks(startupTasks(configuredTasks)); return builder.build(); }
Source:
<code>private Long getLagMetric(@NotNull final Map<MetricName, ? extends Metric> metrics, @NotNull final TopicPartition topicPartition) { if (_consumerMetricsSupport == ConsumerMetricsFormatSupport.NONE) { return null; } if (_consumerMetricsSupport == null) { detectConsumerMetricsSupportAndClientId(metrics); } <START> MetricName metricName = _metricNameCache.get(topicPartition); <END> if (metricName == null) { if (_clientId == null) { detectClientId(metrics); } if (_consumerMetricsSupport == ConsumerMetricsFormatSupport.KIP_92) { Map<String, String> tags = new HashMap<>(); tags.put("client-id", _clientId); metricName = new MetricName(topicPartition + ".records-lag", "consumer-fetch-manager-metrics", "", tags); } if (_consumerMetricsSupport == ConsumerMetricsFormatSupport.KIP_225) { Map<String, String> tags = new HashMap<>(); tags.put("client-id", _clientId); tags.put("topic", topicPartition.topic()); tags.put("partition", String.valueOf(topicPartition.partition())); metricName = new MetricName("records-lag", "consumer-fetch-manager-metrics", "", tags); } if (metricName != null) { _metricNameCache.put(topicPartition, metricName); } } if (metricName != null) { final Metric metric = metrics.get(metricName); if (metric != null) { final Object metricValue = metric.metricValue(); if (metricValue != null) { try { final Double doubleValue = (Double) metricValue; return doubleValue.longValue(); } catch (Exception ignored) { LOG.debug("Metric value implements class and could not be serialized into a long", metricValue, metricValue.getClass()); } } } } return null; }</code><technical_language>nit: if check move line 359 others a switch statement instead</technical_language>

Target:
private Optional<Long> getLagMetric(@NotNull final Map<MetricName, ? extends Metric> metrics, @NotNull final TopicPartition topicPartition) { @Nullable final MetricName metricName = Optional.ofNullable(_metricNameCache.get(topicPartition)) .orElseGet(() -> tryCreateMetricName(topicPartition, metrics.keySet()).orElse(null)); return Optional.ofNullable(metricName) .map(metrics::get) .map(Metric::metricValue) .filter(value -> value instanceof Double) .map(value -> ((Double) value).longValue()); }
Source:
<code>private static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { try { return clazz.getMethod(methodName, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalStateException("Java 8 or later but method " <START> + clazz.getName() + "#" + methodName + "(" + Arrays.toString(parameterTypes) + ") is missing"); <END> } }</code><technical_language>Add original exception cause</technical_language>

Target:
private static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { try { return clazz.getMethod(methodName, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalStateException("Java 8 or later but method " + clazz.getName() + "#" + methodName + "(" + Arrays.toString(parameterTypes) + ") is missing", e); } }
Source:
<code>private void deleteObsoleteRelationships() { CompileContext context = compiler.context(); Set<Long> staleNodeIds = new HashSet<>(); Set<MappedRelationship> relationships = new HashSet<>(mappingContext.getRelationships()); Predicate<Long> canNotBeStale = nodeId -> relationships.stream() .filter(r -> r.getStartNodeId() == nodeId || r.getEndNodeId() == nodeId) .count() > 1; for (MappedRelationship mappedRelationship : relationships) { if (!context.removeRegisteredRelationship(mappedRelationship)) { LOGGER.debug("context-del: {}", mappedRelationship); RelationshipBuilder builder = compiler.unrelate( mappedRelationship.getStartNodeId(), mappedRelationship.getRelationshipType(), mappedRelationship.getEndNodeId(), mappedRelationship.getRelationshipId()); Object entity = mappingContext.getRelationshipEntity(mappedRelationship.getRelationshipId()); if (entity != null) { ClassInfo classInfo = metaData.classInfo(entity); if (classInfo.hasVersionField()) { FieldInfo field = classInfo.getVersionField(); builder.setVersionProperty(field.propertyName(), (Long) field.read(entity)); } } staleNodeIds.add(mappedRelationship.getStartNodeId()); staleNodeIds.add(mappedRelationship.getEndNodeId()); } } do { staleNodeIds.removeIf(canNotBeStale); staleNodeIds.stream() .map(mappingContext::getNodeEntity) .filter(Objects::nonNull) .forEach(node -> mappingContext.removeNodeEntity(node, true)); staleNodeIds = mappingContext.removeStaleRelationships(staleNodeIds); <START> } while (!staleNodeIds.isEmpty()); <END> }</code><technical_language>do..while while? list is empty. I personally prefer in cases avoid function calls put loop conditions top of loop</technical_language>

Target:
private void deleteObsoleteRelationships() { CompileContext context = compiler.context(); Set<Long> staleNodeIds = new HashSet<>(); Set<MappedRelationship> relationships = new HashSet<>(mappingContext.getRelationships()); Predicate<Long> cannotBeStale = nodeId -> relationships.stream() .filter(r -> r.getStartNodeId() == nodeId || r.getEndNodeId() == nodeId) .count() > 1; for (MappedRelationship mappedRelationship : relationships) { if (!context.removeRegisteredRelationship(mappedRelationship)) { LOGGER.debug("context-del: {}", mappedRelationship); RelationshipBuilder builder = compiler.unrelate( mappedRelationship.getStartNodeId(), mappedRelationship.getRelationshipType(), mappedRelationship.getEndNodeId(), mappedRelationship.getRelationshipId()); Object entity = mappingContext.getRelationshipEntity(mappedRelationship.getRelationshipId()); if (entity != null) { ClassInfo classInfo = metaData.classInfo(entity); if (classInfo.hasVersionField()) { FieldInfo field = classInfo.getVersionField(); builder.setVersionProperty(field.propertyName(), (Long) field.read(entity)); } } staleNodeIds.add(mappedRelationship.getStartNodeId()); staleNodeIds.add(mappedRelationship.getEndNodeId()); } } while (!staleNodeIds.isEmpty()) { staleNodeIds.removeIf(cannotBeStale); staleNodeIds.stream() .map(mappingContext::getNodeEntity) .filter(Objects::nonNull) .forEach(node -> mappingContext.removeNodeEntity(node, true)); staleNodeIds = mappingContext.removeStaleRelationships(staleNodeIds); } }
Source:
<code>public ZNRecord update(ZNRecord current) { LockInfo curLockInfo = new LockInfo(current); <START> if (System.currentTimeMillis() > curLockInfo.getTimeout() || isCurrentOwner()) { <END> return _record; } if (!isCurrentOwner() && _priority > curLockInfo.getPriority() && curLockInfo.getRequestorId() .isEmpty()) { ZNRecord newRecord = composeNewRequestorRecord(curLockInfo, _record); _isPending = true; _pendingTimeout = _waitingTimeout > curLockInfo.getCleanupTimeout() ? curLockInfo.getCleanupTimeout() : _waitingTimeout; return newRecord; } if (!isCurrentOwner() && _priority > curLockInfo.getPriority() && !curLockInfo .getRequestorId().isEmpty() && _priority > curLockInfo.getRequestorPriority()) { ZNRecord newRecord = composeNewRequestorRecord(curLockInfo, _record); _isPending = true; long remainingCleanupTime = curLockInfo.getCleanupTimeout() - (System.currentTimeMillis() - curLockInfo .getRequestorRequestingTimestamp()); _pendingTimeout = _waitingTimeout > remainingCleanupTime ? remainingCleanupTime : _waitingTimeout; return newRecord; } LOG.error( "User " + _userId + " tried to update the lock at " + new Date(System.currentTimeMillis()) + ". Lock path: " + _lockPath); throw new HelixException("User is not authorized to perform this operation."); }</code><technical_language>here, concerned isCurrentOwner usage update method</technical_language>

Target:
public ZNRecord update(ZNRecord current) { LockInfo curLockInfo = new LockInfo(current); if (System.currentTimeMillis() > curLockInfo.getTimeout() || isCurrentOwner(curLockInfo)) { return _record; } if (!isCurrentOwner(curLockInfo) && _priority > curLockInfo.getPriority()) { if (curLockInfo.getRequestorId().equals(LockConstants.DEFAULT_USER_ID)) { _pendingTimeout = _waitingTimeout > curLockInfo.getCleanupTimeout() ? curLockInfo.getCleanupTimeout() : _waitingTimeout; } else if (_priority > curLockInfo.getRequestorPriority()) { long remainingCleanupTime = curLockInfo.getCleanupTimeout() - (System.currentTimeMillis() - curLockInfo .getRequestingTimestamp()); _pendingTimeout = _waitingTimeout > remainingCleanupTime ? remainingCleanupTime : _waitingTimeout; } ZNRecord newRecord = composeNewRequestorRecord(curLockInfo, _record); _lockStatus = LockConstants.LockStatus.PENDING; return newRecord; } LOG.error("User failed to acquire lock at Lock path {}.", _userId, _lockPath); throw new HelixException( String.format("User %s failed to acquire lock at Lock path %s.", _userId, _lockPath)); }
Source:
<code>public <E extends RealmModel> E createObject(Class<E> clazz) { checkIfValid(); Table table = schema.getTable(clazz); if (table.hasPrimaryKey()) { throw new RealmException(String.format("'%s' has a primary key, use" + <START> " 'createObject(Class<E>, Object)' to create it.", clazz.getSimpleName())); <END> } long rowIndex = table.addEmptyRow(); return get(clazz, rowIndex); }</code><technical_language>clazz.getSimpleName() returns obfuscated name if ProGuard applied. Table.tableNameToClassName(table.getName()) is I think</technical_language>

Target:
public <E extends RealmModel> E createObject(Class<E> clazz) { checkIfValid(); Table table = schema.getTable(clazz); if (table.hasPrimaryKey()) { throw new RealmException(String.format("'%s' has a primary key, use" + " 'createObject(Class<E>, Object)' instead.", Table.tableNameToClassName(table.getName()))); } long rowIndex = table.addEmptyRow(); return get(clazz, rowIndex); }
Source:
<code><START> public Duration getRetryAfter() { <END> return innerResponse.getRetryAfter(); }</code><technical_language>this non-public? I user needs this do this</technical_language>

Target:
Duration getRetryAfter() { return pollResponse.getRetryAfter(); }
Source:
<code>public void serializeRebal() throws Exception { ClusterManagementResult result1 = new ClusterManagementResult(); result1.setStatus(StatusCode.OK, "Success!!"); RebalanceOperation rebalanceOperation = new RebalanceOperation(); rebalanceOperation.setOperator("operator"); ClusterManagementOperationResult<RebalanceOperation, RebalanceResult> result = new ClusterManagementOperationResult(result1, new Date(), new Date(), <START> rebalanceOperation, "id", new RebalanceResultImpl(), null); <END> String json = mapper.writeValueAsString(result); System.out.println(json); ClusterManagementOperationResult<RebalanceOperation, RebalanceResult> value = mapper.readValue(json, ClusterManagementOperationResult.class); assertThat(value.getStatusMessage()).isEqualTo("Success!!"); assertThat(value).isEqualTo(result); }</code><technical_language>I a fan of "Impl" class. Wondering RebalanceResult a concrete class directly</technical_language>

Target:
public void serializeRebal() throws Exception { RebalanceOperation rebalanceOperation = new RebalanceOperation(); rebalanceOperation.setOperator("operator"); ClusterManagementOperationResult<RebalanceOperation, RebalanceResult> result = new ClusterManagementOperationResult(StatusCode.OK, "Success!!", new Date(), new Date(), rebalanceOperation, "id", new RebalanceResultImpl(), null); String json = mapper.writeValueAsString(result); System.out.println(json); ClusterManagementOperationResult<RebalanceOperation, RebalanceResult> value = mapper.readValue(json, ClusterManagementOperationResult.class); assertThat(value.getStatusMessage()).isEqualTo("Success!!"); assertThat(value).isEqualTo(result); }
Source:
<code>public void shouldHandle5xxFromStripeGateway() throws Exception { DownstreamException downstreamException = new DownstreamException(SC_SERVICE_UNAVAILABLE, "Problem with Stripe servers"); when(client.postRequest(any(URI.class), anyString(), any(Map.class), any(MediaType.class), anyString())).thenThrow(downstreamException); ChargeEntity charge = ChargeEntityFixture.aValidChargeEntity().build(); CancelGatewayRequest request = CancelGatewayRequest.valueOf(charge); final GatewayResponse<BaseCancelResponse> gatewayResponse = stripeCancelHandler.cancel(request); assertThat(gatewayResponse.isFailed(), is(true)); assertThat(gatewayResponse.getGatewayError().isPresent(), Is.is(true)); <START> assertThat(gatewayResponse.getGatewayError().get().getMessage(), containsString("An internal server error occurred while canceling charge_external_id: " + request.getExternalChargeId())); <END> assertThat(gatewayResponse.getGatewayError().get().getErrorType(), Is.is(UNEXPECTED_HTTP_STATUS_CODE_FROM_GATEWAY)); }</code><technical_language>"l"s in "cancelling" in British English</technical_language>

Target:
public void shouldHandle5xxFromStripeGateway() throws Exception { DownstreamException downstreamException = new DownstreamException(SC_SERVICE_UNAVAILABLE, "Problem with Stripe servers"); when(client.postRequest(any(URI.class), anyString(), any(Map.class), any(MediaType.class), anyString())).thenThrow(downstreamException); ChargeEntity charge = ChargeEntityFixture.aValidChargeEntity().build(); CancelGatewayRequest request = CancelGatewayRequest.valueOf(charge); final GatewayResponse<BaseCancelResponse> gatewayResponse = stripeCancelHandler.cancel(request); assertThat(gatewayResponse.isFailed(), is(true)); assertThat(gatewayResponse.getGatewayError().isPresent(), Is.is(true)); assertThat(gatewayResponse.getGatewayError().get().getMessage(), containsString("An internal server error occurred while cancelling external charge id: " + request.getExternalChargeId())); assertThat(gatewayResponse.getGatewayError().get().getErrorType(), Is.is(UNEXPECTED_HTTP_STATUS_CODE_FROM_GATEWAY)); }
Source:
<code>public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if (!control.canEditHashtags()) { throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> existingHashtags = notes.getHashtags(); <START> Set<String> updatedHashtags = new HashSet<>(); <END> Set<String> toAdd = new HashSet<String>( Lists.newArrayList(Splitter.on(CharMatcher.anyOf(",;")) .trimResults().omitEmptyStrings().split(input.hashtags))); if (existingHashtags != null) { updatedHashtags.addAll(existingHashtags); toAdd.removeAll(existingHashtags); } if (toAdd.size() > 0) { updatedHashtags.addAll(toAdd); update.setHashtags(updatedHashtags); update.commit(); indexer.index(dbProvider.get(), update.getChange()); IdentifiedUser currentUser = ((IdentifiedUser) control.getCurrentUser()); hooks.doHashtagsChangedHook( req.getChange(), currentUser.getAccount(), toAdd, null, updatedHashtags, dbProvider.get()); } return Response.ok(updatedHashtags); }</code><technical_language>skip updatedHashtags existingHashtags a finale like: update.setHashtags(existingHashtags.addAll(toAdd)); AFAIC easier understand</technical_language>

Target:
public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if (!control.canEditHashtags()) { throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> hashtags = notes.getHashtags(); Set<String> toAdd = new HashSet<String>( Lists.newArrayList(Splitter.on(CharMatcher.anyOf(",;")) .trimResults().omitEmptyStrings().split(input.hashtags))); if (hashtags != null) { toAdd.removeAll(hashtags); } if (toAdd.size() > 0) { hashtags.addAll(toAdd); update.setHashtags(hashtags); update.commit(); indexer.index(dbProvider.get(), update.getChange()); IdentifiedUser currentUser = ((IdentifiedUser) control.getCurrentUser()); hooks.doHashtagsChangedHook( req.getChange(), currentUser.getAccount(), toAdd, null, hashtags, dbProvider.get()); } return Response.ok(hashtags); }
Source:
<code>public NotificationQueueHandler() { <START> executorService = Executors.newFixedThreadPool(MAX_THREADS); <END> taskMap = new ConcurrentHashMap<>(); }</code><technical_language>want introduce a config for MAX-THREADS. max of threads for sending notifications NotificationServiceImpl pass here</technical_language>

Target:
public NotificationQueueHandler() { this(MAX_THREADS); }
Source:
<code>public StoredConfig getSystemConfig() throws IOException, ConfigInvalidException { if (systemConfig == null) { systemConfig = createSystemConfig(null, FS.DETECTED); } if (systemConfig.isOutdated()) { try { LOG.debug("loading system config {}", systemConfig); systemConfig.load(); } catch (ConfigInvalidException e) { LOG.error( MessageFormat.format( JGitText.get().systemConfigFileInvalid, systemConfig.getFile().getAbsolutePath()), <START> e); <END> throw e; } } return systemConfig; }</code><technical_language>This catch-log-rethrow pattern unnecessary me. callers catch exceptions log themselves. FileRepository InstallBuiltinLfsCommand, log themselves</technical_language>

Target:
public StoredConfig getSystemConfig() throws IOException, ConfigInvalidException { if (systemConfig == null) { systemConfig = createSystemConfig(null, FS.DETECTED); } if (systemConfig.isOutdated()) { LOG.debug("loading system config {}", systemConfig); systemConfig.load(); } return systemConfig; }
Source:
<code>private void logNoDeviceToHotUnplug(List<VmDevice> vmMemoryDevices) { final AuditLogType message = vmMemoryDevices.isEmpty() ? AuditLogType.NO_MEMORY_DEVICE_TO_HOT_UNPLUG : AuditLogType.NO_SUITABLE_MEMORY_DEVICE_TO_HOT_UNPLUG; if (!vmMemoryDevices.isEmpty()) { final int originalMemoryMb = <START> getVm().getMemSizeMb(); <END> addCustomValue(AUDIT_LOG_OLD_MEMORY_MB, String.valueOf(originalMemoryMb)); addCustomValue(AUDIT_LOG_NEW_MEMORY_MB, String.valueOf(getParameters().getVm().getMemSizeMb())); final String unplugOptions = vmMemoryDevices.stream() .filter(VmDeviceCommonUtils::isMemoryDeviceHotUnpluggable) .map(device -> VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(device).get()) .map(deviceSize -> String.format( "%dMB (%dMB)", deviceSize, memoryAfterHotUnplug(originalMemoryMb, deviceSize))) .collect(Collectors.joining(", ")); addCustomValue(AUDIT_LOG_MEMORY_HOT_UNPLUG_OPTIONS, unplugOptions); } auditLogDirector.log(this, message); }</code><technical_language>oldVm more readable I</technical_language>

Target:
private void logNoDeviceToHotUnplug(List<VmDevice> vmMemoryDevices) { final AuditLogType message = vmMemoryDevices.isEmpty() ? AuditLogType.NO_MEMORY_DEVICE_TO_HOT_UNPLUG : AuditLogType.NO_SUITABLE_MEMORY_DEVICE_TO_HOT_UNPLUG; if (!vmMemoryDevices.isEmpty()) { final int originalMemoryMb = oldVm.getMemSizeMb(); addCustomValue(AUDIT_LOG_OLD_MEMORY_MB, String.valueOf(originalMemoryMb)); addCustomValue(AUDIT_LOG_NEW_MEMORY_MB, String.valueOf(getParameters().getVm().getMemSizeMb())); final String unplugOptions = vmMemoryDevices.stream() .filter(VmDeviceCommonUtils::isMemoryDeviceHotUnpluggable) .map(device -> VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(device).get()) .map(deviceSize -> String.format( "%dMB (%dMB)", deviceSize, memoryAfterHotUnplug(originalMemoryMb, deviceSize))) .collect(Collectors.joining(", ")); addCustomValue(AUDIT_LOG_MEMORY_HOT_UNPLUG_OPTIONS, unplugOptions); } auditLogDirector.log(this, message); }
Source:
<code>private void updateStep() { final Collection<UnitCategory> unitsToPlace; final GameData data = getData(); data.acquireReadLock(); try { final GameStep step = data.getSequence().getStep(); if (step == null) { return; } final PlayerId player = step.getPlayerId(); unitsToPlace = getUpdatedUnitsToPlace(lastPlayer, player, step); lastPlayer = player; } finally { data.releaseReadLock(); } SwingUtilities.invokeLater( () -> { JSplitPane splitPane = null; final Component parent = unitsToPlacePanel.getParent(); <START> if (parent instanceof JSplitPane) { <END> splitPane = ((JSplitPane) parent); } if (unitsToPlace != null) { unitsToPlacePanel.setUnitsFromCategories(unitsToPlace); if (!unitsToPlacePanel.isVisible()) { unitsToPlacePanel.setVisible(true); if (splitPane != null) { splitPane.setDividerSize(8); if (!splitPaneWasMinimized) { splitPane.resetToPreferredSizes(); } } } } else { if (splitPane != null) { if (unitsToPlacePanel.isVisible()) { final var dividerBottom = splitPane.getDividerLocation() + splitPane.getDividerSize(); splitPaneWasMinimized = (dividerBottom == splitPane.getHeight()); } splitPane.setDividerSize(0); } unitsToPlacePanel.setVisible(false); unitsToPlacePanel.removeAll(); } }); }</code><technical_language>curious cases parent instance of JSplitPane? this more deterministic? unitsToPlacePanel in a split pane? a reference split pane instead of relying getParent()</technical_language>

Target:
private void updateStep() { final Collection<UnitCategory> unitsToPlace; final boolean showUnitsToPlace; final GameData data = getData(); data.acquireReadLock(); try { final GameStep step = data.getSequence().getStep(); if (step == null) { return; } final PlayerId player = step.getPlayerId(); final boolean isFirstTurn = (player == null || !player.equals(lastPlayer)); if (isFirstTurn) { postProductionStep = false; } showUnitsToPlace = (postProductionStep || (player != null && !player.getUnits().isEmpty())); unitsToPlace = showUnitsToPlace ? UnitSeparator.categorize(player.getUnits()) : null; if (GameStep.isPurchaseOrBidStep(step.getName())) { postProductionStep = true; } lastPlayer = player; if (GameStep.isPlaceStep(step.getName())) { data.addDataChangeListener(this); } else { data.removeDataChangeListener(this); } } finally { data.releaseReadLock(); } SwingUtilities.invokeLater( () -> { if (showUnitsToPlace) { unitsToPlacePanel.setUnitsFromCategories(unitsToPlace); detachedCollapsiblePanel.setVisible(true); unitsToPlacePanel.revalidate(); unitsToPlacePanel.repaint(); } else { detachedCollapsiblePanel.setVisible(false); unitsToPlacePanel.removeAll(); } }); }
Source:
<code><START> public String factoryFileLocation() { <END> return isComplete() ? rawFileLocation(factoryFilename) : null; }</code><technical_language>I Optional<String> fit here</technical_language>

Target:
public String factoryFileLocation() { return rawFileLocation(factoryFilename); }
Source:
<code>public void onExternalViewChange(ExternalView externalView, Set<String> onlineSegments) { _segmentLineageBasedSegmentSelector.onExternalViewChange(); List<String> segmentsToProcess = <START> new ArrayList<>(_segmentLineageBasedSegmentSelector.computeSegmentsToProcess(onlineSegments)); <END> _segments = Collections.unmodifiableList(segmentsToProcess); }</code><technical_language>I unclear extensibility of code in future. add more selectors cascade in future, for example versionBasedSelector/Pruner</technical_language>

Target:
public void onExternalViewChange(ExternalView externalView, Set<String> onlineSegments) { _segments = Collections.unmodifiableList(new ArrayList<>(onlineSegments)); }
Source:
<code><START> public String getHumanishName() { <END> return getHumanishName(getPath()); }</code><technical_language>a more humanish name for this? getDisplayNameI(). reason I -ish in this class is becuase is URI, quite. -ish means "like" in Git context. name returned this method is a "human". is a human all</technical_language>

Target:
public String getHumanishName() throws IllegalArgumentException { if ("".equals(getPath()) || getPath() == null) throw new IllegalArgumentException(); String[] elements = getPath().split("/"); if (elements.length == 0) throw new IllegalArgumentException(); String result = elements[elements.length - 1]; if (DOT_GIT.equals(result)) result = elements[elements.length - 2]; else if (result.endsWith(DOT_GIT)) result = result.substring(0, result.length() - DOT_GIT.length()); if ("".equals(result)) throw new IllegalArgumentException(); return result; }
Source:
<code>public boolean consumes(ISemanticToken token) { IASTNode node= token.getNode(); if (node instanceof IASTName) { if (node instanceof ICPPASTQualifiedName) { return false; } IBinding binding= token.getBinding(); if (binding instanceof ICPPEnumeration) { <START> IType fType = ((ICPPEnumeration) binding).getFixedType(); <END> return fType != null; } } return false; }</code><technical_language>Likewise, want isScoped() here, try heuristically resolve a dependent enumeration checking if enum class</technical_language>

Target:
public boolean consumes(ISemanticToken token) { IASTNode node= token.getNode(); if (node instanceof IASTName) { if (node instanceof ICPPASTQualifiedName) { return false; } IBinding binding= token.getBinding(); if (binding instanceof ICPPUnknownBinding) { binding = heuristicallyResolvesToEnumeration((ICPPUnknownBinding) binding); } if (binding instanceof ICPPEnumeration) { return ((ICPPEnumeration) binding).isScoped(); } } return false; }
Source:
<code>public void respawn() { setHealth(getMaxHealth()); boolean spawnAtBed = false; Location dest = world.getSpawnLocation(); if (bedSpawn != null) { if (bedSpawn.getBlock().getType() == Material.BED_BLOCK) { dest = bedSpawn.clone(); spawnAtBed = true; } } PlayerRespawnEvent event = new PlayerRespawnEvent(this, dest, spawnAtBed); EventFactory.callEvent(event); <START> if (event.getRespawnLocation().getWorld() == location.getWorld() && knownEntities.size() > 0) { <END> List<Integer> entityIds = new ArrayList<>(knownEntities.size()); for (GlowEntity e : knownEntities) { entityIds.add(e.getEntityId()); } session.send(new DestroyEntitiesMessage(entityIds)); knownEntities.clear(); } spawnAt(event.getRespawnLocation()); updateInventory(); }</code><technical_language>equals</technical_language>

Target:
public void respawn() { setHealth(getMaxHealth()); boolean spawnAtBed = false; Location dest = world.getSpawnLocation(); if (bedSpawn != null) { if (bedSpawn.getBlock().getType() == Material.BED_BLOCK) { dest = bedSpawn.clone(); spawnAtBed = true; } } PlayerRespawnEvent event = new PlayerRespawnEvent(this, dest, spawnAtBed); EventFactory.callEvent(event); if (event.getRespawnLocation().getWorld().equals(getWorld()) && knownEntities.size() > 0) { List<Integer> entityIds = new ArrayList<>(knownEntities.size()); for (GlowEntity e : knownEntities) { entityIds.add(e.getEntityId()); } session.send(new DestroyEntitiesMessage(entityIds)); knownEntities.clear(); } spawnAt(event.getRespawnLocation()); updateInventory(); }
Source:
<code>public void bulk() { QEmployee emp1 = new QEmployee("emp1"); SQLInsertClause insert = new SQLInsertClause(null, SQLTemplates.DEFAULT, emp1); insert.set(emp1.id, 1); insert.addBatch(); insert.set(emp1.id, 2); insert.addBatch(); insert.addFlag(QueryFlag.Position.END, " on duplicate key ignore"); insert.setBatchToBulk(true); <START> assertEquals("nsert into EMPLOYEE (ID)\n" + <END> "values (?), (?) on duplicate key ignore", insert.getSQL().get(0).getSQL()); }</code><technical_language>Typo</technical_language>

Target:
public void bulk() { QEmployee emp1 = new QEmployee("emp1"); SQLInsertClause insert = new SQLInsertClause(null, SQLTemplates.DEFAULT, emp1); insert.set(emp1.id, 1); insert.addBatch(); insert.set(emp1.id, 2); insert.addBatch(); insert.addFlag(QueryFlag.Position.END, " on duplicate key ignore"); insert.setBatchToBulk(true); assertEquals("insert into EMPLOYEE (ID)\n" + "values (?), (?) on duplicate key ignore", insert.getSQL().get(0).getSQL()); }
Source:
<code>public UrlBuilder(String url) { JavaScriptObject jso = parseUrl(url); JSONObject o = new JSONObject(jso); setHost(o.get("host").isString().stringValue()); setProtocol(o.get("protocol").isString().stringValue()); if(o.containsKey("port") && !Strings.isNullOrEmpty(o.get("port").isString().stringValue())) { <START> setPort(Integer.valueOf(o.get("port").isString().stringValue())); <END> } setPath(o.get("path").isString().stringValue()); JSONObject query = o.get("queryKey").isObject(); for (String key : query.keySet()) { setParameter(key, query.get(key).isString().stringValue()); } }</code><technical_language>In lines 41 42 o.get("port").isString().stringValue(). Pay attention method JSONObject#get simple seem. I nice move o.get("port").isString().stringValue() local variable. lines more simpler for reading. WDYT</technical_language>

Target:
public UrlBuilder(String url) { JavaScriptObject jso = parseUrl(url); JSONObject o = new JSONObject(jso); setHost(o.get("host").isString().stringValue()); setProtocol(o.get("protocol").isString().stringValue()); if (o.containsKey("port")) { final String port = o.get("port").isString().stringValue(); if (!port.isEmpty()) { setPort(Integer.valueOf(port)); } } setPath(o.get("path").isString().stringValue()); JSONObject query = o.get("queryKey").isObject(); for (String key : query.keySet()) { setParameter(key, query.get(key).isString().stringValue()); } }
Source:
<code>public void before() { <START> domain = coreSession.createDocumentModel("/", "Folder", "Folder"); <END> domain = coreSession.createDocument(domain); coreSession.save(); addPermissions(domain, "james"); addPermissions(domain, "bob"); }</code><technical_language>domain sounds weird a regular folder</technical_language>

Target:
public void before() { folder = coreSession.createDocumentModel("/", "Folder", "Folder"); folder = coreSession.createDocument(folder); coreSession.save(); addPermissions(folder, "james"); addPermissions(folder, "bob"); }
Source:
<code>public void addError(AuditEvent event) { if (event.getSeverityLevel() != SeverityLevel.IGNORE) { writer.print("<error" + " line=\"" + event.getLine() + "\""); if (event.getColumn() > 0) { writer.print(" column=\"" + event.getColumn() + "\""); } writer.print(" severity=\"" + event.getSeverityLevel().getName() + "\""); writer.print(" message=\"" + encode(event.getMessage()) + "\""); if (event.getModuleId() == null) { writer.println(" source=\"" + encode(event.getSourceName()) + "\"/>"); } else { <START> writer.println(" id=\"" <END> + encode(event.getModuleId()) + "\"/>"); } } }</code><technical_language>is this surrounded if if attributes for different. in XML file if wish. completely overriding source in CLI output show ID, do exact in XML. this attribute name source id</technical_language>

Target:
public void addError(AuditEvent event) { if (event.getSeverityLevel() != SeverityLevel.IGNORE) { writer.print("<error" + " line=\"" + event.getLine() + "\""); if (event.getColumn() > 0) { writer.print(" column=\"" + event.getColumn() + "\""); } writer.print(" severity=\"" + event.getSeverityLevel().getName() + "\""); writer.print(" message=\"" + encode(event.getMessage()) + "\""); writer.print(" source=\""); if (event.getModuleId() == null) { writer.print(encode(event.getSourceName())); } else { writer.print(encode(event.getModuleId())); } writer.println("\"/>"); } }
Source:
<code>public int compareTo(PerunBean perunBean) { if(perunBean == null) throw new NullPointerException("PerunBean to compare with is null."); if(perunBean instanceof Group) { Group group = (Group) perunBean; if (this.getName() == null && group.getName() != null) return -1; if (group.getName() == null && this.getName() != null) return 1; if (this.getName() == null && group.getName() == null) return 0; <START> return this.getName().toLowerCase().compareToIgnoreCase(group.getName()); <END> } else { return (this.getId() - perunBean.getId()); } }</code><technical_language>reason convert this.getName() lowercase comparing ignore case ? this method honor equals() possible. => groups name case for Perun based equals()</technical_language>

Target:
public int compareTo(PerunBean perunBean) { if(perunBean == null) throw new NullPointerException("PerunBean to compare with is null."); if(perunBean instanceof Group) { Group group = (Group) perunBean; if (this.getName() == null && group.getName() != null) return -1; if (group.getName() == null && this.getName() != null) return 1; if (this.getName() == null && group.getName() == null) return 0; return this.getName().compareToIgnoreCase(group.getName()); } else { return (this.getId() - perunBean.getId()); } }
Source:
<code>public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { <START> super.processBindingConfiguration(context, item, bindingConfig); <END> FatekPLCItem config = FatekPLCItem.parseBindingConfiguration(item, bindingConfig); addBindingConfig(item, config); }</code><technical_language>Move end of method, in case parsing throws bcpe</technical_language>

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { FatekPLCItem config = FatekPLCItem.parseBindingConfiguration(item, bindingConfig); addBindingConfig(item, config); super.processBindingConfiguration(context, item, bindingConfig); }
Source:
<code>public boolean isCursorResetInProgress() { if (cursorResetCache == null) { return false; } return cursorResetCache.getCurrentData() != null; <START> } <END></code><technical_language>stupid, I get this code. time call subscribeForCursorsReset() cursorResetCache built. call for isCursorResetInProgress is dependent previous call. (and btw do work time, StartingState is initialized StreamingState)</technical_language>

Target:
public boolean isCursorResetInProgress() { try { return curatorFramework.checkExists().forPath(resetCursorPath) != null; } catch (final Exception e) { } return false; }
Source:
<code><START> public boolean complete() { <END> return true; }</code><technical_language>This method need return anything. completed, connection considered 'closed'</technical_language>

Target:
public void complete() { }