auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void saveReceipt(Date date, TimeZone timeZone, String price, String tax, String exchangeRate, String comment, PaymentMethod paymentMethod, boolean isReimbursable, boolean isFullPage, String name, Category category, String currency, String extraText1, String extraText2, String extraText3) { final Receipt receipt = fragment.getEditableItem(); final Trip parentTrip = fragment.getParentTrip(); final ReceiptBuilderFactory builderFactory = (receipt == null) ? new ReceiptBuilderFactory(-1) : new ReceiptBuilderFactory(receipt); builderFactory.setName(name) .setTrip(parentTrip) .setDate((Date) date.clone()) .setTimeZone(timeZone) .setPrice(price) .setTax(tax) .setExchangeRate(new ExchangeRateBuilderFactory().setBaseCurrency(currency) .setRate(parentTrip.getTripCurrency(), exchangeRate) .build()) .setCategory(category) .setCurrency(currency) .setComment(comment) .setPaymentMethod(paymentMethod) .setIsReimbursable(isReimbursable) .setIsFullPage(isFullPage) .setExtraEditText1(extraText1) .setExtraEditText2(extraText2) .setExtraEditText3(extraText3); <START> if (fragment.shouldGenerateHash()) { <END> builderFactory.setImgHash(hashImgFile(fragment.getFile())); } if (receipt == null) { receiptTableController.insert(builderFactory.setFile(fragment.getFile()).build(), new DatabaseOperationMetadata()); } else { receiptTableController.update(receipt, builderFactory.build(), new DatabaseOperationMetadata()); } }</code><technical_language>do this in a background process avoid blocking UI thread</technical_language>

Target:
void saveReceipt(Date date, TimeZone timeZone, String price, String tax, String exchangeRate, String comment, PaymentMethod paymentMethod, boolean isReimbursable, boolean isFullPage, String name, Category category, String currency, String extraText1, String extraText2, String extraText3) { final Receipt receipt = fragment.getEditableItem(); final Trip parentTrip = fragment.getParentTrip(); final ReceiptBuilderFactory builderFactory = (receipt == null) ? new ReceiptBuilderFactory(-1) : new ReceiptBuilderFactory(receipt); builderFactory.setName(name) .setTrip(parentTrip) .setDate((Date) date.clone()) .setTimeZone(timeZone) .setPrice(price) .setTax(tax) .setExchangeRate(new ExchangeRateBuilderFactory().setBaseCurrency(currency) .setRate(parentTrip.getTripCurrency(), exchangeRate) .build()) .setCategory(category) .setCurrency(currency) .setComment(comment) .setPaymentMethod(paymentMethod) .setIsReimbursable(isReimbursable) .setIsFullPage(isFullPage) .setExtraEditText1(extraText1) .setExtraEditText2(extraText2) .setExtraEditText3(extraText3); if (receipt == null) { receiptTableController.insert(builderFactory.setFile(fragment.getFile()).build(), new DatabaseOperationMetadata()); } else { receiptTableController.update(receipt, builderFactory.build(), new DatabaseOperationMetadata()); } }
Source:
<code>public static String getAPIKey(String userid, String password) throws UnsupportedEncodingException{ String api_creds = userid + ":" + password; String apiKey = "Basic " + DatatypeConverter.printBase64Binary(api_creds <START> .getBytes("UTF-8")); <END> return apiKey; }</code><technical_language>StandardCharsets.UTF_8 instead of "UTF-8"</technical_language>

Target:
public static String getAPIKey(String userid, String password) throws UnsupportedEncodingException{ String api_creds = userid + ":" + password; String apiKey = "Basic " + DatatypeConverter.printBase64Binary(api_creds .getBytes(StandardCharsets.UTF_8)); return apiKey; }
Source:
<code>public synchronized void rollback() throws DatabaseEngineRuntimeException { try { for (final MappedEntity mappedEntity : entities.values()) { <START> mappedEntity.getInsert().clearBatch(); <END> } conn.rollback(); conn.setAutoCommit(true); } catch (SQLException ex) { throw new DatabaseEngineRuntimeException("Something went wrong while rolling back the transaction", ex); } }</code><technical_language>this done for 'getInsertWithAutoInc()' 'getInsertReturning()'</technical_language>

Target:
public synchronized void rollback() throws DatabaseEngineRuntimeException { try { conn.rollback(); conn.setAutoCommit(true); } catch (SQLException ex) { throw new DatabaseEngineRuntimeException("Something went wrong while rolling back the transaction", ex); } }
Source:
<code>protected synchronized Object getValueFromTable(String table, String key) { Object value = null; Cursor cursor = null; try { SQLiteDatabase db = getReadableDatabase(); cursor = queryDb( db, table, new String[]{KEY_FIELD, VALUE_FIELD}, KEY_FIELD + " = ?", new String[]{key}, null, null, null, null ); if (cursor.moveToFirst()) { value = table.equals(STORE_TABLE_NAME) ? cursor.getString(1) : cursor.getLong(1); } } catch (SQLiteException e) { logger.e(TAG, String.format("getValue from %s failed", table), e); Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); delete(); } catch (StackOverflowError e) { logger.e(TAG, String.format("getValue from %s failed", table), e); Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); delete(); <START> } catch (IllegalStateException e) { END> Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); delete(); } catch (RuntimeException e) { Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); convertIfCursorWindowException(e); } finally { if (cursor != null) { cursor.close(); } close(); } return value; }</code><technical_language>do slightly more specific? check message refers CursorWindow</technical_language>

