auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public CursorProcessorOutput process(ConnectorSession session, DriverYieldSignal yieldSignal, RecordCursor cursor, PageBuilder pageBuilder) { checkArgument(!pageBuilder.isFull(), "page builder can't be full"); requireNonNull(yieldSignal, "yieldSignal is null"); int position = 0; while (true) { if (!cursor.advanceNextPosition()) { return new CursorProcessorOutput(position, true); } if (filter(cursor)) { pageBuilder.declarePosition(); for (int channel = 0; channel < projections.size(); channel++) { project(cursor, channel, pageBuilder); } } position++; <START> if (pageBuilder.isFull() || yieldSignal.isSet()) { <END> return new CursorProcessorOutput(position, false); } } }</code><technical_language>Move if beginning</technical_language>

Target:
public CursorProcessorOutput process(ConnectorSession session, DriverYieldSignal yieldSignal, RecordCursor cursor, PageBuilder pageBuilder) { checkArgument(!pageBuilder.isFull(), "page builder can't be full"); requireNonNull(yieldSignal, "yieldSignal is null"); int position = 0; while (true) { if (pageBuilder.isFull() || yieldSignal.isSet()) { return new CursorProcessorOutput(position, false); } if (!cursor.advanceNextPosition()) { return new CursorProcessorOutput(position, true); } if (filter(cursor)) { pageBuilder.declarePosition(); for (int channel = 0; channel < projections.size(); channel++) { project(cursor, channel, pageBuilder); } } position++; } }
Source:
<code>public VenusGlobalNavPageObject openHubsMenuViaHover() { Actions actions = new Actions(driver); actions.moveToElement(menuButton); actions.build().perform(); <START> WebDriverWait wait = new WebDriverWait(driver, 5); <END> wait.until(CommonExpectedConditions.elementVisible(hubsMenu)); return this; }</code><technical_language>need declare a avriable "wait" new WebdriverWait(driver, 5).until(...) .... do job</technical_language>

Target:
public VenusGlobalNavPageObject openHubsMenuViaHover() { new Actions(driver) .moveToElement(menuButton) .perform(); new WebDriverWait(driver, 5).until(CommonExpectedConditions.elementVisible(hubsMenu)); return this; }
Source:
<code>public CurrencyAmount presentValueFromCleanPrice( FixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double cleanPrice) { Security<FixedCouponBond> security = trade.getSecurity(); FixedCouponBond product = security.getProduct(); <START> LocalDate settlementDate = trade.getTradeInfo().getSettlementDate().get(); <END> StandardId securityId = security.getStandardId(); StandardId legalEntityId = product.getLegalEntityId(); double df = provider.repoCurveDiscountFactors( securityId, legalEntityId, product.getCurrency()).discountFactor(settlementDate); double pvPrice = (cleanPrice * product.getNotional() + productPricer.accruedInterest(product, settlementDate)) * df; return CurrencyAmount.of(product.getCurrency(), pvPrice); }</code><technical_language>clean price is price quoted standard settlement date</technical_language>

Target:
public CurrencyAmount presentValueFromCleanPrice( FixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double cleanPrice) { Security<FixedCouponBond> security = trade.getSecurity(); FixedCouponBond product = security.getProduct(); LocalDate standardSettlementDate = product.getSettlementDateOffset().adjust(provider.getValuationDate()); LocalDate tradeSettlementDate = trade.getTradeInfo().getSettlementDate().get(); StandardId securityId = security.getStandardId(); StandardId legalEntityId = product.getLegalEntityId(); Currency currency = product.getCurrency(); double df = provider.repoCurveDiscountFactors(securityId, legalEntityId, currency).discountFactor(standardSettlementDate); double pvStandard = (cleanPrice * product.getNotional() + productPricer.accruedInterest(product, standardSettlementDate)) * df; if (standardSettlementDate.isEqual(tradeSettlementDate)) { return presentValueFromProductPresentValue(trade, provider, CurrencyAmount.of(currency, pvStandard)); } IssuerCurveDiscountFactors discountFactors = provider.issuerCurveDiscountFactors(legalEntityId, currency); ExpandedFixedCouponBond expanded = product.expand(); boolean exCoupon = product.getExCouponPeriod().getDays() != 0; double pvDiff = 0d; if (standardSettlementDate.isAfter(tradeSettlementDate)) { pvDiff = productPricer.presentValueCoupon( expanded, discountFactors, tradeSettlementDate, standardSettlementDate, exCoupon); } else { pvDiff = -productPricer.presentValueCoupon( expanded, discountFactors, standardSettlementDate, tradeSettlementDate, exCoupon); } return presentValueFromProductPresentValue(trade, provider, CurrencyAmount.of(currency, pvStandard + pvDiff)); }
Source:
<code>Value newUniqueValue( RandomRule random, Set<Object> uniqueCompareValues, List<Value> uniqueValues ) { double x, y; PointValue pointValue; Long compareValue; do { x = random.nextDouble() * 360 - 180; y = random.nextDouble() * 180 - 90; pointValue = Values.pointValue( crs, x, y ); compareValue = curve.derivedValueFor( pointValue.coordinate() ); } <START> while ( !uniqueCompareValues.add( compareValue ) ); <END> uniqueValues.add( pointValue ); return pointValue; }</code><technical_language>uniqueness constraint for Points implemented, this disregard points unique 1D-value existing point? For sounds important case test</technical_language>

Target:
Value newUniqueValue( RandomRule random, Set<Object> uniqueCompareValues, List<Value> uniqueValues ) { PointValue pointValue; Long compareValue; do { pointValue = randomPoint( random.randoms() ); compareValue = curve.derivedValueFor( pointValue.coordinate() ); } while ( !uniqueCompareValues.add( compareValue ) ); uniqueValues.add( pointValue ); return pointValue; }
Source:
<code>public static ExecutionEnvironmentResolutionHandler adapt(ExecutionEnvironmentConfiguration eeConfiguration) { <START> if (eeConfiguration.isIgnoredByResolver()) { <END> return new AllKnownEEsResolutionHandler(); } else if (eeConfiguration.isCustomProfile()) { return new CustomEEResolutionHandler(eeConfiguration); } else { return new StandardEEResolutionHandler(eeConfiguration.getProfileName()); } }</code><technical_language>Good: this needs checked first; this flag override a custom EE configuration</technical_language>

