auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<DispoItem> copyData(Map<String, ArtifactReadable> nameToCoverageUnit, List<DispoItem> dispoItems, OperationReport report) { Map<String, DispoItem> nameToDispoItem = getNameToDispoItemMap(dispoItems); List<DispoItem> modifiedItems = new ArrayList<DispoItem>(); <START> <END> for (String name : nameToCoverageUnit.keySet()) { ArtifactReadable coverageUnit = nameToCoverageUnit.get(name); DispoItem dispoItem = nameToDispoItem.get(name); if (dispoItem != null) { List<DispoAnnotationData> newAnnotations = copyCoverageData(coverageUnit, dispoItem, report); if (!newAnnotations.isEmpty()) { DispoItemData newItem = new DispoItemData(); newItem.setName(dispoItem.getName()); newItem.setGuid(dispoItem.getGuid()); newItem.setAnnotationsList(DispoUtil.listAsJsonArray(newAnnotations)); String newStatus; try { newItem.setDiscrepanciesList(dispoItem.getDiscrepanciesList()); newStatus = dispoConnector.getItemStatus(newItem); newItem.setStatus(newStatus); } catch (JSONException ex) { } modifiedItems.add(newItem); } } } return modifiedItems; }</code><technical_language>entrySet instead of keySet. map get artifact. for (Entry<String, ArtifactReadable> entry = nameToCoverageUnit.entrySet()) {</technical_language>

Target:
public List<DispoItem> copyData(Map<String, ArtifactReadable> nameToCoverageUnit, List<DispoItem> dispoItems, OperationReport report) { Map<String, DispoItem> nameToDispoItem = getNameToDispoItemMap(dispoItems); List<DispoItem> modifiedItems = new ArrayList<DispoItem>(); for (Entry<String, ArtifactReadable> entry : nameToCoverageUnit.entrySet()) { DispoItem dispoItem = nameToDispoItem.get(entry.getKey()); if (dispoItem != null) { List<DispoAnnotationData> newAnnotations = copyCoverageData(entry.getValue(), dispoItem, report); if (!newAnnotations.isEmpty()) { DispoItemData newItem = new DispoItemData(); newItem.setName(dispoItem.getName()); newItem.setGuid(dispoItem.getGuid()); newItem.setAnnotationsList(DispoUtil.listAsJsonArray(newAnnotations)); String newStatus; try { newItem.setDiscrepanciesList(dispoItem.getDiscrepanciesList()); newStatus = dispoConnector.getItemStatus(newItem); newItem.setStatus(newStatus); } catch (JSONException ex) { report.addMessageForItem(newItem.getName(), "Could not determine Status"); } modifiedItems.add(newItem); } } } return modifiedItems; }
Source:
<code>private PaymentWorksVendor pmwPendingNewVendorRequestInitialSaveToKfsStagingTable(PaymentWorksVendor pmwVendor) { LOG.info("pmwPendingNewVendorRequestSavesToKfsStagingTableSuccessful: entered"); <START> pmwVendor.setPmwRequestStatus(PaymentWorksConstants.PaymentWorksNewVendorRequestStatusType.PENDING.getText()); <END> pmwVendor.setPmwTransactionType(PaymentWorksConstants.PaymentWorksTransactionType.NEW_VENDOR); pmwVendor.setKfsVendorProcessingStatus(PaymentWorksConstants.KFSVendorProcessingStatus.VENDOR_REQUESTED); PaymentWorksVendor savedNewVendorRequestedDetail = null; savedNewVendorRequestedDetail = getPaymentWorksVendorDao().savePaymentWorksVendorToStagingTable(pmwVendor); return savedNewVendorRequestedDetail; }</code><technical_language>part pmwVendor fields updated extracted in a separate method</technical_language>

Target:
private PaymentWorksVendor pmwPendingNewVendorRequestInitialSaveToKfsStagingTable(PaymentWorksVendor pmwVendor) { LOG.info("pmwPendingNewVendorRequestSavesToKfsStagingTableSuccessful: entered"); pmwVendor = setStatusValuesForPaymentWorksPendingNewVendorRequestedInKfs(pmwVendor); PaymentWorksVendor savedNewVendorRequestedDetail = null; savedNewVendorRequestedDetail = savePaymentWorksVendorToStagingTable(pmwVendor); return savedNewVendorRequestedDetail; }
Source:
<code>public void multiple_assignment() { PyFunctionDefTree functionTree = functionTreesByName.get("multiple_assignment"); Set<TreeSymbol> symbols = functionTree.localVariables(); <START> Map<String, TreeSymbol> symbolByName = symbols.stream().collect(Collectors.toMap(TreeSymbol::name, Functions.identity())); <END> assertThat(symbolByName.keySet()).containsOnly("x", "y"); int functionStartLine = functionTree.firstToken().getLine(); TreeSymbol x = symbolByName.get("x"); assertThat(x.usages()).extracting(tree -> tree.firstToken().getLine()).containsOnly(functionStartLine + 1); TreeSymbol y = symbolByName.get("y"); assertThat(y.usages()).extracting(tree -> tree.firstToken().getLine()).containsOnly(functionStartLine + 1); }</code><technical_language>factorizing 2 3 lines in a method in test cases</technical_language>

Target:
public void multiple_assignment() { PyFunctionDefTree functionTree = functionTreesByName.get("multiple_assignment"); Map<String, TreeSymbol> symbolByName = getSymbolByName(functionTree); assertThat(symbolByName.keySet()).containsOnly("x", "y"); int functionStartLine = functionTree.firstToken().token().getLine(); TreeSymbol x = symbolByName.get("x"); assertThat(x.usages()).extracting(usage -> usage.tree().firstToken().token().getLine()).containsOnly(functionStartLine + 1); assertThat(x.usages()).extracting(Usage::kind).containsOnly(Usage.Kind.ASSIGNMENT_LHS); TreeSymbol y = symbolByName.get("y"); assertThat(y.usages()).extracting(usage -> usage.tree().firstToken().token().getLine()).containsOnly(functionStartLine + 1); assertThat(y.usages()).extracting(Usage::kind).containsOnly(Usage.Kind.ASSIGNMENT_LHS); }
Source:
<code>protected void safeRun(IProgressMonitor progressMonitor) throws Exception { try <START> { <END> target.createRepository(repositoryName, CDOAdmin.TYPE_DEFAULT, repositoryProperties); } finally { repositoryName = null; repositoryProperties = null; } }</code><technical_language>type configurable somehow</technical_language>

Target:
protected void safeRun(IProgressMonitor progressMonitor) throws Exception { try { target.createRepository(repositoryName, CDOAdmin.DEFAULT_TYPE, repositoryProperties); } finally { repositoryName = null; repositoryProperties = null; } }
Source:
<code>public void shouldSendEventIfTheUserShouldResetPassword() throws Exception { List<MotechUser> users = prepareMotechUsersOne(); when(settingService.isPasswordResetReminderEnabled()).thenReturn(true); when(allUsers.retrieveAll()).thenReturn(users); eventHandler.handleEvent(event); List<MotechEvent> expectedEvent = prepareExpectedEvent(users); verify(allUsers, times(1)).retrieveAll(); verify(eventRelay, times(2)).sendEventMessage(eventCaptor.capture()); <START> verify(settingService, times(1)).isPasswordResetReminderEnabled(); <END> verify(settingService, times(1)).getNumberOfDaysForReminder(); verify(settingService, times(1)).getNumberOfDaysToChangePassword(); assertEquals(expectedEvent, eventCaptor.getAllValues()); }</code><technical_language>drop times(1)</technical_language>

Target:
public void shouldSendEventIfTheUserShouldResetPassword() throws Exception { List<MotechUser> users = prepareMotechUsersOne(); when(settingService.isPasswordResetReminderEnabled()).thenReturn(true); when(allUsers.retrieveAll()).thenReturn(users); eventHandler.handleEvent(event); List<MotechEvent> expectedEvent = prepareExpectedEvent(users); verify(allUsers).retrieveAll(); verify(eventRelay, times(2)).sendEventMessage(eventCaptor.capture()); verify(settingService).isPasswordResetReminderEnabled(); verify(settingService).getNumberOfDaysForReminder(); verify(settingService).getNumberOfDaysToChangePassword(); assertEquals(expectedEvent, eventCaptor.getAllValues()); }
Source:
<code>int commitAll() { if (rebalanceInProgress) { return -1; } else { final Map<TaskId, Map<TopicPartition, OffsetAndMetadata>> consumedOffsetsAndMetadataPerTask = new HashMap<>(); for (final Task task : tasks.values()) { if (task.commitNeeded()) { consumedOffsetsAndMetadataPerTask.put(task.id(), task.prepareCommit()); <START> task.markCommitted(); <END> } } commit(consumedOffsetsAndMetadataPerTask); return consumedOffsetsAndMetadataPerTask.size(); } }</code><technical_language>I prefer a loop guarantee a consistent reflection task committed state</technical_language>

Target:
int commitAll() { if (rebalanceInProgress) { return -1; } else { int committed = 0; final Map<TaskId, Map<TopicPartition, OffsetAndMetadata>> consumedOffsetsAndMetadataPerTask = new HashMap<>(); for (final Task task : tasks.values()) { if (task.commitNeeded()) { task.prepareCommit(); final Map<TopicPartition, OffsetAndMetadata> offsetAndMetadata = task.committableOffsetsAndMetadata(); if (!offsetAndMetadata.isEmpty()) { consumedOffsetsAndMetadataPerTask.put(task.id(), offsetAndMetadata); } } } commitOffsetsOrTransaction(consumedOffsetsAndMetadataPerTask); for (final Task task : tasks.values()) { if (task.commitNeeded()) { ++committed; task.postCommit(); } } return committed; } }
Source:
<code>private byte[] generateBytes(Strategy strategy) { switch (strategy) { case SECURE_RANDOM: <START> return generateRandomBytes(20, Holder.SECURE_RANDOM); <END> case SHORT_SECURE_RANDOM: return generateRandomBytes(5, Holder.SECURE_RANDOM); case SHORT_RANDOM: return generateRandomBytes(5, ThreadLocalRandom.current()); case SEQUENTIAL_UUID: default: return Holder.UNIQUE_ID.getId(); } }</code><technical_language>change 16 20</technical_language>

Target:
private byte[] generateBytes(Strategy strategy) { switch (strategy) { case SECURE_RANDOM: return generateRandomBytes(16, Holder.SECURE_RANDOM); case LONG_SECURE_RANDOM: return generateRandomBytes(20, Holder.SECURE_RANDOM); case SHORT_SECURE_RANDOM: return generateRandomBytes(5, Holder.SECURE_RANDOM); case SHORT_RANDOM: return generateRandomBytes(5, ThreadLocalRandom.current()); case SEQUENTIAL_UUID: default: return Holder.UNIQUE_ID.getId(); } }
Source:
<code>public TokenCredential build() { if (environment == null) { throw new IllegalArgumentException("To build a spring credential the environment must be set"); } List<TokenCredential> tokenCredentials = new ArrayList<>(); if (alternativePrefix != null) { <START> tokenCredentials.add(populateTokenCredential(alternativePrefix)); <END> } tokenCredentials.add(populateDefaultTokenCredential()); return new ChainedTokenCredentialBuilder().addAll(tokenCredentials).build(); }</code><technical_language>If alternativePrefix is null, get managed identity credential if is prefixed configuration in Environment. order be: - Check alternativePrefix client-id, client-secret - Check alternativePrefix client-id, client-certificate-path - If is alternativePrefix client-id, try managed identity client-id - Check default prefix client-id, client-secret - Check default prefix client-id, client-certificate-path - If is default prefix client-id, try managed identity client-id - managed identity argument -</technical_language>

Target:
public TokenCredential build() { if (environment == null) { throw new IllegalArgumentException("To build a spring credential the environment must be set."); } List<TokenCredential> tokenCredentials = new ArrayList<>(); if (alternativePrefix != null) { addToChain(tokenCredentials, populateTokenCredentialBasedOnClientId(alternativePrefix)); } addToChain(tokenCredentials, populateTokenCredentialBasedOnClientId(AZURE_CREDENTIAL_PREFIX)); addToChain(tokenCredentials, defaultManagedIdentityCredential()); return new ChainedTokenCredentialBuilder().addAll(tokenCredentials).build(); }
Source:
<code>private synchronized void updatePostWithMediaUrl(MediaModel media){ if (media != null) { PostModel post = mPostStore.getPostByLocalPostId(media.getPostId()); if (post != null) { String content = post.getContent(); if (content != null) { MediaUploadReadyProcessor processor = new MediaUploadReadyProcessor(); <START> PostModel modifiedPost = processor.replaceMediaFileWithUrlInPost(post, String.valueOf(media.getId()), FluxCUtils.mediaFileFromMediaModel(media)); <END> if (modifiedPost != null) { post = modifiedPost; } if (!post.isLocalDraft()) { post.setIsLocallyChanged(true); } post.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); savePostToDb(post); } } } }</code><technical_language>This unsafe - post open in editor this happens, guarantee editor receive OnMediaUploaded event media service does. In case some data loss. currently implemented, need a if post is currently open in editor, in case leave editor substitution</technical_language>