Target:
protected synchronized Object getValueFromTable(String table, String key) { Object value = null; Cursor cursor = null; try { SQLiteDatabase db = getReadableDatabase(); cursor = queryDb( db, table, new String[]{KEY_FIELD, VALUE_FIELD}, KEY_FIELD + " = ?", new String[]{key}, null, null, null, null ); if (cursor.moveToFirst()) { value = table.equals(STORE_TABLE_NAME) ? cursor.getString(1) : cursor.getLong(1); } } catch (SQLiteException e) { logger.e(TAG, String.format("getValue from %s failed", table), e); Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); delete(); } catch (StackOverflowError e) { logger.e(TAG, String.format("getValue from %s failed", table), e); Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); delete(); } catch (IllegalStateException e) { Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); handleIfCursorRowTooLargeException(e); } catch (RuntimeException e) { Diagnostics.getLogger().logError( String.format("DB: Failed to getValue: %s", key), e ); convertIfCursorWindowException(e); } finally { if (cursor != null) { cursor.close(); } close(); } return value; }
Source:
<code>public void evaluateExperienceRepay() { logger.info("[ExperienceRepayScheduler] start..."); try { List<InvestRepayModel> investRepayModels = investRepayMapper.findByLoanId(1); investRepayModels.stream() .filter(investRepayModel -> new DateTime(investRepayModel.getRepayDate()).isBefore(new DateTime().plusDays(1).withTimeAtStartOfDay()) <START> && investRepayModel.getStatus() != RepayStatus.COMPLETE) <END> .collect(Collectors.toList()) .forEach(investRepayModel -> { InvestInfo investInfo = new InvestInfo(); investInfo.setInvestId(investRepayModel.getInvestId()); mqWrapperClient.sendMessage(MessageQueue.InvestSuccess_ExperienceRepay, new InvestSuccessMessage(investInfo, null, null)); logger.info("[ExperienceRepayScheduler] experience invest repay", investRepayModel.getInvestId()); }); } catch (Exception e) { logger.error("[ExperienceRepayScheduler:] job execution is failed.", e); } logger.info("[ExperienceRepayScheduler] done"); }</code><technical_language>investRepayModel.getStatus() == RepayStatus.REPAYING</technical_language>

Target:
public void evaluateExperienceRepay() { logger.info("[ExperienceRepayScheduler] start..."); try { List<InvestRepayModel> investRepayModels = investRepayMapper.findByLoanId(1); investRepayModels.stream() .filter(investRepayModel -> new DateTime(investRepayModel.getRepayDate()).isBefore(new DateTime().plusDays(1).withTimeAtStartOfDay()) && investRepayModel.getStatus() == RepayStatus.REPAYING) .collect(Collectors.toList()) .forEach(investRepayModel -> { InvestInfo investInfo = new InvestInfo(); investInfo.setInvestId(investRepayModel.getInvestId()); mqWrapperClient.sendMessage(MessageQueue.InvestSuccess_ExperienceRepay, new InvestSuccessMessage(investInfo, null, null)); logger.info("[ExperienceRepayScheduler] experience invest repay", investRepayModel.getInvestId()); }); } catch (Exception e) { logger.error("[ExperienceRepayScheduler:] job execution is failed.", e); } logger.info("[ExperienceRepayScheduler] done"); }
Source:
<code>private Resolved resolve() { final ImmutableList.Builder<ImmutableList<ImmutableBitSet>> builder = ImmutableList.builder(); List<SqlNode> extraExprs = ImmutableList.of(); Map<Integer, Integer> groupExprProjection = ImmutableMap.of(); if (select.getGroup() != null) { final SqlNodeList groupList = select.getGroup(); final SqlValidatorUtil.GroupAnalyzer groupAnalyzer = new SqlValidatorUtil.GroupAnalyzer(temporaryGroupExprList); for (SqlNode groupExpr : groupList) { SqlValidatorUtil.analyzeGroupItem(this, groupAnalyzer, builder, groupExpr); } extraExprs = groupAnalyzer.extraExprs; groupExprProjection = groupAnalyzer.groupExprProjection; } final Set<ImmutableBitSet> flatGroupSets = Sets.newTreeSet(ImmutableBitSet.COMPARATOR); final Map<ImmutableBitSet, Integer> groupSetCount = new HashMap<>(); for (List<ImmutableBitSet> groupSet : Linq4j.product(builder.build())) { final ImmutableBitSet set = ImmutableBitSet.union(groupSet); groupSetCount.put(set, groupSetCount.getOrDefault(set, 0) + 1); <START> flatGroupSets.add(set); <END> } if (flatGroupSets.isEmpty()) { flatGroupSets.add(ImmutableBitSet.of()); } return new Resolved(extraExprs, temporaryGroupExprList, flatGroupSets, groupSetCount, groupExprProjection); }</code><technical_language>Is flatGroupSets valid? groupSetCount flatGroupSets duplicate other</technical_language>

Target:
private Resolved resolve() { final ImmutableList.Builder<ImmutableList<ImmutableBitSet>> builder = ImmutableList.builder(); List<SqlNode> extraExprs = ImmutableList.of(); Map<Integer, Integer> groupExprProjection = ImmutableMap.of(); if (select.getGroup() != null) { final SqlNodeList groupList = select.getGroup(); final SqlValidatorUtil.GroupAnalyzer groupAnalyzer = new SqlValidatorUtil.GroupAnalyzer(temporaryGroupExprList); for (SqlNode groupExpr : groupList) { SqlValidatorUtil.analyzeGroupItem(this, groupAnalyzer, builder, groupExpr); } extraExprs = groupAnalyzer.extraExprs; groupExprProjection = groupAnalyzer.groupExprProjection; } final SortedMap<ImmutableBitSet, Integer> flatGroupSetCount = Maps.newTreeMap(ImmutableBitSet.COMPARATOR); for (List<ImmutableBitSet> groupSet : Linq4j.product(builder.build())) { final ImmutableBitSet set = ImmutableBitSet.union(groupSet); flatGroupSetCount.put(set, flatGroupSetCount.getOrDefault(set, 0) + 1); } if (flatGroupSetCount.isEmpty()) { flatGroupSetCount.put(ImmutableBitSet.of(), 1); } return new Resolved(extraExprs, temporaryGroupExprList, flatGroupSetCount.keySet(), flatGroupSetCount, groupExprProjection); }
Source:
<code>protected Map<String,BatchInputFileType> getListOfFilesToProcess() { Map<String,BatchInputFileType> inputFileTypeMap = new LinkedHashMap<>(); for (BatchInputFileType batchInputFileType : batchInputFileTypes) { List<String> inputFileNames = batchInputFileService.listInputFileNamesWithDoneFile(batchInputFileType); if (inputFileNames == null) { <START> criticalError("BatchInputFileService.listInputFileNamesWithDoneFile(" + batchInputFileType.getFileTypeIdentifer() <END> + ") returned NULL which should never happen."); } else { for (String inputFileName : inputFileNames) { if (StringUtils.isBlank(inputFileName)) { criticalError("One of the file names returned as ready to process [" + inputFileName + "] was blank. This should not happen, so throwing an error to investigate."); } inputFileTypeMap.put(inputFileName, batchInputFileType); } } } return inputFileTypeMap; }</code><technical_language>Please include function name in message</technical_language>

