auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldNotUnpausePipelineWhenPipelineIsAlreadyUnaused() throws Exception { setUpValidPipelineWithAuth(); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); when(pipelineDao.pauseState(VALID_PIPELINE)).thenReturn(new PipelinePauseInfo(false, "", VALID_USER.getUsername().toString())); pipelinePauseService.unpause(VALID_PIPELINE, VALID_USER, result); assertThat(result.isSuccessful(), is(false)); assertThat(result.httpCode(), is(412)); }

Target:
public void shouldNotUnpausePipelineWhenPipelineIsAlreadyUnaused() throws Exception { setUpValidPipelineWithAuth(); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); when(pipelineDao.pauseState(VALID_PIPELINE)).thenReturn(new PipelinePauseInfo(false, "", VALID_USER.getUsername().toString())); pipelinePauseService.unpause(VALID_PIPELINE, VALID_USER, result); assertThat(result.isSuccessful(), is(false)); assertThat(result.httpCode(), is(409)); }
Source:
public boolean isElementHasClass(String elementId, String targetClass) { try { String classNames = browser.driver.findElement(By.id(elementId)).getAttribute("class"); for (String className : classNames.split(" ")) { if (className.equals(targetClass)) { return true; } } return false; } catch (NoSuchElementException e) { return false; } }

Target:
public boolean isElementHasClass(String elementId, String targetClass) { List<WebElement> elementsMatched = browser.driver.findElements(By.cssSelector("#" + elementId + "." + targetClass)); return !elementsMatched.isEmpty(); }
Source:
public CruiseConfig update(CruiseConfig cruiseConfig) { if (partial != null && fingerprint != null) { cruiseConfig.getPartials().remove(resolver.findPartialByFingerprint(cruiseConfig, fingerprint)); cruiseConfig.getPartials().add(CLONER.deepClone(partial)); for (PartialConfig partial : cruiseConfig.getPartials()) { for (EnvironmentConfig environmentConfig : partial.getEnvironments()) { if (!cruiseConfig.getEnvironments().hasEnvironmentNamed(environmentConfig.name())) { cruiseConfig.addEnvironment(new BasicEnvironmentConfig(environmentConfig.name())); } } for (PipelineConfigs pipelineConfigs : partial.getGroups()) { if (!cruiseConfig.getGroups().hasGroup(pipelineConfigs.getGroup())) { cruiseConfig.getGroups().add(new BasicPipelineConfigs(pipelineConfigs.getGroup(), new Authorization())); } } } } return cruiseConfig; }

Target:
public CruiseConfig update(CruiseConfig cruiseConfig) { if (partial != null && fingerprint != null) { PartialConfig config = resolver.findPartialByFingerprint(cruiseConfig, fingerprint); if (null != config) { cruiseConfig.getPartials().remove(config); } cruiseConfig.getPartials().add(CLONER.deepClone(partial)); for (PartialConfig partial : cruiseConfig.getPartials()) { for (EnvironmentConfig environmentConfig : partial.getEnvironments()) { if (!cruiseConfig.getEnvironments().hasEnvironmentNamed(environmentConfig.name())) { cruiseConfig.addEnvironment(new BasicEnvironmentConfig(environmentConfig.name())); } } for (PipelineConfigs pipelineConfigs : partial.getGroups()) { if (!cruiseConfig.getGroups().hasGroup(pipelineConfigs.getGroup())) { cruiseConfig.getGroups().add(new BasicPipelineConfigs(pipelineConfigs.getGroup(), new Authorization())); } } } } return cruiseConfig; }
Source:
public void updateOptions(Options options) { options.addOption(Option.builder("l") .longOpt("log-name") .desc("Log name") .required() .hasArg() .argName("LOG_NAME") .build()); options.addOption( Option.builder("g").longOpt("group").desc("Consumer group").hasArg().argName("GROUP").build()); options.addOption(Option.builder("r") .longOpt("reset") .desc("Resets all committed positions for the group") .build()); options.addOption(Option.builder("e") .longOpt("to-end") .desc("Set the current position to the end for all partitions") .build()); options.addOption(Option.builder("t") .longOpt("to-timestamp") .desc("Sets the current position to a message >= timestamp eg. " + Instant.now()) .hasArg() .argName("TIMESTAMP") .build()); }

Target:
public void updateOptions(Options options) { options.addOption(Option.builder("l") .longOpt("log-name") .desc("Log name") .required() .hasArg() .argName("LOG_NAME") .build()); options.addOption( Option.builder("g").longOpt("group").desc("Consumer group").hasArg().argName("GROUP").build()); options.addOption(Option.builder() .longOpt("reset") .desc("Resets all committed positions for the group") .build()); options.addOption(Option.builder() .longOpt("to-end") .desc("Sets the committed positions to the end of partitions for the group") .build()); options.addOption(Option.builder() .longOpt("to-timestamp") .desc("Sets the committed positions for the group to a specific timestamp." + " The record timestamp used depends on the implementation, for Kafka this is the LogAppendTime. " + " The timestamp is specified in ISO-8601 format, eg. " + Instant.now() + ". If no record offset is found with an appropriate timestamp then the command fails.") .hasArg() .argName("TIMESTAMP") .build()); }
Source:
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); if (line.length() == 0) { 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; }

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:
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; }

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:
public int hashCode() { 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; }

Target:
public int hashCode() { return Objects.hash(x, y); }
Source:
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); } } ServiceLoader.load(IModule.class).forEach(result::add); return result; }

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:
public boolean removeAll(@NonNull Collection<?> collection) { final boolean succeeded = networks.removeAll(collection); 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); }