Target:
public static ExecutionEnvironmentResolutionHandler adapt(ExecutionEnvironmentConfiguration eeConfiguration) { if (eeConfiguration.isIgnoredByResolver()) { return new StandardEEResolutionHandler(new AllKnownEEsResolutionHints()); } else if (eeConfiguration.isCustomProfile()) { return new CustomEEResolutionHandler(eeConfiguration); } else { return new StandardEEResolutionHandler(new StandardEEResolutionHints(eeConfiguration.getProfileName())); } }
Source:
<code>public ClientStats getClientStats() { <START> final long totalConnectionCount = openChannels.size(); <END> final long idleConnectionCount = channelPool.getIdleChannelCount(); final long activeConnectionCount = totalConnectionCount - idleConnectionCount; return new ClientStats(activeConnectionCount, idleConnectionCount); }</code><technical_language>ChannelManager set in config No, can't</technical_language>

Target:
public ClientStats getClientStats() { final Map<String, Long> totalConnectionsPerHost = openChannels .stream() .map(Channel::remoteAddress) .filter(a -> a.getClass() == InetSocketAddress.class) .map(a -> (InetSocketAddress) a) .map(InetSocketAddress::getHostName) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); final Map<String, Long> idleConnectionsPerHost = channelPool.getIdleChannelCountPerHost(); final Map<String, HostStats> statsPerHost = totalConnectionsPerHost .entrySet() .stream() .collect(Collectors.toMap( Entry::getKey, entry -> { final long totalConnectionCount = entry.getValue(); final long idleConnectionCount = idleConnectionsPerHost.getOrDefault(entry.getKey(), 0L); final long activeConnectionCount = totalConnectionCount - idleConnectionCount; return new HostStats(activeConnectionCount, idleConnectionCount); } )); return new ClientStats(statsPerHost); }
Source:
<code>public String queryWithSkipQueryDetachDisabled() { if(TestEntityManager.getInvocations().contains("close")) { return "invalid state, entity manager has already been previously closed"; } if(TestEntityManager.getInvocations().contains("clear")) { return "invalid state, entity manager has already been previously cleared"; } Query query = emQueryResultsAreDetached.createQuery("mock query"); if(TestEntityManager.getInvocations().contains("clear")) { return "invalid state, entity manager was cleared (detached) after query was created but before executed," + "which means that 'wildfly.jpa.skipquerydetach=false' (default) behaviour didn't work"; } query.getSingleResult(); if(TestEntityManager.getInvocations().contains("close")) { return "invalid state, entity manager was closed before SFSB1 bean call completed, " + <START> "which means that 'wildfly.jpa.skipquerydetach=true' couldn't work, as the " + <END> "persistence context was closed too early"; } if(!TestEntityManager.getInvocations().contains("clear")) { return "invalid state, entity manager was not cleared (detached) as expected," + "which means that 'wildfly.jpa.skipquerydetach=false' (default) behaviour didn't work"; } return null; }</code><technical_language>If I understand this correctly, testing case wildfly.jpa.skipquerydetach=false, we? false in case</technical_language>

Target:
public String queryWithSkipQueryDetachDisabled() { if(TestEntityManager.getInvocations().contains("close")) { return "invalid state, entity manager has already been previously closed"; } if(TestEntityManager.getInvocations().contains("clear")) { return "invalid state, entity manager has already been previously cleared"; } Query query = emQueryResultsAreDetached.createQuery("mock query"); if(TestEntityManager.getInvocations().contains("clear")) { return "invalid state, entity manager was cleared (detached) after query was created but before executed," + "which means that 'wildfly.jpa.skipquerydetach=false' (default) behaviour didn't work"; } query.getSingleResult(); if(TestEntityManager.getInvocations().contains("close")) { return "invalid state, entity manager was closed before SFSB1 bean call completed, " + "which means that 'wildfly.jpa.skipquerydetach=false' couldn't work, as the " + "persistence context was closed too early"; } if(!TestEntityManager.getInvocations().contains("clear")) { return "invalid state, entity manager was not cleared (detached) as expected," + "which means that 'wildfly.jpa.skipquerydetach=false' (default) behaviour didn't work"; } return null; }
Source:
<code>public Collection<String> aliases() { <START> return Collections.unmodifiableList(Lists.newArrayList("readableSize")); <END> }</code><technical_language>need guava (and import) :) suggestion return Collections.unmodifiableList(Arrays.asList("readableSize"));</technical_language>

Target:
public Collection<String> aliases() { return Collections.unmodifiableList(Arrays.asList("readableSize")); }
Source:
<code>private String dbSpecificPageCacheMemory( File storeDir ) { long total = 0; for ( StoreType type : StoreType.values() ) { if ( type.isRecordStore() ) { File file = new File( storeDir, type.getStoreFile().storeFileName() ); if ( outsideWorld.fileSystem().fileExists( file ) ) { total += outsideWorld.fileSystem().getFileSize( file ); } } } File baseSchemaIndexDir = baseSchemaIndexFolder( storeDir ); <START> total = sumNativeIndexFiles( baseSchemaIndexDir, getNativeIndexFileFilter(), total ); <END> return bytesToString( total ); }</code><technical_language>This total += need pass total argument method</technical_language>