Target:
protected Map<String,BatchInputFileType> getListOfFilesToProcess() { Map<String,BatchInputFileType> inputFileTypeMap = new LinkedHashMap<>(); for (BatchInputFileType batchInputFileType : batchInputFileTypes) { List<String> inputFileNames = batchInputFileService.listInputFileNamesWithDoneFile(batchInputFileType); if (inputFileNames == null) { criticalError("getListOfFilesToProcess: BatchInputFileService.listInputFileNamesWithDoneFile(" + batchInputFileType.getFileTypeIdentifer() + ") returned NULL which should never happen."); } else { for (String inputFileName : inputFileNames) { if (StringUtils.isBlank(inputFileName)) { criticalError("getListOfFilesToProcess: One of the file names returned as ready to process [" + inputFileName + "] was blank. This should not happen, so throwing an error to investigate."); } inputFileTypeMap.put(inputFileName, batchInputFileType); } } } return inputFileTypeMap; }
Source:
<code>public void testBasePathForStartWithFilter() { String basePath1 = "/someAbsolutePath1/someDirectory"; String basePath2 = "someRelativeDirectory2"; String basePath3 = "/someAbsolutePath3/someDirectory"; <START> <END> configureBasePath("project/project/*", basePath1); configureBasePath("project/*", basePath2); configureBasePath("*", basePath3); assertThat(repoCfg.getBasePath(new NameKey("project/project/someProject"))) .isEqualTo(basePath1); assertThat(repoCfg.getBasePath(new NameKey("project/someProject"))) .isEqualTo(basePath2); assertThat(repoCfg.getBasePath(new NameKey("someProject"))).isEqualTo( basePath3); }</code><technical_language>Extra blank line</technical_language>

Target:
public void testBasePathForStartWithFilter() { String basePath1 = "/someAbsolutePath1/someDirectory"; String basePath2 = "someRelativeDirectory2"; String basePath3 = "/someAbsolutePath3/someDirectory"; String basePath4 = "/someAbsolutePath4/someDirectory"; configureBasePath("pro*", basePath1); configureBasePath("project/project/*", basePath2); configureBasePath("project/*", basePath3); configureBasePath("*", basePath4); assertThat(repoCfg.getBasePath(new NameKey("project1"))) .isEqualTo(basePath1); assertThat(repoCfg.getBasePath(new NameKey("project/project/someProject"))) .isEqualTo(basePath2); assertThat(repoCfg.getBasePath(new NameKey("project/someProject"))) .isEqualTo(basePath3); assertThat(repoCfg.getBasePath(new NameKey("someProject"))).isEqualTo( basePath4); }
Source:
<code>public void testRetainedSizeWithOverlappingBlocks() { Random random = new Random(); int entries = random.nextInt(100) + 1; BlockBuilder blockBuilder = new IntArrayBlockBuilder(new BlockBuilderStatus(), entries); for (int i = 0; i < entries; i++) { blockBuilder.writeInt(i); } Block block = blockBuilder.build(); <START> int arraySize = random.nextInt(200) + 1; <END> int blocks = random.nextInt(10000) + 1; BlockBigArray blockBigArray = new BlockBigArray(); blockBigArray.ensureCapacity(arraySize); for (int i = 0; i < blocks; i++) { blockBigArray.set(i % arraySize, block.getRegion(0, entries)); } ReferenceCountMap referenceCountMap = new ReferenceCountMap(); referenceCountMap.incrementReference(block); long expectedSize = ClassLayout.parseClass(BlockBigArray.class).instanceSize() + referenceCountMap.sizeOf() + (new ObjectBigArray()).sizeOf() + block.getRetainedSizeInBytes() + (min(arraySize, blocks) - 1) * ClassLayout.parseClass(block.getClass()).instanceSize(); assertEquals(blockBigArray.sizeOf(), expectedSize); }</code><technical_language>random. pick a size</technical_language>

Target:
public void testRetainedSizeWithOverlappingBlocks() { int entries = 123; BlockBuilder blockBuilder = new IntArrayBlockBuilder(new BlockBuilderStatus(), entries); for (int i = 0; i < entries; i++) { blockBuilder.writeInt(i); } Block block = blockBuilder.build(); int arraySize = 456; int blocks = 7890; BlockBigArray blockBigArray = new BlockBigArray(); blockBigArray.ensureCapacity(arraySize); for (int i = 0; i < blocks; i++) { blockBigArray.set(i % arraySize, block.getRegion(0, entries)); } ReferenceCountMap referenceCountMap = new ReferenceCountMap(); referenceCountMap.incrementReference(block); long expectedSize = ClassLayout.parseClass(BlockBigArray.class).instanceSize() + referenceCountMap.sizeOf() + (new ObjectBigArray()).sizeOf() + block.getRetainedSizeInBytes() + (arraySize - 1) * ClassLayout.parseClass(block.getClass()).instanceSize(); assertEquals(blockBigArray.sizeOf(), expectedSize); }
Source:
<code>public CacheConfig(CacheSimpleConfig simpleConfig) throws Exception { this.name = simpleConfig.getName(); if (simpleConfig.getKeyType() != null) { setKeyClassName(simpleConfig.getKeyType()); } if (simpleConfig.getValueType() != null) { setValueClassName(simpleConfig.getValueType()); } this.isStatisticsEnabled = simpleConfig.isStatisticsEnabled(); this.isManagementEnabled = simpleConfig.isManagementEnabled(); this.isReadThrough = simpleConfig.isReadThrough(); this.isWriteThrough = simpleConfig.isWriteThrough(); copyFactories(simpleConfig); initExpiryPolicyFactoryConfig(simpleConfig); this.asyncBackupCount = simpleConfig.getAsyncBackupCount(); this.backupCount = simpleConfig.getBackupCount(); this.inMemoryFormat = simpleConfig.getInMemoryFormat(); if (simpleConfig.getEvictionConfig() != null) { this.evictionConfig = new EvictionConfig(simpleConfig.getEvictionConfig()); } if (simpleConfig.getWanReplicationRef() != null) { this.wanReplicationRef = new WanReplicationRef(simpleConfig.getWanReplicationRef()); } copyListeners(simpleConfig); this.quorumName = simpleConfig.getQuorumName(); <START> this.mergePolicyConfig = simpleConfig.getMergePolicyConfig(); <END> this.hotRestartConfig = new HotRestartConfig(simpleConfig.getHotRestartConfig()); this.eventJournalConfig = new EventJournalConfig(simpleConfig.getEventJournalConfig()); this.disablePerEntryInvalidationEvents = simpleConfig.isDisablePerEntryInvalidationEvents(); }</code><technical_language>here: a copy constructor</technical_language>