Target:
private synchronized void updatePostWithMediaUrl(MediaModel media){ if (media != null) { PostModel post = mPostStore.getPostByLocalPostId(media.getPostId()); if (post != null) { MediaUploadReadyListener processor = new MediaUploadReadyProcessor(); PostModel modifiedPost = processor.replaceMediaFileWithUrlInPost(post, String.valueOf(media.getId()), FluxCUtils.mediaFileFromMediaModel(media)); if (modifiedPost != null) { post = modifiedPost; } if (!post.isLocalDraft()) { post.setIsLocallyChanged(true); } post.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); savePostToDb(post); } } }
Source:
<code>public void test() throws Exception { <START> final Random rnd = new Random(0); <END> final int iterations = 20; for(int i = 0; i < iterations; i++) { Collections.shuffle(inputRanges, rnd); doTest(inputRanges); } }</code><technical_language>RandomUtils RandomUtilsSeedingRule</technical_language>

Target:
public void test() throws Exception { Collections.shuffle(inputRanges, RandomUtils.instance()); doTest(inputRanges); }
Source:
<code>protected void executeCommand() { getParameters().setEntityInfo(getEntityInfo()); setSucceeded(true); if <START> (images != null && !images.isEmpty()) <END> { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }</code><technical_language>Another option initialize "images" empty "ArrayList", "CollectionUtils.isNotEmpty(images)", good well</technical_language>

Target:
protected void executeCommand() { getParameters().setEntityInfo(getEntityInfo()); setSucceeded(true); if (images != null && !images.isEmpty()) { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(ovfEntityData.getEntityId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }
Source:
<code>public void applyConstraint(Layer layer, int iteration, int epoch) { Map<String,INDArray> paramTable = layer.paramTable(); if(paramTable == null || paramTable.isEmpty() ){ return; } ParamInitializer i = layer.conf().getLayer().initializer(); for(Map.Entry<String,INDArray> e : paramTable.entrySet()){ if(applyToWeights && i.isWeightParam(e.getKey()) || applyToBiases && i.isBiasParam(e.getKey())){ <START> apply(e.getValue(), i.isBiasParam(e.getKey())); <END> } } }</code><technical_language>replace i.isBiasParam(e.getKey() simply true?! a while realise matter here, this specifically bias,</technical_language>

Target:
public void applyConstraint(Layer layer, int iteration, int epoch) { Map<String,INDArray> paramTable = layer.paramTable(); if(paramTable == null || paramTable.isEmpty() ){ return; } ParamInitializer i = layer.conf().getLayer().initializer(); for(Map.Entry<String,INDArray> e : paramTable.entrySet()){ if(applyToWeights && i.isWeightParam(e.getKey()) || applyToBiases && i.isBiasParam(e.getKey())){ apply(e.getValue()); } } }
Source:
<code>private void sendMessage(ConsumerRecord<?, ?> record, long readTime, String strReadTime) throws InterruptedException { int count = 0; while (true) { count++; try { _lastEventReceivedTime = Instant.now(); _eventsProcessedRate.mark(); AGGREGATED_EVENTS_PROCESSED_RATE.mark(); int numBytes = record.serializedKeySize() + record.serializedValueSize(); _bytesProcessedRate.mark(numBytes); AGGREGATED_BYTES_PROCESSED_RATE.mark(numBytes); _producer.send(translate(record, readTime, strReadTime), null); <START> return; <END> } catch (RuntimeException e) { LOG.error("Error sending Message. task: ; error: {};", _taskName, e.toString()); LOG.error("Stack Trace: {}", Arrays.toString(e.getStackTrace())); if (_shouldDie || count >= RETRY_COUNT) { throw e; } LOG.warn("Sleeping for seconds before retrying.", _retrySleepDuration.getSeconds(), e); Thread.sleep(_retrySleepDuration.toMillis()); } } }</code><technical_language>nit: remove</technical_language>

Target:
private void sendMessage(ConsumerRecord<?, ?> record, long readTime, String strReadTime) throws InterruptedException { int count = 0; while (true) { count++; try { _lastEventReceivedTime = Instant.now(); _eventsProcessedRate.mark(); AGGREGATED_EVENTS_PROCESSED_RATE.mark(); int numBytes = record.serializedKeySize() + record.serializedValueSize(); _bytesProcessedRate.mark(numBytes); AGGREGATED_BYTES_PROCESSED_RATE.mark(numBytes); _producer.send(translate(record, readTime, strReadTime), null); return; } catch (RuntimeException e) { LOG.error("Error sending Message. task: ; error: {};", _taskName, e.toString()); LOG.error("Stack Trace: {}", Arrays.toString(e.getStackTrace())); if (_shouldDie || count >= _retryCount) { LOG.info("Send messages failed with exception: {}", e); throw e; } LOG.warn("Sleeping for seconds before retrying. Retry of {}", _retrySleepDuration.getSeconds(), count, _retryCount); Thread.sleep(_retrySleepDuration.toMillis()); } } }
Source:
<code><START> int getMaxCountPerBucket(long now) { <END> if (now - _lastAccessTimestamp > _maxTimeRangeMs) { _lastAccessTimestamp = now - _defaultTimeRangeMs; } long startTimeUnits = _lastAccessTimestamp / _timeBucketWidthMs; int startIndex = (int) (startTimeUnits % _bucketCount); long numTimeUnits = now / _timeBucketWidthMs; int endIndex = (int) (numTimeUnits % _bucketCount); int maxCount = 0; for (int i = startIndex; i != endIndex; i = (++i % _bucketCount)) { if (numTimeUnits - _bucketStartTime.get(i) < _bucketCount) { maxCount = Math.max(_bucketHitCount.get(i), maxCount); } } _lastAccessTimestamp = now; return maxCount; }</code><technical_language>this method synchronized? I code method this: - Get of _lastAccessTimeStamp in beginning of method (then = _lastAccessTimeStamp) - method - Set _lastAccessTimestamp end of method protect multiple calls, if (just in case). prevent accessing volatile variable repeatedly</technical_language>

Target:
int getMaxCountPerBucket(long now) { long then = _lastAccessTimestamp; if (now - then > _maxTimeRangeMs) { then = now - _defaultTimeRangeMs; } long startTimeUnits = then / _timeBucketWidthMs; int startIndex = (int) (startTimeUnits % _bucketCount); long numTimeUnits = now / _timeBucketWidthMs; int endIndex = (int) (numTimeUnits % _bucketCount); int maxCount = 0; for (int i = startIndex; i != endIndex; i = (++i % _bucketCount)) { if (numTimeUnits - _bucketStartTime.get(i) < _bucketCount) { maxCount = Math.max(_bucketHitCount.get(i), maxCount); } } _lastAccessTimestamp = now; return maxCount; }
Source:
<code><START> public PrinterDto create(@RequestBody PrinterDto dto) throws Exception { <END> Printer printer = Dtos.to(dto); return get(printerService.create(printer)); }</code><technical_language>this throw IOException</technical_language>

Target:
public PrinterDto create(@RequestBody PrinterDto dto) throws IOException { Printer printer = Dtos.to(dto); return get(printerService.create(printer)); }
Source:
<code>private void validateCRUDCheckPresent(final AbstractApexNode<?> node, final Object data, final String crudMethod, final String typeCheck) { <START> if (!typeToDMLOperationMapping.containsKey(typeCheck)) { if (!isProperESAPICheckForDML(typeCheck, crudMethod)) { if (!isWithSecurityEnforced(node)) { <END> addViolation(data, node); } } } else { boolean properChecksHappened = false; List<String> dmlOperationsChecked = typeToDMLOperationMapping.get(typeCheck); for (String dmlOp : dmlOperationsChecked) { if (dmlOp.equalsIgnoreCase(crudMethod)) { properChecksHappened = true; break; } if (crudMethod.equals(ANY)) { properChecksHappened = true; break; } } if (!properChecksHappened) { addViolation(data, node); } } }</code><technical_language>Please combine 3 if statements avoid nesting: if (!typeToDMLOperationMapping.containsKey(typeCheck) && !isProperESAPICheckForDML(typeCheck, crudMethod) && !isWithSecurityEnforced(node)) { ..</technical_language>

Target:
private void validateCRUDCheckPresent(final AbstractApexNode<?> node, final Object data, final String crudMethod, final String typeCheck) { boolean missingKey = !typeToDMLOperationMapping.containsKey(typeCheck); boolean isImproperDMLCheck = !isProperESAPICheckForDML(typeCheck, crudMethod); boolean noSecurityEnforced = !isWithSecurityEnforced(node); if (missingKey) { if (isImproperDMLCheck && noSecurityEnforced) { addViolation(data, node); } } else { boolean properChecksHappened = false; List<String> dmlOperationsChecked = typeToDMLOperationMapping.get(typeCheck); for (String dmlOp : dmlOperationsChecked) { if (dmlOp.equalsIgnoreCase(crudMethod)) { properChecksHappened = true; break; } if (crudMethod.equals(ANY)) { properChecksHappened = true; break; } } if (!properChecksHappened) { addViolation(data, node); } } }
Source:
<code>public boolean validateObject(PooledConnectionKey key, PooledObject<Connection> pooledConnectionObject) { boolean valid = false; try { pooledConnectionObject.getObject().start(); valid = true; } catch (JMSException e) { <START> log.warn("Connection with username " + key + " is not valid anymore"); <END> } return valid; }</code><technical_language>this is happening for invalid username password</technical_language>

Target:
public boolean validateObject(PooledConnectionKey key, PooledObject<Connection> pooledConnectionObject) { boolean valid = false; try { pooledConnectionObject.getObject().start(); valid = true; } catch (JMSException e) { log.warn("Connection with key " + key + " is not valid anymore"); } return valid; }
Source:
<code><START> public URL loadJar(String jarPath) { <END> File taskJarFile; try { taskJarFile = new File(jarPath); if (taskJarFile.exists() && !taskJarFile.isDirectory()) { return taskJarFile.toURI().toURL(); } LOG.error("Failed to find JAR " + jarPath + " for new task."); throw new IllegalStateException("No JAR for task"); } catch (MalformedURLException e) { LOG.error("Failed to open JAR " + jarPath + " for new task."); throw new IllegalStateException("Malformed JAR URL for task"); } }</code><technical_language>Question: returned URL for a local JAR? give some examples here</technical_language>

Target:
public URL loadJar(String jarPath) { File taskJarFile = new File(jarPath); if (!taskJarFile.exists() || taskJarFile.isDirectory()) { LOG.error("Failed to find JAR " + jarPath + " for new task."); throw new IllegalArgumentException("No JAR for task"); } try { return taskJarFile.toURI().toURL(); } catch (MalformedURLException e) { LOG.error("Failed to open JAR " + jarPath + " for new task."); throw new IllegalArgumentException("Malformed JAR URL for task"); } }
Source:
<code>public Result apply(JoinNode joinNode, Captures captures, Context context) { Expression filter = joinNode.getFilter().get(); <START> return tryCreateSpatialJoin(context, joinNode, filter, joinNode.getId(), joinNode.getOutputSymbols(), metadata, splitManager, pageSourceManager, sqlParser); <END> }</code><technical_language>I this refactoring is needed. (If needed, need in a separate commit.)</technical_language>

Target:
public Result apply(JoinNode joinNode, Captures captures, Context context) { Expression filter = joinNode.getFilter().get(); List<FunctionCall> spatialFunctions = extractSupportedSpatialFunctions(filter); for (FunctionCall spatialFunction : spatialFunctions) { Result result = tryCreateSpatialJoin(context, joinNode, filter, joinNode.getId(), joinNode.getOutputSymbols(), spatialFunction, Optional.empty(), metadata, splitManager, pageSourceManager, sqlParser); if (!result.isEmpty()) { return result; } } List<ComparisonExpression> spatialComparisons = extractSupportedSpatialComparisons(filter); for (ComparisonExpression spatialComparison : spatialComparisons) { Result result = tryCreateSpatialJoin(context, joinNode, filter, joinNode.getId(), joinNode.getOutputSymbols(), spatialComparison, metadata, splitManager, pageSourceManager, sqlParser); if (!result.isEmpty()) { return result; } } return Result.empty(); }
Source:
<code>public void handleMessage(TrapLogDTO messageLog) { <START> final Log eventLog = toLog(messageLog); <END> eventForwarder.sendNowSync(eventLog); if (config.getNewSuspectOnTrap()) { eventLog.getEvents().getEventCollection().stream() .filter(e -> !e.hasNodeid()) .forEach(e -> { sendNewSuspectEvent(e.getInterface(), e.getDistPoller()); LOG.debug("Sent newSuspectEvent for interface {}", e.getInterface()); }); } }</code><technical_language>set logging prefix for thread here, log messages this callback show in trapd.log. I do in Syslog implemenation: <LINK_0></technical_language>

Target:
public void handleMessage(TrapLogDTO messageLog) { try (Logging.MDCCloseable mdc = Logging.withPrefixCloseable(Trapd.LOG4J_CATEGORY)) { final Log eventLog = toLog(messageLog); eventForwarder.sendNowSync(eventLog); if (config.getNewSuspectOnTrap()) { eventLog.getEvents().getEventCollection().stream() .filter(e -> !e.hasNodeid()) .forEach(e -> { sendNewSuspectEvent(e.getInterface(), e.getDistPoller()); LOG.debug("Sent newSuspectEvent for interface {}", e.getInterface()); }); } } }
Source:
<code>public IDBController construct(ConstructArgs args) { return new IDBController(argSelfIdbId, realControllerOperatorId, realControllerWorkerId, null, null, null, argState <START> .construct(), sync); <END> }</code><technical_language>switch a Boolean above, want set default explicitly: Objects.firstNonNull(sync, Boolean.FALSE) that</technical_language>

Target:
public IDBController construct(ConstructArgs args) { return new IDBController(argSelfIdbId, realControllerOperatorId, realControllerWorkerId, null, null, null, argState .construct(), Objects.firstNonNull(sync, Boolean.FALSE)); }
Source:
<code>public static JSONArray getJmx(String beanQuery, String webAddress, URLConnectionFactory connectionFactory, String scheme) { JSONArray ret = null; BufferedReader reader = null; try { String host = webAddress; int port = -1; if (webAddress.indexOf(":") > 0) { String[] webAddressSplit = webAddress.split(":"); host = webAddressSplit[0]; port = Integer.parseInt(webAddressSplit[1]); } URL jmxURL = new URL(scheme, host, port, "/jmx?qry=" + beanQuery); LOG.debug("JMX URL: {}", jmxURL); URLConnection conn = connectionFactory.openConnection( jmxURL, UserGroupInformation.isSecurityEnabled()); conn.setConnectTimeout(5 * 1000); conn.setReadTimeout(5 * 1000); InputStream in = conn.getInputStream(); InputStreamReader isr = new InputStreamReader(in, "UTF-8"); reader = new BufferedReader(isr); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line); } String jmxOutput = sb.toString(); JSONObject json = new JSONObject(jmxOutput); ret = json.getJSONArray("beans"); } catch (IOException e) { LOG.error("Cannot read JMX bean from server {}: ", beanQuery, webAddress, e); <START> } catch (Exception e) { <END> LOG.error("Cannot parse JMX output for from server {}: ", beanQuery, webAddress, e); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { LOG.error("Problem closing {}", webAddress, e); } } } return ret; }</code><technical_language>I this separately need more details this if JSON parsing fails</technical_language>

Target:
public static JSONArray getJmx(String beanQuery, String webAddress, URLConnectionFactory connectionFactory, String scheme) { JSONArray ret = null; BufferedReader reader = null; try { String host = webAddress; int port = -1; if (webAddress.indexOf(":") > 0) { String[] webAddressSplit = webAddress.split(":"); host = webAddressSplit[0]; port = Integer.parseInt(webAddressSplit[1]); } URL jmxURL = new URL(scheme, host, port, "/jmx?qry=" + beanQuery); LOG.debug("JMX URL: {}", jmxURL); URLConnection conn = connectionFactory.openConnection( jmxURL, UserGroupInformation.isSecurityEnabled()); conn.setConnectTimeout(5 * 1000); conn.setReadTimeout(5 * 1000); InputStream in = conn.getInputStream(); InputStreamReader isr = new InputStreamReader(in, "UTF-8"); reader = new BufferedReader(isr); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line); } String jmxOutput = sb.toString(); JSONObject json = new JSONObject(jmxOutput); ret = json.getJSONArray("beans"); } catch (IOException e) { LOG.error("Cannot read JMX bean from server {}", beanQuery, webAddress, e); } catch (JSONException e) { LOG.error("Cannot parse JMX output for from server {}: {}", beanQuery, webAddress, e.getMessage()); } catch (Exception e) { LOG.error("Cannot parse JMX output for from server {}", beanQuery, webAddress, e); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { LOG.error("Problem closing {}", webAddress, e); } } } return ret; }
Source:
<code>protected void executeCommand() { <START> this.macPoolDao = getDbFacade().getMacPoolDao(); <END> MacPool macPool = getMacPool(); macPoolDao.save(macPool); MacPoolPerDC.getInstance().createPool(macPool); setSucceeded(true); getReturnValue().setActionReturnValue(macPool.getId()); }</code><technical_language>I necessary this in a field</technical_language>