Target:
private String dbSpecificPageCacheMemory( File storeDir ) { long total = 0; total += sumStoreFiles( storeDir ); File baseSchemaIndexDir = baseSchemaIndexFolder( storeDir ); total += sumNativeIndexFiles( baseSchemaIndexDir, getNativeIndexFileFilter( baseSchemaIndexDir.toPath() ) ); return bytesToString( total ); }
Source:
<code>protected OrderBySpec parseOrderBySpec( TokenStream tokens ) { if (tokens.canConsume('@')) { NameTest attributeName = parseQName(tokens); Order order = Order.ASCENDING; if (tokens.canConsume("ascending")) order = Order.ASCENDING; else if (tokens.canConsume("descending")) order = Order.DESCENDING; return new OrderBySpec(order, attributeName); } if (tokens.matches("jcr", ":", "score", "(")) { FunctionCall scoreFunction = parseFunctionCall(tokens); Order order = Order.ASCENDING; if (tokens.canConsume("ascending")) order = Order.ASCENDING; else if (tokens.canConsume("descending")) order = Order.DESCENDING; return new OrderBySpec(order, scoreFunction); } <START> PathExpression path = this.parsePathExpr(tokens); <END> Order order = Order.ASCENDING; if (tokens.canConsume("ascending")) { order = Order.ASCENDING; } else if (tokens.canConsume("descending")) { order = Order.DESCENDING; } return new OrderBySpec(order, path); }</code><technical_language>this check size of path expression ensure a child name a property? Also, want is a relative path expression. If not, code throw a ParsingException a description of allowed, e.g., Expected 'jcr:score(tableName)', '@<propertyName>', '<childName>/@<propertyOnChild>' " + tokens.consume()</technical_language>

Target:
protected OrderBySpec parseOrderBySpec( TokenStream tokens ) { if (tokens.canConsume('@')) { NameTest attributeName = parseQName(tokens); Order order = Order.ASCENDING; if (tokens.canConsume("ascending")) order = Order.ASCENDING; else if (tokens.canConsume("descending")) order = Order.DESCENDING; return new OrderBySpec(order, attributeName); } if (tokens.matches("jcr", ":", "score", "(")) { FunctionCall scoreFunction = parseFunctionCall(tokens); Order order = Order.ASCENDING; if (tokens.canConsume("ascending")) order = Order.ASCENDING; else if (tokens.canConsume("descending")) order = Order.DESCENDING; return new OrderBySpec(order, scoreFunction); } PathExpression path = this.parsePathExpr(tokens); if (!path.isRelative()) { throw new ParsingException(tokens.nextPosition(), "Expected either 'jcr:score(tableName)', '@<propertyName>', " + "or '<childName>/@<propertyOnChild>' but absolute path was found " + tokens.consume()); } List<StepExpression> steps = path.getSteps(); if (steps.size() != 2) { throw new ParsingException(tokens.nextPosition(), "Expected either 'jcr:score(tableName)', '@<propertyName>', " + "or '<childName>/@<propertyOnChild>' but was found " + tokens.consume()); } if (!(((AxisStep)steps.get(0)).getNodeTest() instanceof NameTest)) { throw new ParsingException(tokens.nextPosition(), "Expected '<childName>/@<propertyOnChild>' but was found " + tokens.consume()); } if (!(((AxisStep)steps.get(1)).getNodeTest() instanceof AttributeNameTest)) { throw new ParsingException(tokens.nextPosition(), "Expected '<childName>/@<propertyOnChild>' but was found " + tokens.consume()); } Order order = Order.ASCENDING; if (tokens.canConsume("ascending")) { order = Order.ASCENDING; } else if (tokens.canConsume("descending")) { order = Order.DESCENDING; } return new OrderBySpec(order, path); }
Source:
<code>public static void addStatementPatternIds(TransactionBase tx, Set<String> ids) { <START> Optional<Bytes> val = Optional.fromNullable(tx.get(Bytes.of(STATEMENT_PATTERN_ID), STATEMENT_PATTERN_IDS)); <END> StringBuilder builder = new StringBuilder(); if (val.isPresent()) { builder.append(val.get().toString()); builder.append(VAR_DELIM); } String idString = builder.append(Joiner.on(VAR_DELIM).join(ids)).toString(); tx.set(Bytes.of(STATEMENT_PATTERN_ID), STATEMENT_PATTERN_IDS, Bytes.of(idString)); tx.set(Bytes.of(STATEMENT_PATTERN_ID), STATEMENT_PATTERN_IDS_HASH, Bytes.of(Hashing.sha256().hashString(idString).toString())); }</code><technical_language>requireNonNull</technical_language>

Target:
public static void addStatementPatternIds(TransactionBase tx, Set<String> ids) { checkNotNull(tx); checkNotNull(ids); Optional<Bytes> val = Optional.fromNullable(tx.get(Bytes.of(STATEMENT_PATTERN_ID), STATEMENT_PATTERN_IDS)); StringBuilder builder = new StringBuilder(); if (val.isPresent()) { builder.append(val.get().toString()); builder.append(VAR_DELIM); } String idString = builder.append(Joiner.on(VAR_DELIM).join(ids)).toString(); tx.set(Bytes.of(STATEMENT_PATTERN_ID), STATEMENT_PATTERN_IDS, Bytes.of(idString)); tx.set(Bytes.of(STATEMENT_PATTERN_ID), STATEMENT_PATTERN_IDS_HASH, Bytes.of(Hashing.sha256().hashString(idString).toString())); }
Source:
<code>public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { super.bridgeStatusChanged(bridgeStatusInfo); if (ThingStatus.ONLINE.equals(bridgeStatusInfo.getStatus()) && ThingStatus.OFFLINE.equals(getThing().getStatusInfo().getStatus()) && ThingStatusDetail.BRIDGE_OFFLINE.equals(getThing().getStatusInfo().getStatusDetail())) { <START> updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE); <END> } }</code><technical_language>mentioned in <LINK_0>, I claim setting status ONLINE is cases a bug. In example of hue binding, handler determines correct status in onLightStateChanged. do set a state wait for next update (triggered regular polling) set UNKNOWN for time being. checked for other bindings</technical_language>