Target:
public CacheConfig(CacheSimpleConfig simpleConfig) throws Exception { this.name = simpleConfig.getName(); if (simpleConfig.getKeyType() != null) { setKeyClassName(simpleConfig.getKeyType()); } if (simpleConfig.getValueType() != null) { setValueClassName(simpleConfig.getValueType()); } this.isStatisticsEnabled = simpleConfig.isStatisticsEnabled(); this.isManagementEnabled = simpleConfig.isManagementEnabled(); this.isReadThrough = simpleConfig.isReadThrough(); this.isWriteThrough = simpleConfig.isWriteThrough(); copyFactories(simpleConfig); initExpiryPolicyFactoryConfig(simpleConfig); this.asyncBackupCount = simpleConfig.getAsyncBackupCount(); this.backupCount = simpleConfig.getBackupCount(); this.inMemoryFormat = simpleConfig.getInMemoryFormat(); if (simpleConfig.getEvictionConfig() != null) { this.evictionConfig = new EvictionConfig(simpleConfig.getEvictionConfig()); } if (simpleConfig.getWanReplicationRef() != null) { this.wanReplicationRef = new WanReplicationRef(simpleConfig.getWanReplicationRef()); } copyListeners(simpleConfig); this.quorumName = simpleConfig.getQuorumName(); this.mergePolicyConfig = new MergePolicyConfig(simpleConfig.getMergePolicyConfig()); this.hotRestartConfig = new HotRestartConfig(simpleConfig.getHotRestartConfig()); this.eventJournalConfig = new EventJournalConfig(simpleConfig.getEventJournalConfig()); this.disablePerEntryInvalidationEvents = simpleConfig.isDisablePerEntryInvalidationEvents(); }
Source:
<code>private AnalysisJob readAnalysisJob(HdfsResource analysisJobXmlHdfsResource) { <START> final InputStream analysisJobXmlInputStream = analysisJobXmlHdfsResource.read(); <END> final JaxbJobReader jobReader = new JaxbJobReader(_dataCleanerConfiguration); final AnalysisJob analysisJob = jobReader.read(analysisJobXmlInputStream); return analysisJob; }</code><technical_language>This stream is closed. In general I recommend read(Func) method avoid unclosed resources in a guaranteed fashion</technical_language>