Target:
protected void executeCommand() { MacPool macPool = getMacPool(); macPool.setId(Guid.newGuid()); getMacPoolDAO().save(macPool); MacPoolPerDc.getInstance().createPool(macPool); setSucceeded(true); getReturnValue().setActionReturnValue(macPool.getId()); }
Source:
<code><START> public void close() throws FileDataSourceException { <END> if (assetInputStream != null) { try { assetInputStream.close(); } catch (IOException e) { throw new FileDataSourceException(e); } finally { assetInputStream = null; if (opened) { opened = false; if (listener != null) { listener.onTransferEnd(); } } } } }</code><technical_language>throw AssetDataSourceException instead</technical_language>

Target:
public void close() throws AssetDataSourceException { if (assetInputStream != null) { try { assetInputStream.close(); } catch (IOException e) { throw new AssetDataSourceException(e); } finally { assetInputStream = null; if (opened) { opened = false; if (listener != null) { listener.onTransferEnd(); } } } } }
Source:
<code>private boolean isTransitionValid(State source, State target) { switch (target) { case INITIALIZING: <START> return source == UNINITIALIZED || source == READY; <END> case READY: return source == INITIALIZING || source == COMMITTING_TRANSACTION || source == ABORTING_TRANSACTION; case IN_TRANSACTION: return source == READY; case COMMITTING_TRANSACTION: return source == IN_TRANSACTION; case ABORTING_TRANSACTION: return source == IN_TRANSACTION || source == ABORTABLE_ERROR; case ABORTABLE_ERROR: return source == IN_TRANSACTION || source == COMMITTING_TRANSACTION || source == ABORTABLE_ERROR; case FATAL_ERROR: default: return true; } }</code><technical_language>about: letting state transit UNINITIALIZED resetProducerId (since execute successfully if transactional). this a single transition path INITIALIZING</technical_language>