Target:
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { super.bridgeStatusChanged(bridgeStatusInfo); if ((bridgeStatusInfo.getStatus() == ThingStatus.ONLINE) && (getThing().getStatusInfo().getStatus() == ThingStatus.OFFLINE) && (getThing().getStatusInfo().getStatusDetail() == ThingStatusDetail.BRIDGE_OFFLINE)) { updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE); } }
Source:
<code>public NotesMergeConflictException(NonNoteEntry base, NonNoteEntry ours, NonNoteEntry theirs) { super(MessageFormat.format(JGitText.get().mergeConflictOnNonNoteEntries, <START> base, ours, theirs)); <END> }</code><technical_language>want name field NonNoteEntry rely toString()</technical_language>

Target:
public NotesMergeConflictException(NonNoteEntry base, NonNoteEntry ours, NonNoteEntry theirs) { super(MessageFormat.format( JGitText.get().mergeConflictOnNonNoteEntries, base.name(), ours.name(), theirs.name())); }
Source:
<code>private boolean isContentValid(final RepositoryState repositoryState, final SnomedImportResult result, final String requestingUserId, final ImportConfiguration configuration, final IBranchPath branchPath, final SubMonitor subMonitor) { return getIndex().read(configuration.getBranchPath(), new RevisionIndexRead<Boolean>() { @Override public Boolean execute(RevisionSearcher index) throws IOException { final SnomedValidationContext validator = new SnomedValidationContext(index, requestingUserId, configuration, IMPORT_LOGGER, repositoryState); final Set<SnomedValidationDefect> defects = result.getValidationDefects(); defects.addAll(validator.validate(subMonitor.newChild(1))); if (!isEmpty(defects)) { final String message = String.format("Validation encountered %s issue(s).", defects.size()); LogUtils.logImportActivity(IMPORT_LOGGER, requestingUserId, branchPath, message); final String lineSeparator = System.getProperty("line.separator"); final Map<String, BufferedWriter> defectWriters = newHashMap(); try { for (SnomedValidationDefect defect : defects) { final String filePath = defect.getFileName(); <START> final String defectsFile = String.format("d:/%s_%s_defects.txt", configuration.getArchiveFile().getName(), filePath); <END> if (!defectWriters.containsKey(defectsFile)) { defectWriters.put(defectsFile, Files.newWriter(new File(defectsFile), Charsets.UTF_8)); } for (String lineDefect : defect.getDefects()) { defectWriters.get(defectsFile).write(defect.getDefectType().name() + "\t" + lineDefect); defectWriters.get(defectsFile).write(lineSeparator); } } } finally { for (BufferedWriter writer : defectWriters.values()) { writer.close(); } } return !Iterables.tryFind(defects, new Predicate<SnomedValidationDefect>() { @Override public boolean apply(SnomedValidationDefect input) { return input.getDefectType().isCritical(); } }).isPresent(); } return true; } }); }</code><technical_language>Hard-coded file location</technical_language>

Target:
private boolean isContentValid(final RepositoryState repositoryState, final SnomedImportResult result, final String requestingUserId, final ImportConfiguration configuration, final IBranchPath branchPath, final SubMonitor subMonitor) { return getIndex().read(configuration.getBranchPath(), new RevisionIndexRead<Boolean>() { @Override public Boolean execute(RevisionSearcher index) throws IOException { final SnomedValidationContext validator = new SnomedValidationContext(index, requestingUserId, configuration, IMPORT_LOGGER, repositoryState); final Set<SnomedValidationDefect> defects = result.getValidationDefects(); defects.addAll(validator.validate(subMonitor.newChild(1))); if (!isEmpty(defects)) { final String message = String.format("Validation encountered %s issue(s).", defects.size()); LogUtils.logImportActivity(IMPORT_LOGGER, requestingUserId, branchPath, message); return !Iterables.tryFind(defects, new Predicate<SnomedValidationDefect>() { @Override public boolean apply(SnomedValidationDefect input) { return input.getDefectType().isCritical(); } }).isPresent(); } return true; } }); }
Source:
<code>public DataloadProcess getProcessById(Project project, String id) { notEmpty(id, "id"); notNull(project, "project"); <START> return getProcessByUri(DataloadProcess.TEMPLATE.expand(project.getId(), id).toString()); <END> }</code><technical_language>expandUri() here</technical_language>

Target:
public DataloadProcess getProcessById(Project project, String id) { notEmpty(id, "id"); notNull(project, "project"); return getProcessByUri(getProcessUri(project, id).toString()); }
Source:
<code>private boolean installBDM() { try { getContainer().run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { new DeployBDMOperation(fStore).run(monitor); } }); } catch (final InvocationTargetException e) { <START> final Throwable targetException = e.getTargetException(); <END> int index = -1; for (int i = 0; i < targetException.getStackTrace().length; i++) { final StackTraceElement element = targetException.getStackTrace()[i]; if (element.getClassName().contains("org.hibernate.HibernateException")) { index = i; break; } } if (index > -1) { targetException.setStackTrace(Arrays.copyOfRange(targetException.getStackTrace(), index, targetException.getStackTrace().length)); } new BonitaErrorDialog(Display.getDefault().getActiveShell(), Messages.installFailedTitle, Messages.installFailedMessage, targetException) .open(); return false; } catch (final InterruptedException e) { return false; } return true; }</code><technical_language>extract a method for "managingStackTrace"/"improvingSTackTrace"</technical_language>