Target:
private AnalysisJob readAnalysisJob(HdfsResource analysisJobXmlHdfsResource) { final AnalysisJob analysisJob = analysisJobXmlHdfsResource.read(new Func<InputStream, AnalysisJob>() { @Override public AnalysisJob eval(InputStream in) { final JaxbJobReader jobReader = new JaxbJobReader(_dataCleanerConfiguration); final AnalysisJob analysisJob = jobReader.read(in); return analysisJob; } }); return analysisJob; }
Source:
<code>public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ActivationKey && super.equals(obj)) { ActivationKey that = (ActivationKey) obj; String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null; String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null; EqualsBuilder builder = new EqualsBuilder() .append(this.getId(), that.getId()) .append(this.getName(), that.getName()) .append(this.getDescription(), that.getDescription()) .append(thisOwnerId, thatOwnerId) .append(this.getReleaseVer(), that.getReleaseVer()) .append(this.getServiceLevel(), that.getServiceLevel()) .append(this.isAutoAttach(), that.isAutoAttach()) .append(this.getPools(), that.getPools()) <START> .append(this.getProducts(), that.getProducts()); <END> return builder.isEquals(); } return false; }</code><technical_language>careful here. Hibernate-backed objects, guarantee get a sane container. such, collections, need Util class's collectionsAreEqual method for comparing them. a Product.equals for example</technical_language>

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } boolean equals = false; if (obj instanceof ActivationKey && super.equals(obj)) { ActivationKey that = (ActivationKey) obj; String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null; String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null; equals = new EqualsBuilder() .append(this.getId(), that.getId()) .append(this.getName(), that.getName()) .append(this.getDescription(), that.getDescription()) .append(thisOwnerId, thatOwnerId) .append(this.getReleaseVer(), that.getReleaseVer()) .append(this.getServiceLevel(), that.getServiceLevel()) .append(this.isAutoAttach(), that.isAutoAttach()) .isEquals(); equals = equals && Util.collectionsAreEqual(this.getPools(), that.getPools(), new Comparator<ActivationKeyPool>() { public int compare(ActivationKeyPool akp1, ActivationKeyPool akp2) { return akp1 == akp2 || (akp1 != null && akp1.equals(akp2)) ? 0 : 1; } }); equals = equals && Util.collectionsAreEqual(this.getProducts(), that.getProducts(), new Comparator<Product>() { public int compare(Product prod1, Product prod2) { return prod1 == prod2 || (prod1 != null && prod1.equals(prod2)) ? 0 : 1; } }); return equals; } return false; }
Source:
<code>public static LockRefreshingLockService create(LockService delegate) { final LockRefreshingLockService ret = new LockRefreshingLockService(delegate); <START> task = executor.scheduleWithFixedDelay(() -> { <END> long startTime = System.currentTimeMillis(); try { ret.refreshLocks(); } catch (Throwable t) { log.warn("Failed to refresh locks", t); } finally { long elapsed = System.currentTimeMillis() - startTime; if (elapsed > LockRequest.getDefaultLockTimeout().toMillis() / 2) { log.warn("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } else if (elapsed > ret.refreshFrequencyMillis) { log.info("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } } }, 0, ret.refreshFrequencyMillis, TimeUnit.MILLISECONDS); return ret; }</code><technical_language>suggestion ret.task = executor.scheduleWithFixedDelay(() -> {</technical_language>

Target:
public static LockRefreshingLockService create(LockService delegate) { final LockRefreshingLockService ret = new LockRefreshingLockService(delegate); ret.task = executor.scheduleWithFixedDelay(() -> { long startTime = System.currentTimeMillis(); try { ret.refreshLocks(); } catch (Throwable t) { log.warn("Failed to refresh locks", t); } finally { long elapsed = System.currentTimeMillis() - startTime; if (elapsed > LockRequest.getDefaultLockTimeout().toMillis() / 2) { log.warn("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } else if (elapsed > ret.refreshFrequencyMillis) { log.info("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } } }, 0, ret.refreshFrequencyMillis, TimeUnit.MILLISECONDS); return ret; }
Source:
<code>private void unschedule() throws IOException { if (forceUnschedule) { unregisterOp(OP_WRITE); <START> scheduled.compareAndSet(true, false); <END> return; } if (dirtyOutputBuffer() || currentFrame != null) { registerOp(OP_WRITE); return; } unregisterOp(OP_WRITE); scheduled.set(false); if (writeQueue.isEmpty() && urgentWriteQueue.isEmpty()) { return; } if (!scheduled.compareAndSet(false, true)) { return; } ioThread.addTask(this); }</code><technical_language>call set is scheduled. need do a cas</technical_language>

Target:
private void unschedule() throws IOException { if (forceUnschedule) { unregisterOp(OP_WRITE); scheduled.set(false); return; } if (dirtyOutputBuffer() || currentFrame != null) { registerOp(OP_WRITE); return; } unregisterOp(OP_WRITE); scheduled.set(false); if (writeQueue.isEmpty() && urgentWriteQueue.isEmpty()) { return; } if (!scheduled.compareAndSet(false, true)) { return; } ioThread.addTask(this); }
Source:
<code>private void readMetastore() throws IgniteCheckedException { try { CheckpointStatus status = readCheckpointStatus(); checkpointReadLock(); try { dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().start(); performBinaryMemoryRestore(status, onlyMetastorageGroup(), physicalRecords(), false); metaStorage = createMetastorage(true); <START> boolean encryptionDisabled = cctx.gridConfig().getEncryptionSpi() instanceof NoopEncryptionSpi; <END> applyLogicalUpdates(status, onlyMetastorageGroup(), encryptionDisabled ? onlyMetastorageRecords() : onlyMetastorageAndEncryptionRecords(), false); fillWalDisabledGroups(); notifyMetastorageReadyForRead(); } finally { metaStorage = null; dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().stop(false); cctx.pageStore().cleanupPageStoreIfMatch(new Predicate<Integer>() { @Override public boolean test(Integer grpId) { return MetaStorage.METASTORAGE_CACHE_ID == grpId; } }, false); checkpointReadUnlock(); } } catch (StorageException e) { cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); throw new IgniteCheckedException(e); } }</code><technical_language>need this flag</technical_language>

Target:
private void readMetastore() throws IgniteCheckedException { try { CheckpointStatus status = readCheckpointStatus(); checkpointReadLock(); try { dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().start(); performBinaryMemoryRestore(status, onlyMetastorageGroup(), physicalRecords(), false); metaStorage = createMetastorage(true); applyLogicalUpdates(status, onlyMetastorageGroup(), onlyMetastorageAndEncryptionRecords(), false); fillWalDisabledGroups(); notifyMetastorageReadyForRead(); } finally { metaStorage = null; dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().stop(false); cctx.pageStore().cleanupPageStoreIfMatch(new Predicate<Integer>() { @Override public boolean test(Integer grpId) { return MetaStorage.METASTORAGE_CACHE_ID == grpId; } }, false); checkpointReadUnlock(); } } catch (StorageException e) { cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); throw new IgniteCheckedException(e); } }
Source:
<code>public void verifyToolRemoved(String toolName) { waitForElementNotPresent( <START> By.xpath(toolbarAddedTool.replace(toolNameReplacement, toolName)) <END> ); PageObjectLogging.log("verifyToolRemoved",toolName + " removed from toolbar", true); }</code><technical_language>cssSelector, xPath</technical_language>

Target:
public void verifyToolRemoved(String toolName) { waitForElementNotPresent( By.xpath(String.format(toolbarAddedToolxPath, toolName)) ); PageObjectLogging.log("verifyToolRemoved",toolName + " removed from toolbar", true); }
Source:
<code>public void deleteEndpointRegistry() throws APIManagementException { <START> endpointRegistry.deleteEndpointRegistry("abc1"); <END> }</code><technical_language>Mockito verify</technical_language>

Target:
public void deleteEndpointRegistry() throws APIManagementException { final String REGISTRY_UUID = "abc1"; endpointRegistry.deleteEndpointRegistry(REGISTRY_UUID); Mockito.verify(apiMgtDAO).deleteEndpointRegistry(REGISTRY_UUID); }
Source:
<code>private void addActionsForCommentNotification(NotificationCompat.Builder builder, String noteId) { <START> boolean bActionsSet = false; <END> if (SimperiumUtils.getNotesBucket() != null) { try { Note note = SimperiumUtils.getNotesBucket().get(noteId); if (note != null) { if (note.canReply()) { addCommentReplyActionForCommentNotification(builder, noteId); } if (note.getCommentStatus().equals(CommentStatus.UNAPPROVED)) { if (note.canModerate()) { addCommentApproveActionForCommentNotification(builder, noteId); } } else { if (note.canLike()) { addCommentLikeActionForCommentNotification(builder, noteId); } } } bActionsSet = true; } catch (BucketObjectMissingException e) { e.printStackTrace(); } } if (!bActionsSet) { addCommentReplyActionForCommentNotification(builder, noteId); addCommentLikeActionForCommentNotification(builder, noteId); } }</code><technical_language>prefix is m for member variables. Please rename this boolean a question format, areActionsSet</technical_language>

Target:
private void addActionsForCommentNotification(NotificationCompat.Builder builder, String noteId) { boolean areActionsSet = false; if (SimperiumUtils.getNotesBucket() != null) { try { Note note = SimperiumUtils.getNotesBucket().get(noteId); if (note != null) { if (note.canReply()) { addCommentReplyActionForCommentNotification(builder, noteId); } if (note.getCommentStatus().equals(CommentStatus.UNAPPROVED)) { if (note.canModerate()) { addCommentApproveActionForCommentNotification(builder, noteId); } } else { if (note.canLike()) { addCommentLikeActionForCommentNotification(builder, noteId); } } } areActionsSet = true; } catch (BucketObjectMissingException e) { e.printStackTrace(); } } if (!areActionsSet) { addCommentReplyActionForCommentNotification(builder, noteId); addCommentLikeActionForCommentNotification(builder, noteId); } }
Source:
<code>public OffsetQueue(HermesMetrics metrics, ConfigFactory configFactory) { int queueSize = configFactory.getIntProperty(Configs.CONSUMER_COMMIT_OFFSET_QUEUES_SIZE); this.inflightOffsetsQueue = new MonitoredMpscQueue<>(metrics, "inflightOffsets", queueSize); <START> this.commitOffsetsQueue = new MonitoredMpscQueue<>(metrics, "committedOffsets.", queueSize); <END> }</code><technical_language>? . in inflightOffsets</technical_language>

Target:
public OffsetQueue(HermesMetrics metrics, ConfigFactory configFactory) { int queueSize = configFactory.getIntProperty(Configs.CONSUMER_COMMIT_OFFSET_QUEUES_SIZE); this.inflightOffsetsQueue = new MonitoredMpscQueue<>(metrics, "inflightOffsets", queueSize); this.commitOffsetsQueue = new MonitoredMpscQueue<>(metrics, "committedOffsets", queueSize); }
Source:
<code>private void setField(ExtensionEntity entity, Extension.Builder builder) { for (ExtensionFieldEntity fieldEntity : entity.getFields()) { switch (fieldEntity.getType().getName()) { case "STRING": builder.setField(fieldEntity.getName(), "null"); break; case "INTEGER": builder.setField(fieldEntity.getName(), BigInteger.ZERO); break; case "DECIMAL": builder.setField(fieldEntity.getName(), BigDecimal.ZERO); break; case "BOOLEAN": builder.setField(fieldEntity.getName(), false); break; case "DATE_TIME": builder.setField(fieldEntity.getName(), new Date(0L)); break; case "BINARY": builder.setField(fieldEntity.getName(), ByteBuffer.wrap(new byte[]{})); break; case "REFERENCE": try { builder.setField(fieldEntity.getName(), new URI("<LINK_0>")); } catch (URISyntaxException e) { throw new OsiamBackendFailureException("An unexpected error occured."); } break; default: <START> throw new NoSuchElementException("Type " + fieldEntity.getType().getName() + " does not exist"); <END> } } }</code><technical_language>please add single quotes fieldEntity.getType().getName()</technical_language>

Target:
private void setField(ExtensionEntity entity, Extension.Builder builder) { for (ExtensionFieldEntity fieldEntity : entity.getFields()) { switch (fieldEntity.getType().getName()) { case "STRING": builder.setField(fieldEntity.getName(), "null"); break; case "INTEGER": builder.setField(fieldEntity.getName(), BigInteger.ZERO); break; case "DECIMAL": builder.setField(fieldEntity.getName(), BigDecimal.ZERO); break; case "BOOLEAN": builder.setField(fieldEntity.getName(), false); break; case "DATE_TIME": builder.setField(fieldEntity.getName(), new Date(0L)); break; case "BINARY": builder.setField(fieldEntity.getName(), ByteBuffer.wrap(new byte[]{})); break; case "REFERENCE": try { builder.setField(fieldEntity.getName(), new URI("<LINK_0>")); } catch (URISyntaxException e) { LOGGER.warn("Unable to contruct URI for <LINK_0> This should never happen!", e); throw new OsiamBackendFailureException(); } break; default: throw new NoSuchElementException("Type '" + fieldEntity.getType().getName() + "' does not exist"); } } }
Source:
<code>public static void setup() { TuningContext context = new TuningContext("Pressure").publishSavingEvent(); pressureGauge = FloatMixing.createDispatch(FloatMixing.normalizeFloat(Igneous.makeAnalogInput(0), context.getFloat("pressure-min", 0.0f), context.getFloat("pressure-max", 1.0f)), Igneous.globalPeriodic); Cluck.publish("Pressure Switch", pressureSwitch); Cluck.publish("Pressure Gauge", pressureGauge); <START> Cluck.publish("Compressor", compressor); <END> }</code><technical_language>this name more descriptive</technical_language>

Target:
public static void setup() { TuningContext context = new TuningContext("Pressure").publishSavingEvent(); pressureGauge = FloatMixing.createDispatch(FloatMixing.normalizeFloat(Igneous.makeAnalogInput(0), context.getFloat("pressure-min", 0.0f), context.getFloat("pressure-max", 1.0f)), Igneous.globalPeriodic); Cluck.publish("Pressure Switch", pressureSwitch); Cluck.publish("Pressure Gauge", pressureGauge); Cluck.publish("Compressor Enable", compressor); }
Source:
<code>public List<ArtifactStore> filter( String path, Group group, List<ArtifactStore> concreteStores ) { List<String> candidates = getCandidates( concreteStores ); if ( candidates.isEmpty() ) { logger.debug( "No candidate matches, skip" ); return concreteStores; } String strategyPath = getStrategyPath( group.getKey(), path ); if ( strategyPath == null ) { logger.debug( "Can not get strategy path, group: {}, path: {}", group.getKey(), path ); return concreteStores; } <START> Set<String> ret = new HashSet<>(); <END> int batchSize = indyConfig.getFileSystemContainingBatchSize(); List<List<String>> subSets = Lists.partition( candidates, batchSize ); subSets.forEach( subSet -> { logger.debug( "getFileSystemContaining, strategyPath: {}, subSet: {}", strategyPath, subSet ); Set<String> s = pathMappedFileManager.getFileSystemContainingDirectory( subSet, strategyPath ); ret.addAll( s ); } ); return concreteStores.stream() .filter( store -> store.getType() == StoreType.remote || ret.contains( store.getKey().toString() ) ) .collect( Collectors.toList() ); }</code><technical_language>this breaks time operation times of operations need connect cassandra. candidates in real env (3000+?). test if this bring connection performance. (or concurrent them?)</technical_language>

Target:
public List<ArtifactStore> filter( String path, Group group, List<ArtifactStore> concreteStores ) { List<String> candidates = getCandidates( concreteStores ); if ( candidates.isEmpty() ) { logger.debug( "No candidate matches, skip" ); return concreteStores; } String strategyPath = getStrategyPath( group.getKey(), path ); if ( strategyPath == null ) { logger.debug( "Can not get strategy path, group: {}, path: {}", group.getKey(), path ); return concreteStores; } Set<String> ret = new HashSet<>(); int batchSize = indyConfig.getFileSystemContainingBatchSize(); List<List<String>> subSets = Lists.partition( candidates, batchSize ); subSets.forEach( subSet -> { logger.debug( "Get file system containing, strategyPath: {}, subSet: {}", strategyPath, subSet ); Set<String> st = pathMappedFileManager.getFileSystemContainingDirectory( subSet, strategyPath ); if ( st == null ) { logger.warn( "Get fileSystems query failed, add subSet candidates" ); ret.addAll( subSet ); } else { ret.addAll( st ); } } ); return concreteStores.stream() .filter( store -> store.getType() == StoreType.remote || ret.contains( store.getKey().toString() ) ) .collect( Collectors.toList() ); }
Source:
<code><START> public Timeline2 crawlWordpress(String blogURL, BufferedReader br) { <END> Document blogHTML = null; Post blogPost = null; Elements articles = null; Elements articleList_title = null; Elements articleList_content = null; Elements articleList_dateTime = null; Elements articleList_author = null; Timeline2 blogList = new Timeline2(this.order); try { blogHTML = Jsoup.parse(bufferedReaderToString(br)); } catch (IOException e) { DAO.trace(e); } String[][] blogPostList = new String[100][4]; Integer numberOfBlogs = 0; articles = blogHTML.getElementsByTag("article"); int iterator = 0; for (Element article : articles) { articleList_title = article.getElementsByClass("entry-title"); for (Element blogs : articleList_title) { blogPostList[iterator][0] = blogs.text().toString(); } articleList_dateTime = article.getElementsByClass("posted-on"); for (Element blogs : articleList_dateTime) { blogPostList[iterator][1] = blogs.text().toString(); } articleList_author = article.getElementsByClass("byline"); for (Element blogs : articleList_author) { String author = blogs.text().toString(); author = author.substring(author.indexOf(' ') + 1); blogPostList[iterator][2] = author; } articleList_content = article.getElementsByClass("entry-content"); for (Element blogs : articleList_content) { blogPostList[iterator][3] = blogs.text().toString(); } iterator++; } numberOfBlogs = iterator; for (int k = 0; k < numberOfBlogs; k++) { blogPost = new Post(); blogPost.put("blog_url", blogURL); blogPost.put("title", blogPostList[k][0]); blogPost.put("posted_on", blogPostList[k][1]); blogPost.put("author", blogPostList[k][2]); blogPost.put("content", blogPostList[k][3]); blogList.addPost(blogPost); } return blogList; }</code><technical_language>I beginning, please this empty line :)</technical_language>

Target:
public Timeline2 crawlWordpress(String blogURL, BufferedReader br) { Post blogPost = null; Timeline2 blogList = new Timeline2(this.order); Document blogHTML = null; Elements articles = null; Elements articleList_title = null; Elements articleList_content = null; Elements articleList_dateTime = null; Elements articleList_author = null; try { blogHTML = Jsoup.parse(bufferedReaderToString(br)); } catch (IOException e) { DAO.trace(e); } articles = blogHTML.getElementsByTag("article"); for (Element article : articles) { blogPost = new Post(); blogPost.put("blog_url", blogURL); articleList_title = article.getElementsByClass("entry-title"); for (Element blogs : articleList_title) { blogPost.put("title", blogs.text().toString()); } articleList_dateTime = article.getElementsByClass("posted-on"); for (Element blogs : articleList_dateTime) { blogPost.put("posted_on", blogs.text().toString()); } articleList_author = article.getElementsByClass("byline"); for (Element blogs : articleList_author) { String author = blogs.text().toString(); author = author.substring(author.indexOf(' ') + 1); blogPost.put("author", author); } articleList_content = article.getElementsByClass("entry-content"); for (Element blogs : articleList_content) { blogPost.put("content", blogs.text().toString()); } blogList.addPost(blogPost); } return blogList; }
Source:
<code>public static List<Alarm> disableExpiredNoneRepeatedAlarms(final List<Alarm> alarms, long currentTimestampUTC, final DateTimeZone timeZone){ final ArrayList<Alarm> newAlarmList = new ArrayList<>(); for(final Alarm alarm:alarms){ if(alarm.isRepeated){ newAlarmList.add(alarm); continue; } <START> if(isAlarmExpired(alarm, new DateTime(currentTimestampUTC, DateTimeZone.UTC), timeZone)){ <END> final Alarm disabledAlarm = new Alarm(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, new HashSet<Integer>(), false, false, alarm.isEditable, alarm.sound); newAlarmList.add(disabledAlarm); }else{ newAlarmList.add(alarm); } } return ImmutableList.copyOf(newAlarmList); }</code><technical_language>Merge logic above</technical_language>

Target:
public static List<Alarm> disableExpiredNoneRepeatedAlarms(final List<Alarm> alarms, long currentTimestampUTC, final DateTimeZone timeZone){ final ArrayList<Alarm> newAlarmList = new ArrayList<>(); for(final Alarm alarm:alarms){ if(isAlarmExpired(alarm, new DateTime(currentTimestampUTC, DateTimeZone.UTC), timeZone)){ final Alarm disabledAlarm = new Alarm(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, new HashSet<Integer>(), false, false, alarm.isEditable, alarm.sound); newAlarmList.add(disabledAlarm); }else{ newAlarmList.add(alarm); } } return ImmutableList.copyOf(newAlarmList); }
Source:
<code>public ZipVerifier(InputStream keyStoreInputStream, String keyStorePass) throws InvalidKeyStoreException, KeyStoreException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { assert (keyStoreInputStream != null && keyStorePass != null); initPKIXParameter(keyStoreInputStream, keyStorePass); <START> Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2019); cal.set(Calendar.MONTH, 0); cal.set(Calendar.DAY_OF_MONTH, 01); defaultSignatureTimeStamp = cal.getTime(); <END> }</code><technical_language>this "defaultSignatureTimestamp"? is relationship 2019? set "0" for month? next certificate expires</technical_language>