Target:
private boolean isTransitionValid(State source, State target) { switch (target) { case UNINITIALIZED: return source == READY; case INITIALIZING: return source == UNINITIALIZED; case READY: return source == INITIALIZING || source == COMMITTING_TRANSACTION || source == ABORTING_TRANSACTION; case IN_TRANSACTION: return source == READY; case COMMITTING_TRANSACTION: return source == IN_TRANSACTION; case ABORTING_TRANSACTION: return source == IN_TRANSACTION || source == ABORTABLE_ERROR; case ABORTABLE_ERROR: return source == IN_TRANSACTION || source == COMMITTING_TRANSACTION || source == ABORTABLE_ERROR; case FATAL_ERROR: default: return true; } }
Source:
<code><START> int hash(Throwable error, Deque<String> hexHashes) { <END> int hash = 0; if (error.getCause() != null && error.getCause() != error) { hash = hash(error.getCause(), hexHashes); } hash = 31 * hash + error.getClass().getName().hashCode(); for (StackTraceElement element : error.getStackTrace()) { if (accept(element)) { hash = 31 * hash + hash(element); } } hexHashes.push(String.format("%08x", hash)); return hash; }</code><technical_language>Do want consider throwable's message in hash? throwables messages generate hashes, no</technical_language>

Target:
int hash(Throwable error, Deque<String> hexHashes) { int hash = 0; if (error.getCause() != null && error.getCause() != error) { hash = hash(error.getCause(), hexHashes); } hash = 31 * hash + error.getClass().getName().hashCode(); for (StackTraceElement element : error.getStackTrace()) { if (filter.accept(element)) { hash = 31 * hash + hash(element); } } if(hexHashes != null) { hexHashes.push(toHex(hash)); } return hash; }
Source:
<code>public void testGetNoStoreEntryCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); when(this.cacheLoaderWriter.load("key")).thenThrow(new Exception()); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheLoaderWriter); try { ehcache.get("key"); fail(); <START> } catch (CachePassThroughException e) { <END> assertThat(e.getCause(), instanceOf(CacheLoadingException.class)); } verify(this.store).computeIfAbsent(eq("key"), getAnyFunction()); verify(this.cacheLoaderWriter).load(eq("key")); verifyZeroInteractions(this.spiedResilienceStrategy); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.CacheLoadingOutcome.FAILURE)); }</code><technical_language>Ehcache leak CachePassThroughException, this work catching CacheLoadingException</technical_language>