Target:
private boolean installBDM() { try { getContainer().run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { new DeployBDMOperation(fStore).run(monitor); } }); } catch (final InvocationTargetException e) { new BonitaErrorDialog(Display.getDefault().getActiveShell(), Messages.installFailedTitle, Messages.installFailedMessage, handleTargetExceptionStacktrace(e)) .open(); return false; } catch (final InterruptedException e) { return false; } return true; }
Source:
<code>public static @Nullable Set<Integer> getThreadsOfCpus(KernelAnalysisModule module, Collection<Long> cpus, long rangeStart, long rangeEnd) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Set<Long> uniqueCpus = (cpus instanceof Set ? (Set<Long>) cpus : ImmutableSet.copyOf(cpus)); int threadsQuark = ss.optQuarkAbsolute(Attributes.THREADS); if (threadsQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return null; } List<Integer> threadQuarks = ss.getSubAttributes(threadsQuark, false); return threadQuarks.stream() .filter(threadQuark -> { int threadCurrentCpuQuark = ss.optQuarkRelative(threadQuark, Attributes.CURRENT_CPU_RQ); if (threadCurrentCpuQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return false; } QuarkIterator it = new QuarkIterator(ss, threadCurrentCpuQuark, rangeStart, rangeEnd); return <START> StreamUtils.getStream(it) .map(ITmfStateInterval::getStateValue) .filter(value -> !value.isNull()) .map(value -> Long.valueOf(value.unboxLong())) .anyMatch(uniqueCpus::contains); <END> }) .map(ss::getAttributeName) .filter(attribName -> !attribName.startsWith(Attributes.THREAD_0_PREFIX)) .map(Integer::valueOf) .collect(Collectors.toSet()); }</code><technical_language>guava iterators</technical_language>

Target:
public static @Nullable Set<Integer> getThreadsOfCpus(KernelAnalysisModule module, Collection<Long> cpus, long rangeStart, long rangeEnd) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Set<Long> uniqueCpus = (cpus instanceof Set ? (Set<Long>) cpus : ImmutableSet.copyOf(cpus)); int threadsQuark = ss.optQuarkAbsolute(Attributes.THREADS); if (threadsQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return null; } List<Integer> threadQuarks = ss.getSubAttributes(threadsQuark, false); return threadQuarks.stream() .filter(threadQuark -> { int threadCurrentCpuQuark = ss.optQuarkRelative(threadQuark, Attributes.CURRENT_CPU_RQ); if (threadCurrentCpuQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return false; } Iterator<ITmfStateInterval> intervals = new QuarkIterator(ss, threadCurrentCpuQuark, rangeStart, rangeEnd); Iterator<ITmfStateValue> nonNull = Iterators.filter(Iterators.transform(intervals, ITmfStateInterval::getStateValue), v -> !v.isNull()); return Iterators.any(Iterators.transform(nonNull, ITmfStateValue::unboxLong), uniqueCpus::contains); }) .map(ss::getAttributeName) .filter(attribName -> !attribName.startsWith(Attributes.THREAD_0_PREFIX)) .map(Integer::parseInt) .collect(Collectors.toSet()); }
Source:
<code>public SetLicenseKeyCmd(final String licenseKey) { <START> this.LicenseKey = licenseKey; <END> }</code><technical_language>suggestion this.licenseKey = licenseKey;</technical_language>