Target:
public ZipVerifier(InputStream keyStoreInputStream, String keyStorePass) throws InvalidKeyStoreException, KeyStoreException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { assert (keyStoreInputStream != null && keyStorePass != null); initPKIXParameter(keyStoreInputStream, keyStorePass); defaultSignatureTimeStamp = Date.from(LocalDate.of(2019, 1, 1).atStartOfDay(ZoneId.systemDefault()).toInstant()); }
Source:
<code>public void testSaveNullId() throws Exception { Document expectedDocument = new Document(); expectedDocument.setId(null); expectedDocument.setTimestamp(System.currentTimeMillis()); JsonNode data = mapper.valueToTree(Collections.singletonMap("TEST_NAME", "SINGLE_SAVE_TEST")); expectedDocument.setData(data); <START> queryStore.save(TestUtils.TEST_TABLE_NAME, expectedDocument); <END> }</code><technical_language>Check for equality of error code</technical_language>

Target:
public void testSaveNullId() throws Exception { Document expectedDocument = new Document(); expectedDocument.setId(null); expectedDocument.setTimestamp(System.currentTimeMillis()); JsonNode data = mapper.valueToTree(Collections.singletonMap("TEST_NAME", "SINGLE_SAVE_TEST")); expectedDocument.setData(data); try { queryStore.save(TestUtils.TEST_TABLE_NAME, expectedDocument); } catch (QueryStoreException e) { assertEquals(QueryStoreException.ErrorCode.INVALID_REQUEST, e.getErrorCode()); throw e; } }
Source:
<code>public Collection<Ref> call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { <START> return callAsMap().values(); <END> }</code><technical_language>API breakage. returned collection modifiable, is more. if affected</technical_language>