Target:
public void testGetNoStoreEntryCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); when(this.cacheLoaderWriter.load("key")).thenThrow(new Exception()); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheLoaderWriter); try { ehcache.get("key"); fail(); } catch (CacheLoadingException e) { } verify(this.store).computeIfAbsent(eq("key"), getAnyFunction()); verify(this.cacheLoaderWriter).load(eq("key")); verifyZeroInteractions(this.spiedResilienceStrategy); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.CacheLoadingOutcome.FAILURE)); }
Source:
<code>public CommandContextConfiguration(String controller, String username, char[] password, String clientBindAddress, boolean disableLocalAuth, boolean initConsole, int connectionTimeout, InputStream consoleInput, OutputStream consoleOutput) { this.controller = controller; this.username = username; this.password = password; this.clientBindAddress = clientBindAddress; this.consoleInput = consoleInput; this.consoleOutput = consoleOutput; this.initConsole = initConsole; this.disableLocalAuth = disableLocalAuth || username != null; this.connectionTimeout = connectionTimeout; <START> } <END></code><technical_language>I adding a Builder class making constructor private more maintainable</technical_language>

Target:
private CommandContextConfiguration(String controller, String username, char[] password, String clientBindAddress, boolean disableLocalAuth, boolean initConsole, int connectionTimeout, InputStream consoleInput, OutputStream consoleOutput) { this.controller = controller; this.username = username; this.password = password; this.clientBindAddress = clientBindAddress; this.consoleInput = consoleInput; this.consoleOutput = consoleOutput; this.initConsole = initConsole; this.disableLocalAuth = disableLocalAuth || username != null; this.connectionTimeout = connectionTimeout; }
Source:
<code><START> public boolean isServerDisabled() { <END> return isServerDisabled; }</code><technical_language>Please align properly, method starts spaces ends tabs..</technical_language>