Target:
public boolean removeAll(@NonNull Collection<?> collection) { boolean succeeded = false; Iterator netIter = collection.iterator(); while (netIter.hasNext()) { succeeded |= remove(netIter.next()); } return succeeded; }
Source:
protected void executeCommand() { log.debug("Triggred 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); } }

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:
private void populateContactEmail(PaymentWorksVendor pmwVendor, VendorDetail vendorDetail) { List<VendorContact> vendorInformationContacts = findAllActiveVendorInformationContacts(vendorDetail.getVendorContacts()); if (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()); } }

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:
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'"); softly.assertAll(); }); }

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:
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 { addReviewer.setVisible(false); } }

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:
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.INTERNAL_SERVER_ERROR).build(); } }

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:
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 { log.info("The configured DataSource is not transaction aware: {}", existingDataSource); } 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(); }

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:
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); } MetricName metricName = _metricNameCache.get(topicPartition); 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; }

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:
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"); } }

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:
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); } while (!staleNodeIds.isEmpty()); }

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:
public ZNRecord update(ZNRecord current) { LockInfo curLockInfo = new LockInfo(current); if (System.currentTimeMillis() > curLockInfo.getTimeout() || isCurrentOwner()) { 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."); }

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:
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)' to create it.", clazz.getSimpleName())); } long rowIndex = table.addEmptyRow(); return get(clazz, rowIndex); }

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:
public Duration getRetryAfter() { return innerResponse.getRetryAfter(); }

Target:
Duration getRetryAfter() { return pollResponse.getRetryAfter(); }
Source:
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(), 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); }

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:
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 canceling charge_external_id: " + request.getExternalChargeId())); assertThat(gatewayResponse.getGatewayError().get().getErrorType(), Is.is(UNEXPECTED_HTTP_STATUS_CODE_FROM_GATEWAY)); }

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:
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(); Set<String> updatedHashtags = new HashSet<>(); 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); }

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:
public NotificationQueueHandler() { executorService = Executors.newFixedThreadPool(MAX_THREADS); taskMap = new ConcurrentHashMap<>(); }

Target:
public NotificationQueueHandler() { this(MAX_THREADS); }
Source:
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()), e); throw e; } } return systemConfig; }

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:
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 = getVm().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); }

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:
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(); if (parent instanceof JSplitPane) { 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(); } }); }

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:
public String factoryFileLocation() { return isComplete() ? rawFileLocation(factoryFilename) : null; }

Target:
public String factoryFileLocation() { return rawFileLocation(factoryFilename); }
Source:
public void onExternalViewChange(ExternalView externalView, Set<String> onlineSegments) { _segmentLineageBasedSegmentSelector.onExternalViewChange(); List<String> segmentsToProcess = new ArrayList<>(_segmentLineageBasedSegmentSelector.computeSegmentsToProcess(onlineSegments)); _segments = Collections.unmodifiableList(segmentsToProcess); }

Target:
public void onExternalViewChange(ExternalView externalView, Set<String> onlineSegments) { _segments = Collections.unmodifiableList(new ArrayList<>(onlineSegments)); }
Source:
public String getHumanishName() { return getHumanishName(getPath()); }

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:
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) { IType fType = ((ICPPEnumeration) binding).getFixedType(); return fType != null; } } return false; }

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:
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() == location.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(); }

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:
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("nsert into EMPLOYEE (ID)\n" + "values (?), (?) on duplicate key ignore", insert.getSQL().get(0).getSQL()); }

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:
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())) { setPort(Integer.valueOf(o.get("port").isString().stringValue())); } setPath(o.get("path").isString().stringValue()); JSONObject query = o.get("queryKey").isObject(); for (String key : query.keySet()) { setParameter(key, query.get(key).isString().stringValue()); } }

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:
public void before() { domain = coreSession.createDocumentModel("/", "Folder", "Folder"); domain = coreSession.createDocument(domain); coreSession.save(); addPermissions(domain, "james"); addPermissions(domain, "bob"); }

Target:
public void before() { folder = coreSession.createDocumentModel("/", "Folder", "Folder"); folder = coreSession.createDocument(folder); coreSession.save(); addPermissions(folder, "james"); addPermissions(folder, "bob"); }
Source:
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 { writer.println(" id=\"" + encode(event.getModuleId()) + "\"/>"); } } }

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:
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().toLowerCase().compareToIgnoreCase(group.getName()); } else { return (this.getId() - perunBean.getId()); } }

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:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); FatekPLCItem config = FatekPLCItem.parseBindingConfiguration(item, bindingConfig); addBindingConfig(item, config); }

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:
public boolean isCursorResetInProgress() { if (cursorResetCache == null) { return false; } return cursorResetCache.getCurrentData() != null; }

Target:
public boolean isCursorResetInProgress() { try { return curatorFramework.checkExists().forPath(resetCursorPath) != null; } catch (final Exception e) { } return false; }
Source:
public boolean complete() { return true; }

Target:
public void complete() { }
Source:
public void execute(Tuple tuple) { try { Thread.sleep(3000); } catch (Exception ex) { } String key = tuple.getString(0); System.out.println(key); if (myState.get(key) == null) { myState.put(key, 1); } else { Integer val = myState.get(key); myState.put(key, ++val); } }

Target:
public void execute(Tuple tuple) { String key = tuple.getString(0); if (myState.get(key) == null) { myState.put(key, 1); } else { Integer val = myState.get(key); myState.put(key, ++val); } }