Target:
public SetLicenseKeyCmd(final String licenseKey) { this.licenseKey = licenseKey; }
Source:
<code>void testDeleteArtifactAndEmptyTrashForRepository(String acceptHeader, @MavenRepository(repositoryId = REPOSITORY_WITH_TRASH_2) @RepositoryAttributes(trashEnabled = true) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_TRASH_2, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.0") Path artifactPath) { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); String url = getContextBaseUrl() + "/{storageId}/{repositoryId}"; ValidatableMockMvcResponse response = given().accept(acceptHeader) .when() .delete(url, storageId, repositoryId) .peek() .then() .statusCode(HttpStatus.OK.value()); String message = String.format("The trash for '%s:%s' was removed successfully.", storageId, repositoryId); validateResponseBody(response, acceptHeader, message); <START> assertFalse(Files.exists(getPathToArtifactInTrash(repository, artifactPath)), <END> "Failed to empty trash for repository '" + repositoryId + "'!"); }</code><technical_language>is RepositoryFiles.trash, please instead of getPathToArtifactInTrash</technical_language>

Target:
void testDeleteArtifactAndEmptyTrashForRepository(String acceptHeader, @MavenRepository(repositoryId = REPOSITORY_WITH_TRASH_2) @RepositoryAttributes(trashEnabled = true) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_TRASH_2, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.0") Path artifactPath) throws IOException { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); String url = getContextBaseUrl() + "/{storageId}/{repositoryId}"; ValidatableMockMvcResponse response = given().accept(acceptHeader) .when() .delete(url, storageId, repositoryId) .peek() .then() .statusCode(HttpStatus.OK.value()); String message = String.format("The trash for '%s:%s' was removed successfully.", storageId, repositoryId); validateResponseBody(response, acceptHeader, message); final RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath.normalize(); final Path artifactFileInTrash = RepositoryFiles.trash(artifactRepositoryPath); assertFalse(Files.exists(artifactFileInTrash), "Failed to empty trash for repository '" + repositoryId + "'!"); }
Source:
<code>public void setUp() { getVM(0).invoke(() -> { <START> latch.set(null); <END> threadId.set(0L); }); }</code><technical_language>Is initialize latch CountDownLatch(0) instead of null? initialize in line 45, latch is declared</technical_language>

Target:
public void setUp() { getVM(0).invoke(() -> { LATCH.set(new CountDownLatch(1)); THREAD_ID.set(0L); }); }
Source:
<code>public void execute(CommandLine options) throws Exception { List<String> args = options.getArgList(); List<Path> inputFiles = getInputFiles(args.subList(0, args.size() - 1)); Path outputFile = new Path(args.get(args.size() - 1)); FileMetaData mergedMeta = mergedMetadata(inputFiles); PrintWriter out = new PrintWriter(Main.out, true); ParquetFileWriter writer = new ParquetFileWriter(conf, mergedMeta.getSchema(), outputFile, ParquetFileWriter.Mode.CREATE); writer.start(); boolean tooSmallFilesMerged = false; for (Path input: inputFiles) { if (input.getFileSystem(conf).getFileStatus(input).getLen() < TOO_SMALL_FILE_THRESHOLD) { out.format("Warning: file %s is too small, length: %d\n", input, input.getFileSystem(conf).getFileStatus(input).getLen()); tooSmallFilesMerged = true; } writer.appendFile(conf, input); } if (tooSmallFilesMerged) { out.println("Warning: you merged too small files. " + <START> "Despite the size of the merged file is bigger, it STILL contains small row groups, thus you don't have the advantage of big row groups!"); <END> } writer.end(mergedMeta.getKeyValueMetaData()); }</code><technical_language>I stronger wording comma, "which leads bad query performance." (Additionally, a native speaker either, I need a "that" "Despite" some other word, for example "Although".)</technical_language>

Target:
public void execute(CommandLine options) throws Exception { List<String> args = options.getArgList(); List<Path> inputFiles = getInputFiles(args.subList(0, args.size() - 1)); Path outputFile = new Path(args.get(args.size() - 1)); FileMetaData mergedMeta = mergedMetadata(inputFiles); PrintWriter out = new PrintWriter(Main.out, true); ParquetFileWriter writer = new ParquetFileWriter(conf, mergedMeta.getSchema(), outputFile, ParquetFileWriter.Mode.CREATE); writer.start(); boolean tooSmallFilesMerged = false; for (Path input: inputFiles) { if (input.getFileSystem(conf).getFileStatus(input).getLen() < TOO_SMALL_FILE_THRESHOLD) { out.format("Warning: file %s is too small, length: %d\n", input, input.getFileSystem(conf).getFileStatus(input).getLen()); tooSmallFilesMerged = true; } writer.appendFile(conf, input); } if (tooSmallFilesMerged) { out.println("Warning: you merged too small files. " + "Although the size of the merged file is bigger, it STILL contains small row groups, thus you don't have the advantage of big row groups, " + "which usually leads to bad query performance!"); } writer.end(mergedMeta.getKeyValueMetaData()); }
Source:
<code>public synchronized void scheduleRequestIfNecessary() { if (isFinished() || isFailed()) { return; } if (noMoreLocations && completedClients.size() == allClients.size()) { if (pageBuffer.peekLast() != NO_MORE_PAGES) { checkState(pageBuffer.add(NO_MORE_PAGES), "Could not add no more pages marker"); } if (pageBuffer.peek() == NO_MORE_PAGES) { close(); } notifyBlockedCallers(); return; } long neededBytes = bufferCapacity - bufferRetainedSizeInBytes; if (neededBytes <= 0) { return; } int clientCount = (int) ((1.0 * neededBytes / averageBytesPerRequest) * concurrentRequestMultiplier); clientCount = Math.max(clientCount, 1); int pendingClients = allClients.size() - queuedClients.size() - completedClients.size(); clientCount -= pendingClients; for (int i = 0; i < clientCount; i++) { HttpPageBufferClient client = queuedClients.poll(); if (client == null) { return; } <START> if (cancelledClients.contains(client)) { <END> continue; } client.scheduleRequest(); } }</code><technical_language>increment i if client is added</technical_language>

Target:
public synchronized void scheduleRequestIfNecessary() { if (isFinished() || isFailed()) { return; } if (noMoreLocations && completedClients.size() == allClients.size()) { if (pageBuffer.peekLast() != NO_MORE_PAGES) { checkState(pageBuffer.add(NO_MORE_PAGES), "Could not add no more pages marker"); } if (pageBuffer.peek() == NO_MORE_PAGES) { close(); } notifyBlockedCallers(); return; } long neededBytes = bufferCapacity - bufferRetainedSizeInBytes; if (neededBytes <= 0) { return; } int clientCount = (int) ((1.0 * neededBytes / averageBytesPerRequest) * concurrentRequestMultiplier); clientCount = Math.max(clientCount, 1); int pendingClients = allClients.size() - queuedClients.size() - completedClients.size(); clientCount -= pendingClients; for (int i = 0; i < clientCount; ) { HttpPageBufferClient client = queuedClients.poll(); if (client == null) { return; } if (removedClients.contains(client)) { continue; } client.scheduleRequest(); i++; } }
Source:
<code>String createAssertionForIdToken( JsonFactory jsonFactory, long currentTime, String audience, String targetAudience) throws IOException { JsonWebSignature.Header header = new JsonWebSignature.Header(); header.setAlgorithm("RS256"); header.setType("JWT"); header.setKeyId(privateKeyId); JsonWebToken.Payload payload = new JsonWebToken.Payload(); payload.setIssuer(clientEmail); payload.setIssuedAtTimeSeconds(currentTime / 1000); payload.setExpirationTimeSeconds(currentTime / 1000 + 3600); payload.setSubject(serviceAccountUser); if (audience == null) { payload.setAudience(OAuth2Utils.TOKEN_SERVER_URI.toString()); } else { payload.setAudience(audience); } payload.set("target_audience", targetAudience); <START> String assertion; <END> try { assertion = JsonWebSignature.signUsingRsaSha256(privateKey, jsonFactory, header, payload); } catch (GeneralSecurityException e) { throw new IOException( "Error signing service account access token request with private key.", e); } return assertion; }</code><technical_language>push this declaration return statement try block</technical_language>

Target:
String createAssertionForIdToken( JsonFactory jsonFactory, long currentTime, String audience, String targetAudience) throws IOException { JsonWebSignature.Header header = new JsonWebSignature.Header(); header.setAlgorithm("RS256"); header.setType("JWT"); header.setKeyId(privateKeyId); JsonWebToken.Payload payload = new JsonWebToken.Payload(); payload.setIssuer(clientEmail); payload.setIssuedAtTimeSeconds(currentTime / 1000); payload.setExpirationTimeSeconds(currentTime / 1000 + 3600); payload.setSubject(serviceAccountUser); if (audience == null) { payload.setAudience(OAuth2Utils.TOKEN_SERVER_URI.toString()); } else { payload.setAudience(audience); } try { payload.set("target_audience", targetAudience); String assertion = JsonWebSignature.signUsingRsaSha256(privateKey, jsonFactory, header, payload); return assertion; } catch (GeneralSecurityException e) { throw new IOException( "Error signing service account access token request with private key.", e); } }
Source:
<code>public static <A> Hash<Zipper<A>> zipperHash(final Hash<A> ha) { return hash(as -> { final int p = 419; int r = 239; Zipper<A> aas = as; <START> aas.move(0); <END> while (true) { r = p * r + ha.hash(aas.focus()); if (aas.atEnd()) { break; } aas = aas.tryNext(); } return r; }); }</code><technical_language>this nothing</technical_language>

Target:
public static <A> Hash<Zipper<A>> zipperHash(final Hash<A> ha) { Hash<Stream<A>> sh = streamHash(ha); return hash(as -> { final int p = 419; int r = 239; r = p * r + sh.hash(as.lefts()); r = p * r + ha.hash(as.focus()); r = p * r + sh.hash(as.rights()); return r; }); }
Source:
<code>private void initVmTemplate() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { <START> log.error("Failed to parse a given ovf configuration: '{}':\n{}", <END> e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }</code><technical_language>is need for ' in message</technical_language>

Target:
private void initVmTemplate() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n'{}'", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }
Source:
<code>public Object evaluate(EObject target, String expression) throws EvaluationException { Object evaluation = null; if (target != null && expression != null && expression.startsWith(PREFIX)) { String serviceCall = expression.substring(PREFIX.length()); Option<String> receiverVariableName = getReceiverVariableName(serviceCall); EObject receiver = target; String serviceName = serviceCall; if (receiverVariableName.some()) { serviceCall = serviceCall.substring(receiverVariableName.get().length() + 1); Object objectReceiver = evaluateVariable(target, receiverVariableName.get().trim()); if (objectReceiver instanceof EObject) { receiver = (EObject) objectReceiver; } else { <START> throw new EvaluationException("The receiver of the service call " + serviceCall + "."); <END> } } int indexOfParenthesis = serviceCall.indexOf("("); serviceName = serviceCall.substring(0, indexOfParenthesis == -1 ? serviceCall.length() : indexOfParenthesis); Object[] parameters = new Object[] { receiver }; if (indexOfParenthesis != -1) { String[] values = serviceCall.split("[(,)]"); parameters = new Object[values.length]; parameters[0] = receiver; for (int i = 1; i < values.length; i++) { parameters[i] = evaluateVariable(target, values[i].trim()); } } evaluation = callService(parameters, serviceName); } return evaluation; }</code><technical_language>error message is incomplete. is a full sentence explain problem is. "The receiver of service call " + serviceCall + " is EObject."</technical_language>

Target:
public Object evaluate(EObject target, String expression) throws EvaluationException { Object evaluation = null; if (target != null && expression != null && expression.startsWith(PREFIX)) { String serviceCall = expression.substring(PREFIX.length()); Option<String> receiverVariableName = getReceiverVariableName(serviceCall); EObject receiver = target; String serviceName = serviceCall; if (receiverVariableName.some()) { serviceCall = serviceCall.substring(receiverVariableName.get().length() + 1); Object objectReceiver = evaluateVariable(target, receiverVariableName.get().trim()); if (objectReceiver instanceof EObject) { receiver = (EObject) objectReceiver; } else { throw new EvaluationException("The receiver of the service call " + serviceCall + " is not an EObject."); } } int indexOfParenthesis = serviceCall.indexOf("("); serviceName = serviceCall.substring(0, indexOfParenthesis == -1 ? serviceCall.length() : indexOfParenthesis); Object[] parameters = new Object[] { receiver }; if (indexOfParenthesis != -1) { String[] values = serviceCall.split("[(,)]"); parameters = new Object[values.length]; parameters[0] = receiver; for (int i = 1; i < values.length; i++) { parameters[i] = evaluateVariable(target, values[i].trim()); } } evaluation = callService(parameters, serviceName); } return evaluation; }
Source:
<code>public long getOperationCount() { try { Long count = invokeMethod((operationCountWorkerInstance != null) ? operationCountWorkerInstance : testClassInstance, operationCountMethod); return (count == null ? -1 : count); } catch (Exception ignored) { <START> return -1; <END> } }</code><technical_language>good log.finest(...) - swallowing exceptions leads a nightmare troubleshooting wrong</technical_language>

Target:
public long getOperationCount() { try { Long count = invokeMethod((operationCountWorkerInstance != null) ? operationCountWorkerInstance : testClassInstance, operationCountMethod); return (count == null ? -1 : count); } catch (Exception e) { LOGGER.debug("Exception while retrieving operation count from " + testCase.getId() + ": " + e.getMessage()); return -1; } }
Source:
<code>public InstructorStudentRecordsAjaxPageData(AccountAttributes account, StudentAttributes student, String sessionToken, List<FeedbackSessionResultsBundle> results, Map<String, Boolean> sessionSubmissionStatusMap) { super(account, student, sessionToken); this.resultsTables = new ArrayList<>(); for (int i = 0; i < results.size(); i++) { FeedbackSessionResultsBundle result = results.get(i); boolean submissionStatus = true; try { submissionStatus = sessionSubmissionStatusMap.get(result.getFeedbackSession().getFeedbackSessionName()); <START> } catch (Exception e) { <END> } String studentName = result.appendTeamNameToName(student.name, student.team); this.resultsTables.add(new FeedbackResultsTable(i, studentName, result, submissionStatus)); } }</code><technical_language>do need this? This dangerous</technical_language>

Target:
public InstructorStudentRecordsAjaxPageData(AccountAttributes account, StudentAttributes student, String sessionToken, List<FeedbackSessionResultsBundle> results, Map<String, Boolean> sessionSubmissionStatusMap) { super(account, student, sessionToken); this.resultsTables = new ArrayList<>(); for (int i = 0; i < results.size(); i++) { FeedbackSessionResultsBundle result = results.get(i); boolean hasStudentSubmitted; if (sessionSubmissionStatusMap.containsKey(result.getFeedbackSession().getFeedbackSessionName())) { hasStudentSubmitted = sessionSubmissionStatusMap.get(result.getFeedbackSession().getFeedbackSessionName()); } else { hasStudentSubmitted = true; } String studentName = result.appendTeamNameToName(student.name, student.team); this.resultsTables.add(new FeedbackResultsTable(i, studentName, result, hasStudentSubmitted)); } }
Source:
<code>private void sendNsdStateChangeBroadcast(boolean isEnabled) { final Intent intent = new Intent(NsdManager.ACTION_NSD_STATE_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); intent.putExtra(NsdManager.EXTRA_NSD_STATE, <START> enabledMessage(isEnabled)); <END> mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); }</code><technical_language>This appears incorrect. This send NSD_STATE_{ENABLED,DISABLED} values (1 2), in order consistent. Right</technical_language>

Target:
private void sendNsdStateChangeBroadcast(boolean isEnabled) { final Intent intent = new Intent(NsdManager.ACTION_NSD_STATE_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); int nsdState = isEnabled ? NsdManager.NSD_STATE_ENABLED : NsdManager.NSD_STATE_DISABLED; intent.putExtra(NsdManager.EXTRA_NSD_STATE, nsdState); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); }
Source:
<code><START> public AnnotationMetadata() { <END> }</code><technical_language>If for frameworks, please this package protected</technical_language>

Target:
AnnotationMetadata() { }
Source:
<code>private static void generateBubbleMergeWithSearchGraphJob(String jobName, String outputPath) throws IOException { PregelixJob job = BubbleMergeWithSearchVertex.getConfiguredJob(new GenomixJobConf(3), BubbleMergeWithSearchVertex.class); <START> job.setVertexInputFormatClass(NodeToBubbleMergeWithSearchVertexInputFormat.class); <END> job.setVertexOutputFormatClass(BubbleMergeWithSearchVertexToNodeOutputFormat.class); job.getConfiguration().setInt(GenomixJobConf.BUBBLE_MERGE_WITH_SEARCH_MAX_LENGTH, 100); job.getConfiguration().writeXml(new FileOutputStream(new File(outputPath))); }</code><technical_language>format changes done in getConfiguredJob</technical_language>

Target:
private static void generateBubbleMergeWithSearchGraphJob(String jobName, String outputPath) throws IOException { PregelixJob job = BubbleMergeWithSearchVertex.getConfiguredJob(new GenomixJobConf(3), BubbleMergeWithSearchVertex.class); job.getConfiguration().setInt(GenomixJobConf.BUBBLE_MERGE_WITH_SEARCH_MAX_LENGTH, 100); job.getConfiguration().writeXml(new FileOutputStream(new File(outputPath))); }
Source:
<code>private boolean sameResultAsLast(Session s, Value[] params, Value[] lastParams, long lastEval) { if (!cacheableChecked) { long max = getMaxDataModificationId(); noCache = max == Long.MAX_VALUE; cacheableChecked = true; } if (noCache) { return false; } Database db = s.getDatabase(); for (int i = 0; i < params.length; i++) { Value a = lastParams[i], b = params[i]; if (a.getType() != b.getType() || !db.areEqual(a, b)) { return false; } } if (!isEverything(ExpressionVisitor.DETERMINISTIC_VISITOR) || !isEverything(ExpressionVisitor.INDEPENDENT_VISITOR)) { return false; } <START> return db.getModificationDataId() <= lastEval || getMaxDataModificationId() <= lastEval; <END> }</code><technical_language>optimize in similar places? Comparison is a boolean, &&, , booleans in bytecode. Compiler add code anyway. is win. making source code consistent. If some additional conditions required insertion more complicated too</technical_language>

Target:
private boolean sameResultAsLast(Session s, Value[] params, Value[] lastParams, long lastEval) { if (!cacheableChecked) { long max = getMaxDataModificationId(); noCache = max == Long.MAX_VALUE; cacheableChecked = true; } if (noCache) { return false; } Database db = s.getDatabase(); for (int i = 0; i < params.length; i++) { Value a = lastParams[i], b = params[i]; if (a.getType() != b.getType() || !db.areEqual(a, b)) { return false; } } if (!isEverything(ExpressionVisitor.DETERMINISTIC_VISITOR) || !isEverything(ExpressionVisitor.INDEPENDENT_VISITOR)) { return false; } if (db.getModificationDataId() > lastEval && getMaxDataModificationId() > lastEval) { return false; } return true; }
Source:
<code>private int delayForSubscription() { <START> if (!subscription.isBatchSubscription()) { <END> return subscription.getSerialSubscriptionPolicy().getSendingDelay(); } else { return 0; } }</code><technical_language>AFAIR ConsumerMessageSender is for serial subscriptions, this if is redundant</technical_language>

Target:
private int delayForSubscription() { return subscription.getSerialSubscriptionPolicy().getSendingDelay(); }
Source:
<code>public void setUp() { <START> registry = mock(SourcedEurekaRegistryImpl.class); <END> retryableConnection = mock(RetryableConnection.class); channelSubject = ReplaySubject.create(); when(retryableConnection.getChannelObservable()).thenReturn(channelSubject); client = new MyInterestClient(registry, 0); }</code><technical_language>mock SourcedEurekaRegistry is interface</technical_language>

Target:
public void setUp() { registry = mock(SourcedEurekaRegistry.class); retryableConnection = mock(RetryableConnection.class); channelSubject = ReplaySubject.create(); when(retryableConnection.getChannelObservable()).thenReturn(channelSubject); client = new MyInterestClient(registry, 0); }