Target:
public boolean isServerDisabled() { return serverDisabled; }
Source:
<code>public boolean containsAll(Collection<?> c) { try (final Handle handle = rdbi.open()) { for (final Object obj : c) { final ValueType valueToFind = (ValueType) obj; final String valueToFindStr = serializationHelper.encode(valueToFind); boolean found = false; for (int i = 0; i < size(); i++) { <START> String valueAtIndex = handle.jedis().lindex(key, i); <END> if (valueToFindStr.equals(valueAtIndex)) { found = true; break; } } if (!found) { return false; } } } return true; }</code><technical_language>trips redis free. further, this iteration-heavy implementation peformance unacceptably poor quickly input list increases in size list in redis increases in size</technical_language>

Target:
public boolean containsAll(Collection<?> c) { List<ValueType> currentList = peekAll(); return currentList.containsAll(c); }
Source:
<code>public void setEnvironment(Map<String, String> env) { <START> env.put("GPHOME_LOADERS", gploadHome); <END> if (usePasswordFile) { env.put("PGPASSFILE", passwordInfo); } else { env.put("PGPASSWORD", passwordInfo); } }</code><technical_language>do this result errors in system this. I a GPDB demo vm's gpload is: $ cat /usr/local/greenplum-db/bin/gpload #!/bin/sh if [ ! -z "$GPHOME" ]; . $GPHOME/greenplum_path.sh fi if [ ! -z "$GPHOME_LOADERS" ]; . $GPHOME_LOADERS/greenplum_loaders_path.sh fi if [ uname -s = "AIX" -a ! -z "$GP_LIBPATH_FOR_PYTHON" ]; LIBPATH=$GP_LIBPATH_FOR_PYTHON:$LIBPATH export LIBPATH fi greenplum_loaders_path.sh job fails with: 2015-04-08 03:29:14,432 1.2.0.SNAP ERROR task-scheduler-3 gpload.GploadTasklet - gpload job finished exit code: 1 2015-04-08 03:29:14,434 1.2.0.SNAP ERROR task-scheduler-3 gpload.GploadTasklet - gpload err: /usr/local/greenplum-db/bin/gpload: line 6: /usr/local/greenplum-db/greenplum_loaders_path.sh: file directory</technical_language>