Target:
public Collection<Ref> call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { return execute().values(); }
Source:
<code>public Configuration getConfiguration(GraphContext context) { AbstractIterationOperation<JavaTypeReferenceModel> addTypeRefToList = new AbstractIterationOperation<JavaTypeReferenceModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) { typeReferences.add(payload); } }; return ConfigurationBuilder.begin() .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Furnace Service {file}").withDescription("Described by {file}").with(Link.to("JBoss Forge", "<LINK_0>")).withEffort(0) .and(Hint.withText("Furnace type references (such as {name}) imply that the client code must be run within a Furnace container.") .withEffort(8) .and(addTypeRefToList)) ) .where("suffix").matches("\\d") <START> .addRule() <END> .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Classification {param} does not exist") .and(Hint.withText("Hint {param} does not exist").withEffort(8)) ); }</code><technical_language>Bad formatting</technical_language>

Target:
public Configuration getConfiguration(GraphContext context) { AbstractIterationOperation<JavaTypeReferenceModel> addTypeRefToList = new AbstractIterationOperation<JavaTypeReferenceModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) { typeReferences.add(payload); } }; return ConfigurationBuilder.begin() .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Furnace Service {file}").withDescription("Described by {file}").with(Link.to("JBoss Forge", "<LINK_0>")).withEffort(0) .and(Hint.withText("Furnace type references (such as {name}) imply that the client code must be run within a Furnace container.") .withEffort(8) .and(addTypeRefToList)) ) .where("suffix").matches("\\d") .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Classification {param} does not exist"), Hint.withText("Hint {param} does not exist").withEffort(8) ); }
Source:
<code>public NexmoSmsSender(final NexmoProperties nexmo) { val builder = new NexmoClient.Builder(); builder.apiKey(nexmo.getApiToken()) .apiSecret(nexmo.getApiSecret()); if (StringUtils.isNotBlank(nexmo.getPrivateKeyContentsPath())) { try { builder.applicationId(StringUtils.isNotBlank(nexmo.getApplicationId()) ? nexmo.getApplicationId() : DEFAULT_APPLICATION_ID) .privateKeyPath(nexmo.getPrivateKeyContentsPath()); } catch (IOException e) { <START> LOGGER.error("No NEXMO private key found", e); <END> } } this.nexmoClient = builder.build(); }</code><technical_language>Nexmo</technical_language>

Target:
public NexmoSmsSender(final NexmoProperties nexmo) { val builder = new NexmoClient.Builder(); this.nexmoClient = builder.apiKey(nexmo.getApiToken()) .apiSecret(nexmo.getApiSecret()) .signatureSecret(nexmo.getSignatureSecret()).build(); }
Source:
<code>void caption() { assertEquals("", TreeNode.createCaption("")); assertEquals("@", TreeNode.createCaption("@")); assertEquals("@.", TreeNode.createCaption("@\t")); assertEquals("@..", TreeNode.createCaption("@\t\n")); assertEquals("@...", TreeNode.createCaption("@\t\n\r")); <START> assertEquals("@".repeat(80) + "...", TreeNode.createCaption("@".repeat(1000))); <END> }</code><technical_language>Is special @</technical_language>

Target:
void caption() { assertEquals("", TreeNode.createCaption("")); assertEquals("[@@]", TreeNode.createCaption("[@@]")); assertEquals("[@ @]", TreeNode.createCaption("[@ @]")); assertEquals("[@ @]", TreeNode.createCaption("[@\u000B@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t\n@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t\n\r@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t\n\r\f@]")); assertEquals("@".repeat(80) + "...", TreeNode.createCaption("@".repeat(1000) + "!")); }