Target:
public void setEnvironment(Map<String, String> env) { File unixPath = new File(gploadHome + File.separator + "greenplum_loaders_path.sh"); if (unixPath.exists()) { env.put("GPHOME_LOADERS", gploadHome); } else { unixPath = new File(gploadHome + File.separator + "greenplum_path.sh"); if (unixPath.exists()) { env.put("GPHOME", gploadHome); } else { throw new IllegalArgumentException("The provided --gploadHome '" + gploadHome + "' does not point to a valid installation"); } } unixPath = null; if (usePasswordFile) { env.put("PGPASSFILE", passwordInfo); } else { env.put("PGPASSWORD", passwordInfo); } }
Source:
<code>private void downloadZip(HttpURLConnection urlConnection, File updateFile) { try (InputStream inputStream = urlConnection.getInputStream(); FileOutputStream outputStream = new FileOutputStream(updateFile)) { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead = -1; long totalBytesRead = 0; int percentCompleted = 0; long fileSize = urlConnection.getContentLength(); while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); totalBytesRead += bytesRead; percentCompleted = (int) (totalBytesRead * 100 / fileSize); <START> publish(percentCompleted); <END> } } catch (IOException ex) { ex.printStackTrace(); cancel(true); } }</code><technical_language>[canonical of reporting progress](<LINK_0> SwingWorker is setProgress method listener bound property</technical_language>

Target:
private void downloadZip(HttpURLConnection urlConnection, File updateFile) { try (InputStream inputStream = urlConnection.getInputStream(); FileOutputStream outputStream = new FileOutputStream(updateFile)) { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead = -1; long totalBytesRead = 0; int percentCompleted = 0; long fileSize = urlConnection.getContentLength(); while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); totalBytesRead += bytesRead; percentCompleted = (int) (totalBytesRead * 100 / fileSize); publish(percentCompleted); } } catch (IOException ex) { GPLogger.log(ex); cancel(true); } }
Source:
<code>protected MySQLStorageEngine getMySQLStorageEngine() { String storageEngine = Environment.getProperties().getProperty( Environment.STORAGE_ENGINE ); if(storageEngine == null) { storageEngine = System.getProperty( Environment.STORAGE_ENGINE ); } if(storageEngine == null) { return InnoDBStorageEngine.INSTANCE; } if( "innodb".equals( storageEngine.toLowerCase() ) ) { <START> return MyISAMStorageEngine.INSTANCE; <END> } else if( "myisam".equals( storageEngine.toLowerCase() ) ) { return MyISAMStorageEngine.INSTANCE; } else { throw new UnsupportedOperationException( "The " + storageEngine + " storage engine is not supported!" ); } }</code><technical_language>InnoDBStorageEngine.INSTANCE</technical_language>

Target:
protected MySQLStorageEngine getMySQLStorageEngine() { String storageEngine = Environment.getProperties().getProperty( Environment.STORAGE_ENGINE ); if(storageEngine == null) { storageEngine = System.getProperty( Environment.STORAGE_ENGINE ); } if(storageEngine == null) { return getDefaultMySQLStorageEngine(); } if( "innodb".equals( storageEngine.toLowerCase() ) ) { return InnoDBStorageEngine.INSTANCE; } else if( "myisam".equals( storageEngine.toLowerCase() ) ) { return MyISAMStorageEngine.INSTANCE; } else { throw new UnsupportedOperationException( "The " + storageEngine + " storage engine is not supported!" ); } }
Source:
<code>public static LabelType withDefaultValues(String name) { checkName(name); List<LabelValue> values = new ArrayList<LabelValue>(2); values.add(new LabelValue((short) 0, "Rejected")); values.add(new LabelValue((short) 1, "Approved")); <START> LabelType type = new LabelType(name, values); <END> return type; }</code><technical_language>type a variable is pointless here</technical_language>

Target:
public static LabelType withDefaultValues(String name) { checkName(name); List<LabelValue> values = new ArrayList<LabelValue>(2); values.add(new LabelValue((short) 0, "Rejected")); values.add(new LabelValue((short) 1, "Approved")); return new LabelType(name, values); }
Source:
<code>public void onClick(AjaxRequestTarget target) { getModelObject().getRecord().save(); <START> setResponsePage(new ODocumentPage(getModelObject()).setModeObject(DisplayMode.VIEW)); <END> }</code><technical_language>do need this instead of previous realization? ajax this is not</technical_language>

Target:
public void onClick(AjaxRequestTarget target) { getModelObject().getRecord().save(); super.onClick(); }
Source:
<code>private void parseHttpMethodAndPath(String httpMethod, String value, boolean hasBody) { if (this.httpMethod != null) { throw methodError("Only one HTTP method is allowed. Found: %s and %s.", this.httpMethod, httpMethod); } <START> if (null == httpMethod) return; <END> this.httpMethod = httpMethod; this.hasBody = hasBody; if (value.isEmpty()) { return; } int question = value.indexOf('?'); if (question != -1 && question < value.length() - 1) { String queryParams = value.substring(question + 1); Matcher queryParamMatcher = PARAM_URL_REGEX.matcher(queryParams); if (queryParamMatcher.find()) { throw methodError("URL query string \"%s\" must not have replace block. " + "For dynamic query parameters use @Query.", queryParams); } } this.relativeUrl = value; this.relativeUrlParamNames = parsePathParameters(value); }</code><technical_language>This true</technical_language>

Target:
private void parseHttpMethodAndPath(String httpMethod, String value, boolean hasBody) { if (this.httpMethod != null) { throw methodError("Only one HTTP method is allowed. Found: %s and %s.", this.httpMethod, httpMethod); } this.httpMethod = httpMethod; this.hasBody = hasBody; if (value.isEmpty()) { return; } int question = value.indexOf('?'); if (question != -1 && question < value.length() - 1) { String queryParams = value.substring(question + 1); Matcher queryParamMatcher = PARAM_URL_REGEX.matcher(queryParams); if (queryParamMatcher.find()) { throw methodError("URL query string \"%s\" must not have replace block. " + "For dynamic query parameters use @Query.", queryParams); } } this.relativeUrl = value; this.relativeUrlParamNames = parsePathParameters(value); }
Source:
<code>private void verifyMembershipEvent(final Message<?> msg, final int membershipEvent) { assertNotNull(msg); assertNotNull(msg.getPayload()); assertTrue(msg.getPayload() instanceof MembershipEvent); <START> assertEquals(((MembershipEvent) msg.getPayload()).getEventType(), membershipEvent); <END> assertNotNull(((MembershipEvent) msg.getPayload()).getMember()); }</code><technical_language>flipped. I exchange expected actual. assertEquals source code :smile:</technical_language>

Target:
private void verifyMembershipEvent(final Message<?> msg, final int membershipEvent) { assertNotNull(msg); assertNotNull(msg.getPayload()); assertTrue(msg.getPayload() instanceof MembershipEvent); assertEquals(membershipEvent, ((MembershipEvent) msg.getPayload()).getEventType()); assertNotNull(((MembershipEvent) msg.getPayload()).getMember()); }
Source:
<code>public void testNestedInvalidateAndApplyCompletes() throws Exception { final AtomicBoolean hasRun = new AtomicBoolean(); <START> final SideEffect innerSideEffect = SideEffect.createPaused(() -> { <END> }).resume(); SideEffect.createPaused(() -> { assertFalse(hasRun.get()); hasRun.set(true); innerSideEffect.markDirty(); innerSideEffect.runIfDirty(); }).resume(); runAsync(); assertTrue(hasRun.get()); }</code><technical_language>is issue in line 208 (resume void)</technical_language>

Target:
public void testNestedInvalidateAndApplyCompletes() throws Exception { AtomicBoolean hasRun = new AtomicBoolean(); SideEffect innerSideEffect = SideEffect.createPaused(() -> { }); innerSideEffect.resume(); SideEffect.createPaused(() -> { assertFalse(hasRun.get()); hasRun.set(true); innerSideEffect.markDirty(); innerSideEffect.runIfDirty(); }).resume(); runAsync(); assertTrue(hasRun.get()); }