auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void scan( Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( 0 ); } this.next = 0; this.highMark = read.nodeHighMark(); this.read = read; <START> if ( labelCursor != null ) <END> { labelCursor = read.labelCursor(); } }</code><technical_language>I missing labelCursor == null</technical_language>

Target:
void scan( Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( 0 ); } this.next = 0; this.highMark = read.nodeHighMark(); this.read = read; if ( labelCursor == null ) { labelCursor = read.labelCursor(); } }
Source:
<code>public void testUpdateNotAppend(){ <START> final RingTime ringTime = new RingTime(DateTime.now().getMillis(), DateTime.now().getMillis(), new long[]{1L}, false, Lists.newArrayList()); <END> this.mergedUserInfoDynamoDB.setTimeZone(this.deviceId, this.accountId, DateTimeZone.UTC); this.mergedUserInfoDynamoDB.setRingTime(this.deviceId, this.accountId, ringTime); this.mergedUserInfoDynamoDB.setPillColor(this.deviceId, this.accountId, "Pang's Pill", new Color(0xFE, 0x00, 0x00)); final List<UserInfo> userInfoList = this.mergedUserInfoDynamoDB.getInfo(this.deviceId); assertThat(userInfoList.size(), is(1)); assertThat(userInfoList.get(0).ringTime.isPresent(), is(true)); assertThat(userInfoList.get(0).timeZone.isPresent(), is(true)); assertThat(userInfoList.get(0).ringTime.get().equals(ringTime), is(true)); assertThat(userInfoList.get(0).timeZone.get().equals(DateTimeZone.UTC), is(true)); final int intARGB = userInfoList.get(0).pillColor.get().getPillColor(); if(ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { assertThat(intARGB, is(0x0000FEFF)); }else{ assertThat(intARGB, is(0xFFFE0000)); } }</code><technical_language>create a constructor expect a list avoid passing empty values if needed</technical_language>

Target:
public void testUpdateNotAppend(){ final RingTime ringTime = new RingTime(DateTime.now().getMillis(), DateTime.now().getMillis(), new long[]{1L}, false); this.mergedUserInfoDynamoDB.setTimeZone(this.deviceId, this.accountId, DateTimeZone.UTC); this.mergedUserInfoDynamoDB.setRingTime(this.deviceId, this.accountId, ringTime); this.mergedUserInfoDynamoDB.setPillColor(this.deviceId, this.accountId, "Pang's Pill", new Color(0xFE, 0x00, 0x00)); final List<UserInfo> userInfoList = this.mergedUserInfoDynamoDB.getInfo(this.deviceId); assertThat(userInfoList.size(), is(1)); assertThat(userInfoList.get(0).ringTime.isPresent(), is(true)); assertThat(userInfoList.get(0).timeZone.isPresent(), is(true)); assertThat(userInfoList.get(0).ringTime.get().equals(ringTime), is(true)); assertThat(userInfoList.get(0).timeZone.get().equals(DateTimeZone.UTC), is(true)); final int intARGB = userInfoList.get(0).pillColor.get().getPillColor(); if(ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { assertThat(intARGB, is(0x0000FEFF)); }else{ assertThat(intARGB, is(0xFFFE0000)); } }
Source:
<code>private RemoteIterator<S3ALocatedFileStatus> innerListFiles( final Path f, final boolean recursive, final Listing.FileStatusAcceptor acceptor, final S3AFileStatus status, final boolean collectTombstones, final boolean forceNonAuthoritativeMS) throws IOException { entryPoint(INVOCATION_LIST_FILES); Path path = qualify(f); LOG.debug("listFiles({}, {})", path, recursive); try { if (status != null && status.isFile()) { LOG.debug("Path is a file"); return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(status)); } RemoteIterator<S3ALocatedFileStatus> listFilesAssumingDir = getListFilesAssumingDir(path, recursive, acceptor, collectTombstones, forceNonAuthoritativeMS); if (!listFilesAssumingDir.hasNext()) { <START> final S3AFileStatus fileStatus = (S3AFileStatus) getFileStatus(path); <END> if (fileStatus.isFile()) { return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(fileStatus)); } } return listFilesAssumingDir; } catch (AmazonClientException e) { throw translateException("listFiles", path, e); } }</code><technical_language>innerGetFileStatus probes for file dir marker -HEAD_OR_DIR_MARKER; need issue a LIST call, do we? This save a call listing a missing path</technical_language>

Target:
private RemoteIterator<S3ALocatedFileStatus> innerListFiles( final Path f, final boolean recursive, final Listing.FileStatusAcceptor acceptor, final S3AFileStatus status, final boolean collectTombstones, final boolean forceNonAuthoritativeMS) throws IOException { entryPoint(INVOCATION_LIST_FILES); Path path = qualify(f); LOG.debug("listFiles({}, {})", path, recursive); try { if (status != null && status.isFile()) { LOG.debug("Path is a file"); return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(status)); } RemoteIterator<S3ALocatedFileStatus> listFilesAssumingDir = getListFilesAssumingDir(path, recursive, acceptor, collectTombstones, forceNonAuthoritativeMS); if (!listFilesAssumingDir.hasNext()) { final S3AFileStatus fileStatus = status != null ? status : (S3AFileStatus) getFileStatus(path); if (fileStatus.isFile()) { return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(fileStatus)); } } return listFilesAssumingDir; } catch (AmazonClientException e) { throw translateException("listFiles", path, e); } }
Source:
<code>private static ConstitutionalTribunalJudgment createCtJudgmentWithRandomData(String prefix, int numericPrefix) { <START> ConstitutionalTribunalJudgment ccJudgment = new ConstitutionalTribunalJudgment(); <END> TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ccJudgment, prefix, numericPrefix); ccJudgment.getSourceInfo().setSourceCode(SourceCode.COMMON_COURT); JudgmentKeyword firstKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(18)); JudgmentKeyword secondKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(19)); ccJudgment.addKeyword(firstKeyword); ccJudgment.addKeyword(secondKeyword); return ccJudgment; }</code><technical_language>if variable name 'ctJudgment'</technical_language>

Target:
private static ConstitutionalTribunalJudgment createCtJudgmentWithRandomData(String prefix, int numericPrefix) { ConstitutionalTribunalJudgment ctJudgment = new ConstitutionalTribunalJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ctJudgment, prefix, numericPrefix); ctJudgment.getSourceInfo().setSourceCode(SourceCode.CONSTITUTIONAL_TRIBUNAL); JudgmentKeyword firstKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(18)); JudgmentKeyword secondKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(19)); ctJudgment.addKeyword(firstKeyword); ctJudgment.addKeyword(secondKeyword); return ctJudgment; }
Source:
<code>public void tearDown() { ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); for (ISynchronizeParticipantReference participant : participants) { try { ISynchronizeParticipantReference <START> ref = <END> participant; if(ref.getParticipant().getId().equals(CVSMergeSubscriber.ID)) { TeamUI.getSynchronizeManager().removeSynchronizeParticipants(new ISynchronizeParticipant[] {ref.getParticipant()}); } }catch (TeamException e) { return; } } while (Display.getCurrent().readAndDispatch()) {}; }</code><technical_language>in loop</technical_language>

Target:
public void tearDown() { ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); for (ISynchronizeParticipantReference ref : participants) { try { if(ref.getParticipant().getId().equals(CVSMergeSubscriber.ID)) { TeamUI.getSynchronizeManager().removeSynchronizeParticipants(new ISynchronizeParticipant[] {ref.getParticipant()}); } }catch (TeamException e) { return; } } while (Display.getCurrent().readAndDispatch()) {}; }
Source:
<code>private String buildInOperator(int size) { if (size == 1) { return "(?)"; } String builder = "(" + TextUtils.join(",", Collections.nCopies(size, "?")) + ")"; <START> return builder; <END> }</code><technical_language>return instead of creating a String</technical_language>

Target:
private String buildInOperator(int size) { if (size == 1) { return "(?)"; } return "(" + TextUtils.join(",", Collections.nCopies(size, "?")) + ")"; }
Source:
<code>public void success() { <START> <END> }</code><technical_language>?? this left empty</technical_language>

Target:
public void success() { delegate.success(); }
Source:
<code>public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { final Sink sink = getSink(row.getTimestampFromEpoch()); if (sink == null) { return -1; } final int numRows = sink.add(row); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush) { persist(committerSupplier.get()); } if (++counter % CHECK_INTERNAL_COUNT == 0) { int size = 0; for (Sink aSink : sinks.values()) { size += aSink.size(); } if (size > config.getMaxRowsInMemory()) { <START> persistOldest(committerSupplier.get()); <END> } } return numRows; }</code><technical_language>this persist is triggered maxRows config, sense persist maxSize ? oldest small number of rows</technical_language>

Target:
public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { final Sink sink = getSink(row.getTimestampFromEpoch()); if (sink == null) { return -1; } final int numRows = sink.add(row); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush) { persist(committerSupplier.get()); } if (maxRowExceedCheckCount > 0 && ++checkCounter % maxRowExceedCheckCount == 0) { if (rowCountInMemory() > config.getMaxRowsInMemory() || occupationInMemory() > config.getMaxOccupationInMemory()) { persistOldest(committerSupplier.get()); } } return numRows; }
Source:
<code>public boolean isConsumedOutDataStreamsJobBuilderConfigured(final boolean throwException) { final List<AnalysisJobBuilder> consumedOutputDataStreamsJobBuilders = getConsumedOutputDataStreamsJobBuilders(); <START> boolean isConfigurated = true; <END> for (final AnalysisJobBuilder analysisJobBuilder : consumedOutputDataStreamsJobBuilders) { isConfigurated &= analysisJobBuilder.isConfigured(throwException); } return isConfigurated; }</code><technical_language>"isConfigured" I avoid completely return false moment find is configured, return true otherwise</technical_language>

Target:
private boolean isConsumedOutDataStreamsJobBuilderConfigured(final boolean throwException) { final List<AnalysisJobBuilder> consumedOutputDataStreamsJobBuilders = getConsumedOutputDataStreamsJobBuilders(); for (final AnalysisJobBuilder analysisJobBuilder : consumedOutputDataStreamsJobBuilders) { if (!analysisJobBuilder.isConfigured(throwException)) { return false; } } return true; }
Source:
<code>public boolean overrideRule(final String dataSource, final List<Rule> newRules, final AuditInfo auditInfo) { synchronized (lock) { try { dbi.inTransaction( new TransactionCallback<Void>() { @Override public Void inTransaction(Handle handle, TransactionStatus transactionStatus) throws Exception { final DateTime auditTime = DateTime.now(); auditManager.doAudit( AuditEntry.builder() .key(dataSource) .type("rules") .auditInfo(auditInfo) .payload(jsonMapper.writeValueAsString(newRules)) .auditTime(auditTime) .build(), handle ); String version = auditTime.toString(); handle.createStatement( String.format( "INSERT INTO %s (id, dataSource, version, payload) VALUES (:id, :dataSource, :version, :payload)", getRulesTable() ) ) .bind("id", String.format("%s_%s", dataSource, version)) .bind("dataSource", dataSource) .bind("version", version) .bind("payload", jsonMapper.writeValueAsBytes(newRules)) .execute(); return null; } } ); } catch (Exception e) { log.error(e, String.format("Exception while overriding rule for %s", dataSource)); return false; } } <START> poll(); <END> return true; }</code><technical_language>throw exception if DB connection is disrupted. repeating runnable in start() handles a case</technical_language>

Target:
public boolean overrideRule(final String dataSource, final List<Rule> newRules, final AuditInfo auditInfo) { synchronized (lock) { try { dbi.inTransaction( new TransactionCallback<Void>() { @Override public Void inTransaction(Handle handle, TransactionStatus transactionStatus) throws Exception { final DateTime auditTime = DateTime.now(); auditManager.doAudit( AuditEntry.builder() .key(dataSource) .type("rules") .auditInfo(auditInfo) .payload(jsonMapper.writeValueAsString(newRules)) .auditTime(auditTime) .build(), handle ); String version = auditTime.toString(); handle.createStatement( String.format( "INSERT INTO %s (id, dataSource, version, payload) VALUES (:id, :dataSource, :version, :payload)", getRulesTable() ) ) .bind("id", String.format("%s_%s", dataSource, version)) .bind("dataSource", dataSource) .bind("version", version) .bind("payload", jsonMapper.writeValueAsBytes(newRules)) .execute(); return null; } } ); } catch (Exception e) { log.error(e, String.format("Exception while overriding rule for %s", dataSource)); return false; } } try { poll(); } catch (Exception e) { log.error(e, String.format("Exception while polling for rules after overriding the rule for %s", dataSource)); } return true; }
Source:
<code>public static void main(String[] args) { final AtomicBoolean isRunning = new AtomicBoolean(true); Mono.delay(Duration.ofMinutes(2)).subscribe(index -> { System.out.println("2 minutes has elapsed, stopping receive loop."); isRunning.set(false); }); String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusSessionReceiverClient sessionReceiver = new ServiceBusClientBuilder() .connectionString(connectionString) .sessionReceiver() .queueName("<<queue-name>>") .buildClient(); <START> ServiceBusReceiverClient receiver = sessionReceiver.acceptSession("greetings-id"); <END> while (isRunning.get()) { IterableStream<ServiceBusReceivedMessage> messages = receiver.receiveMessages(10, Duration.ofSeconds(30)); for (ServiceBusReceivedMessage message : messages) { boolean isSuccessfullyProcessed = processMessage(message); if (isSuccessfullyProcessed) { receiver.complete(message); } else { receiver.abandon(message, null); } } } sessionReceiver.close(); }</code><technical_language>this closed</technical_language>

Target:
public static void main(String[] args) { final AtomicBoolean isRunning = new AtomicBoolean(true); Mono.delay(Duration.ofMinutes(2)).subscribe(index -> { System.out.println("2 minutes has elapsed, stopping receive loop."); isRunning.set(false); }); String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusSessionReceiverClient sessionReceiver = new ServiceBusClientBuilder() .connectionString(connectionString) .sessionReceiver() .queueName("<<queue-name>>") .buildClient(); ServiceBusReceiverClient receiver = sessionReceiver.acceptSession("greetings-id"); try { while (isRunning.get()) { IterableStream<ServiceBusReceivedMessage> messages = receiver.receiveMessages(10, Duration.ofSeconds(30)); for (ServiceBusReceivedMessage message : messages) { boolean isSuccessfullyProcessed = processMessage(message); if (isSuccessfullyProcessed) { receiver.complete(message); } else { receiver.abandon(message, null); } } } } finally { receiver.close(); } sessionReceiver.close(); }
Source:
<code>private void createBuildLabels(Composite composite, FormColors colors) { String patchSetId = this.set.getId(); TaskAttribute buildAttribute = this.parentSection.getTaskData() .getRoot() .getAttribute("BUILD_RESULT-" + patchSetId); <START> int numberOfBuilds = buildAttribute.getAttributes().size(); <END> for (int i = 0; i < numberOfBuilds; i++) { String buildKey = "BUILD_RESULT-" + i; TaskAttribute currentBuildAttribute = buildAttribute.getAttribute(buildKey); String statusValue = currentBuildAttribute.getAttribute("STATUS").getValue(); final String urlValue = currentBuildAttribute.getAttribute("URL").getValue(); ScalingHyperlink buildLink = new ScalingHyperlink(composite, SWT.READ_ONLY); buildLink.setText(urlValue); buildLink.setForeground(CommonColors.HYPERLINK_WIDGET); buildLink.registerMouseTrackListener(); buildLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent event) { BrowserUtil.openUrl(urlValue); } }); CLabel buildText = new CLabel(composite, SWT.RIGHT_TO_LEFT); buildText.setText(statusValue); buildText.setImage(this.getImageForBuildStatus(statusValue)); } }</code><technical_language>If a user upgraded this Mylyn version, buildAttribute null task data created older version</technical_language>

Target:
private void createBuildLabels(Composite composite, FormColors colors) { String patchSetId = this.set.getId(); TaskAttribute buildAttribute = this.parentSection.getTaskData() .getRoot() .getAttribute("PATCH_SET-" + patchSetId); if (buildAttribute == null) { return; } int numberOfBuilds = buildAttribute.getAttributes().size(); for (Entry<String, TaskAttribute> buildEntry : buildAttribute.getAttributes().entrySet()) { TaskAttribute currentBuildAttribute = buildEntry.getValue(); String statusValue = currentBuildAttribute.getAttribute("STATUS").getValue(); final String urlValue = currentBuildAttribute.getAttribute("URL").getValue(); ScalingHyperlink buildLink = new ScalingHyperlink(composite, SWT.READ_ONLY); buildLink.setText(urlValue); buildLink.setForeground(CommonColors.HYPERLINK_WIDGET); buildLink.registerMouseTrackListener(); buildLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent event) { BrowserUtil.openUrl(urlValue); } }); CLabel buildText = new CLabel(composite, SWT.RIGHT_TO_LEFT); buildText.setText(statusValue); buildText.setImage(this.getImageForBuildStatus(statusValue)); } }
Source:
<code>private int[] propertyKeyIds() { return populations.keySet().stream().flatMapToInt( this::propertyKeyIds ).distinct().toArray(); <START> } <END></code><technical_language>This method is pretty inefficient, is labelIds(), a single for-loop build arrays once, streams add overhead</technical_language>

Target:
private int[] propertyKeyIds() { return populations.stream().flatMapToInt( this::propertyKeyIds ).distinct().toArray(); }
Source:
<code>public static void assertMatchesMask(Message message, FieldMask fieldMask) { final List<String> paths = fieldMask.getPathsList(); for (Descriptors.FieldDescriptor field : message.getDescriptorForType() .getFields()) { if (field.isRepeated()) { continue; } <START> <END> Assert.assertEquals(message.hasField(field), paths.contains(field.getFullName())); } }</code><technical_language>Please remove empty line</technical_language>

Target:
public static void assertMatchesMask(Message message, FieldMask fieldMask) { final List<String> paths = fieldMask.getPathsList(); for (Descriptors.FieldDescriptor field : message.getDescriptorForType() .getFields()) { if (field.isRepeated()) { continue; } assertEquals(message.hasField(field), paths.contains(field.getFullName())); } }
Source:
<code>public Response getExport(ExportRequest exportRequest) throws Exception { context.getExhibitor().getLog().add(ActivityLog.Type.INFO, "Starting export"); Exporter exporter = new Exporter(context, exportRequest.getStartPath()); <START> return Response.ok(exporter.generate().toString()) <END> .header("content-disposition", "attachment; filename=exhibitor_export.json") .build(); }</code><technical_language>toString() is unnecessary</technical_language>

Target:
public Response getExport(ExportRequest exportRequest) throws Exception { context.getExhibitor().getLog().add(ActivityLog.Type.INFO, "Starting export"); Exporter exporter = new Exporter(context, exportRequest.getStartPath()); return Response.ok(exporter.generate()) .header("content-disposition", "attachment; filename=exhibitor_export.json") .build(); }
Source:
<code>LinkPreviewContents(@NonNull PageSummary pageSummary, @NonNull WikiSite wiki) { title = new PageTitle(pageSummary.getTitle(), wiki); String extractStr; if (pageSummary instanceof RbPageSummary) { extractStr = pageSummary.getExtractHtml(); } else { extractStr = createLegacyExtractText(pageSummary, title.getWikiSite()); } if (pageSummary.getType().equals(PageSummary.TYPE_DISAMBIGUATION)) { extractStr = "<p>" + WikipediaApp.getInstance().getString(R.string.link_preview_disambiguation_description) + "</p>" + extractStr; } extract = Html.fromHtml(extractStr); title.setThumbUrl(pageSummary.getThumbnailUrl()); <START> disambiguation = pageSummary.getType().equals(PageSummary.TYPE_DISAMBIGUATION); <END> }</code><technical_language>if move this line 41, disambiguation line 47 logic instead of checking type twice</technical_language>

Target:
LinkPreviewContents(@NonNull PageSummary pageSummary, @NonNull WikiSite wiki) { title = new PageTitle(pageSummary.getTitle(), wiki); disambiguation = pageSummary.getType().equals(PageSummary.TYPE_DISAMBIGUATION); String extractStr; if (pageSummary instanceof RbPageSummary) { extractStr = pageSummary.getExtractHtml(); } else { extractStr = createLegacyExtractText(pageSummary, title.getWikiSite()); } if (disambiguation) { extractStr = "<p>" + WikipediaApp.getInstance().getString(R.string.link_preview_disambiguation_description) + "</p>" + extractStr; } extract = Html.fromHtml(extractStr); title.setThumbUrl(pageSummary.getThumbnailUrl()); }
Source:
<code>public List<TrainingDocument> listTrainingDocuments(Project aProject) { <START> <END> return entityManager.createQuery("FROM TrainingDocument where project =:project", TrainingDocument.class).setParameter("project", aProject).getResultList(); }</code><technical_language>I keeping variables allow inspecting in debugger is returned. In if returned collection is in extend for-loop, is difficult contents of collection this variable</technical_language>

Target:
public List<TrainingDocument> listTrainingDocuments(Project aProject) { List<TrainingDocument> trainingDocuments = entityManager .createQuery("FROM TrainingDocument where project =:project", TrainingDocument.class) .setParameter("project", aProject).getResultList(); return trainingDocuments; }
Source:
<code>public ParallelIndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") ParallelIndexIOConfig ioConfig, @JsonProperty("tuningConfig") ParallelIndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("parser", dataSchema.getParserMap()), new Property<>("inputFormat", ioConfig.getInputFormat()) ) ); if (dataSchema.getParserMap() != null && ioConfig.getInputSource() != null) { if (!(ioConfig.getInputSource() instanceof FirehoseFactoryToInputSourceAdaptor)) { <START> throw new IAE("Cannot use parser and inputSource together. Try use inputFormat instead of parser."); <END> } } this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? ParallelIndexTuningConfig.defaultConfig() : tuningConfig; }</code><technical_language>Typo: Try inputFormat -> Try inputFormat</technical_language>

Target:
public ParallelIndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") ParallelIndexIOConfig ioConfig, @JsonProperty("tuningConfig") ParallelIndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("parser", dataSchema.getParserMap()), new Property<>("inputFormat", ioConfig.getInputFormat()) ) ); if (dataSchema.getParserMap() != null && ioConfig.getInputSource() != null) { if (!(ioConfig.getInputSource() instanceof FirehoseFactoryToInputSourceAdaptor)) { throw new IAE("Cannot use parser and inputSource together. Try using inputFormat instead of parser."); } } this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? ParallelIndexTuningConfig.defaultConfig() : tuningConfig; }
Source:
<code>public void setShowLocation(boolean showLocation) { <START> this.showLocation = showLocation; <END> }</code><technical_language>APIs great method effect called controls constructed. in other places fail this is called control creation dynamically update UI</technical_language>

Target:
public void setShowLocation(boolean showLocation) { if (locationLabel != null) { throw new IllegalStateException("Control already created"); } this.showLocation = showLocation; }
Source:
<code>private void fillToolsList() { updateAllTools(); ToolChain tc = null; if (ri instanceof IFolderInfo) tc = (ToolChain)ManagedBuildManager.getRealToolChain(((IFolderInfo)ri).getToolChain()); if (page.isForFile()) { ITool curr = getToolForFile(); boolean canAddNO_TOOL = true; if (ri instanceof IFileInfo && b_dispCompatible.getSelection()) canAddNO_TOOL = updateCompatibleTools(curr); fillToolCombo(canAddNO_TOOL, curr); showToolStatus(curr); } else if (tc != null && tc.isPreferenceToolChain()){ tools_group.setVisible(false); } else { tools_group.setVisible(true); StringBuilder s = <START> new StringBuilder(EMPTY_STR); <END> ITool[] tools = ri.getTools(); for (ITool tool : tools) { s.append(tool.getUniqueRealName()).append("\n"); } text.setText(s.toString()); } }</code><technical_language>new StringBuilder(EMPTY_STR) is equivalent new StringBuilder()</technical_language>

Target:
private void fillToolsList() { updateAllTools(); ToolChain tc = null; if (ri instanceof IFolderInfo) tc = (ToolChain)ManagedBuildManager.getRealToolChain(((IFolderInfo)ri).getToolChain()); if (page.isForFile()) { ITool curr = getToolForFile(); boolean canAddNO_TOOL = true; if (ri instanceof IFileInfo && b_dispCompatible.getSelection()) canAddNO_TOOL = updateCompatibleTools(curr); fillToolCombo(canAddNO_TOOL, curr); showToolStatus(curr); } else if (tc != null && tc.isPreferenceToolChain()){ tools_group.setVisible(false); } else { tools_group.setVisible(true); StringBuilder s = new StringBuilder(); ITool[] tools = ri.getTools(); for (ITool tool : tools) { s.append(tool.getUniqueRealName()).append('\n'); } text.setText(s.toString()); } }
Source:
<code>public void write(ByteBuffer buffer) { buffer.putLong(offset); <START> buffer.rewind(); <END> }</code><technical_language>rewind</technical_language>

Target:
public void write(ByteBuffer buffer) { buffer.putLong(offset); }
Source:
<code>private int randomPick() { <START> return new Random().nextInt(Question.values().length); <END> }</code><technical_language>NovodaActivity.RANDOM save memz</technical_language>

Target:
private int randomPick() { return NovodaActivity.RANDOM.nextInt(Question.values().length); }
Source:
<code>public Key (String serializedKey) { String[] columns = serializedKey.split(","); tenantId = columns[0].compareTo("") == 0 ? null : columns[0]; schemaName = columns[1].compareTo("") == 0 ? null : columns[1]; tableName = columns[2]; <START> } <END></code><technical_language>This work namespace-mapping is enabled. existing Phoenix APIs parse fullTableName '.' ':' based of isNamespaceMapped property. Check out SchemaUtil.java</technical_language>

Target:
public Key (String serializedKey) { serializedValue = serializedKey; if (this.getTableName() == null || this.getTableName().compareTo("") == 0) { throw new IllegalArgumentException(); } }
Source:
<code>public boolean inputSchemasAvailable(Map<String, Schema> inputSchemas) { <START> return !inputSchemas.isEmpty() && !inputSchemas.values().stream().anyMatch(v -> v == null); <END> }</code><technical_language>better: return !inputSchemas.isEmpty() && inputSchemas.values().stream().noneMatch(Objects::isNull);</technical_language>

Target:
boolean inputSchemasAvailable(Map<String, Schema> inputSchemas) { return !inputSchemas.isEmpty() && inputSchemas.values().stream().noneMatch(Objects::isNull); }
Source:
<code>boolean canHandle(SegmentId segmentId, long segmentSize) { <START> if (available() < segmentSize) { <END> log.warn( "Segment[%s:%,d] too large for storage[%s:%,d]. Check your druid.segmentCache.locations maxSize param", segmentId, segmentSize, getPath(), available() ); return false; } if (freeSpaceToKeep > 0) { long currFreeSpace = path.getFreeSpace(); if ((freeSpaceToKeep + segmentSize) > currFreeSpace) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d] to maintain suggested freeSpace[%d], current freeSpace is [%d].", segmentId, segmentSize, getPath(), available(), freeSpaceToKeep, currFreeSpace ); return false; } } return true; }</code><technical_language>I suggest call this method "availableSizeBytes"</technical_language>

Target:
boolean canHandle(SegmentId segmentId, long segmentSize) { if (availableSizeBytes() < segmentSize) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d]. Check your druid.segmentCache.locations maxSize param", segmentId, segmentSize, getPath(), availableSizeBytes() ); return false; } if (freeSpaceToKeep > 0) { long currFreeSpace = path.getFreeSpace(); if ((freeSpaceToKeep + segmentSize) > currFreeSpace) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d] to maintain suggested freeSpace[%d], current freeSpace is [%d].", segmentId, segmentSize, getPath(), availableSizeBytes(), freeSpaceToKeep, currFreeSpace ); return false; } } return true; }
Source:
<code><START> static void execute(Runnable runnable) { <END> if (EXECUTOR == null) { synchronized (ShutdownFallbackExecutor.class) { if (EXECUTOR == null) { EXECUTOR = new ThreadPoolExecutor(0, 1, 100, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); } } } EXECUTOR.execute(runnable); }</code><technical_language>I this idea is safer, this executor needs shut run out of tasks. Setting core pool size zero accomplish this, JDK executor work expect (it grow core threads queue is full, in this case I this executor function, I if special case coding for a core pool size of zero however)</technical_language>

Target:
static void execute(Runnable runnable) { if (EXECUTOR == null) { synchronized (ShutdownFallbackExecutor.class) { if (EXECUTOR == null) { EXECUTOR = new ThreadPoolExecutor(0, 1, 10, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new ShutdownFallbackThreadFactory()); } } } EXECUTOR.execute(runnable); }
Source:
<code>private void appendEmbedded(StringBuilder queryBuilder, String optionalMatch, EmbeddedAliasTree node) { if ( node.getChildren().isEmpty() ) { queryBuilder.append( optionalMatch ); } else { <START> int index = 0; <END> List<EmbeddedAliasTree> children = node.getChildren(); for ( EmbeddedAliasTree child : node.getChildren() ) { StringBuilder builder = new StringBuilder( optionalMatch ); relationship( builder, child.getName() ); node( builder, child.getAlias(), NodeLabel.EMBEDDED.name() ); appendEmbedded( queryBuilder, builder.toString(), child ); } } }</code><technical_language>This variable next unused</technical_language>

Target:
private void appendEmbedded(StringBuilder queryBuilder, String optionalMatch, EmbeddedAliasTree node) { if ( node.getChildren().isEmpty() ) { queryBuilder.append( optionalMatch ); } else { for ( EmbeddedAliasTree child : node.getChildren() ) { StringBuilder builder = new StringBuilder( optionalMatch ); relationship( builder, child.getName() ); node( builder, child.getAlias(), NodeLabel.EMBEDDED.name() ); appendEmbedded( queryBuilder, builder.toString(), child ); } } }
Source:
<code>public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); <START> retSet.add(Range.singleton(StringUtils.nullToEmptyNonDruidDataString(value))); <END> return retSet; }</code><technical_language>question. Also, is defined @Nullable, null already. Checks done e. g. in getCacheKey()</technical_language>

Target:
public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); if (valueEquivalent == null) { retSet.add(Range.lessThan("")); } else { retSet.add(Range.singleton(valueEquivalent)); } return retSet; }
Source:
<code>public String asCql() { StringBuilder builder = new StringBuilder(); builder.append("CREATE KEYSPACE "); if (ifNotExists) { builder.append("IF NOT EXISTS "); } builder.append(keyspaceName.asCql(true)); boolean first = true; for (Map.Entry<String, Object> property : properties.entrySet()) { if (first) { builder.append(" WITH "); first = false; } else { builder.append(" AND "); } String value = extractPropertyValue(property.getValue()); <START> builder.append(property.getKey()).append(" = ").append(value); <END> } return builder.toString(); }</code><technical_language>sounds good, follow that</technical_language>

Target:
public String asCql() { StringBuilder builder = new StringBuilder(); builder.append("CREATE KEYSPACE "); if (ifNotExists) { builder.append("IF NOT EXISTS "); } builder.append(keyspaceName.asCql(true)); builder.append(OptionsUtils.buildOptions(options, true)); return builder.toString(); }
Source:
<code>public void should_return_http400_error_code_when_no_locale_param() throws Exception { <START> Response response = request("/system/i18ntranslationv2?f=test").get(); <END> assertThat(response).hasStatus(Status.CLIENT_ERROR_BAD_REQUEST); }</code><technical_language>-1: i18ntranslation /system/i18ntranslationv2 is mapped</technical_language>

Target:
public void should_return_http400_error_code_when_no_locale_param() throws Exception { Response response = request("/system/i18ntranslation?f=test").get(); assertThat(response).hasStatus(Status.CLIENT_ERROR_BAD_REQUEST); }
Source:
<code>protected final Event doAuthentication(final RequestContext context, final Credentials credentials, final MessageContext messageContext, final String id) throws Exception { final String primaryAuthnEventId = this.wrapperAuthenticationAction.submit(context, credentials, messageContext); final Event primaryAuthnEvent = new Event(this, primaryAuthnEventId); if (!"success".equals(primaryAuthnEventId)) { return primaryAuthnEvent; } final MultiFactorAuthenticationRequestContext mfaRequest = this.multiFactorAuthenticationRequestResolver.resolve(this.authenticationSupport.getAuthenticationFrom(WebUtils.getTicketGrantingTicketId(context)), WebApplicationService.class.cast(WebUtils.getService(context))); if (mfaRequest != null) { <START> putIntoRequestAttribute(mfaRequest, context); <END> return doMultiFactorAuthentication(context, credentials, messageContext, id); } return primaryAuthnEvent; }</code><technical_language>I dont this is necessary all. In fact, existing MFA extractor I removed entirely. putting this a request attribute, swf context directly</technical_language>

Target:
protected final Event doAuthentication(final RequestContext context, final Credentials credentials, final MessageContext messageContext, final String id) throws Exception { final String primaryAuthnEventId = this.wrapperAuthenticationAction.submit(context, credentials, messageContext); final Event primaryAuthnEvent = new Event(this, primaryAuthnEventId); if (!success().getId().equals(primaryAuthnEvent.getId())) { return primaryAuthnEvent; } final MultiFactorAuthenticationRequestContext mfaRequest = this.multiFactorAuthenticationRequestResolver.resolve( this.authenticationSupport.getAuthenticationFrom(WebUtils.getTicketGrantingTicketId(context)), WebApplicationService.class.cast(WebUtils.getService(context))); if (mfaRequest != null) { this.authenticationMethodVerifier.verifyAuthenticationMethod(mfaRequest.getAuthenticationMethod(), mfaRequest.getTargetService(), HttpServletRequest.class.cast(context.getExternalContext().getNativeRequest())); logger.info("There is an existing mfa request for service with a requested authentication method of [{}]", mfaRequest.getTargetService().getId(), mfaRequest.getAuthenticationMethodSource()); final MultiFactorAuthenticationSupportingWebApplicationService svc = this.mfaWebApplicationServiceFactory.create(mfaRequest.getTargetService().getId(), mfaRequest.getTargetService().getId(), mfaRequest.getTargetService().getArtifactId(), mfaRequest.getAuthenticationMethod(), mfaRequest.getAuthenticationMethodSource()); MultiFactorRequestContextUtils.setMultifactorWebApplicationService(context, svc); return doMultiFactorAuthentication(context, credentials, messageContext, id); } return primaryAuthnEvent; }
Source:
<code>public void testValidate() throws UnsupportedEncodingException, IOException { VALIDATOR.validate("VALID_NAME"); VALIDATOR.validate("VALID-NAME"); VALIDATOR.validate("VALID255NAME"); VALIDATOR.validate("255VALID-NAME"); VALIDATOR.validate("VALID.NAME"); <START> VALIDATOR.validate(new String(buildData(255).read(), UTF_8)); <END> }</code><technical_language>Consider buildData(255).asCharSource(UTF_8).read() instead</technical_language>

Target:
public void testValidate() { VALIDATOR.validate("VALID_NAME"); VALIDATOR.validate("VALID-NAME"); VALIDATOR.validate("VALID255NAME"); VALIDATOR.validate("255VALID-NAME"); VALIDATOR.validate("VALID.NAME"); }
Source:
<code>public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mHandler = ViewModelProviders.of(this).get(CheckEmailHandler.class); mHandler.init(getFlowParams()); FragmentActivity activity = getActivity(); if (!(activity instanceof CheckEmailListener)) { throw new IllegalStateException("Activity must implement CheckEmailListener"); } mListener = (CheckEmailListener) activity; mHandler.getOperation().observe(this, new ResourceObserver<User>( this, R.string.fui_progress_dialog_checking_accounts) { @Override protected void onSuccess(@NonNull User user) { String email = user.getEmail(); String provider = user.getProviderId(); mEmailEditText.setText(email); if (provider == null) { mListener.onNewUser(new User.Builder(EmailAuthProvider.PROVIDER_ID, email) .setName(user.getName()) .setPhotoUri(user.getPhotoUri()) .build()); } else if (provider.equals(EmailAuthProvider.PROVIDER_ID) || provider.equals <START> (EMAIL_LINK_PROVIDER)) { <END> mListener.onExistingEmailUser(user); } else { mListener.onExistingIdpUser(user); } } @Override protected void onFailure(@NonNull Exception e) { } }); if (savedInstanceState != null) { return; } String email = getArguments().getString(ExtraConstants.EMAIL); if (!TextUtils.isEmpty(email)) { mEmailEditText.setText(email); validateAndProceed(); } else if (getFlowParams().enableHints) { mHandler.fetchCredential(); } }</code><technical_language>another format nit, breaking equals ( is confusing</technical_language>

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mHandler = ViewModelProviders.of(this).get(CheckEmailHandler.class); mHandler.init(getFlowParams()); FragmentActivity activity = getActivity(); if (!(activity instanceof CheckEmailListener)) { throw new IllegalStateException("Activity must implement CheckEmailListener"); } mListener = (CheckEmailListener) activity; mHandler.getOperation().observe(this, new ResourceObserver<User>( this, R.string.fui_progress_dialog_checking_accounts) { @Override protected void onSuccess(@NonNull User user) { String email = user.getEmail(); String provider = user.getProviderId(); mEmailEditText.setText(email); if (provider == null) { mListener.onNewUser(new User.Builder(EmailAuthProvider.PROVIDER_ID, email) .setName(user.getName()) .setPhotoUri(user.getPhotoUri()) .build()); } else if (provider.equals(EmailAuthProvider.PROVIDER_ID) || provider.equals(EMAIL_LINK_PROVIDER)) { mListener.onExistingEmailUser(user); } else { mListener.onExistingIdpUser(user); } } @Override protected void onFailure(@NonNull Exception e) { if (e instanceof FirebaseUiException && ((FirebaseUiException) e).getErrorCode() == ErrorCodes.DEVELOPER_ERROR) { mListener.onDeveloperFailure(e); } } }); if (savedInstanceState != null) { return; } String email = getArguments().getString(ExtraConstants.EMAIL); if (!TextUtils.isEmpty(email)) { mEmailEditText.setText(email); validateAndProceed(); } else if (getFlowParams().enableHints) { mHandler.fetchCredential(); } }
Source:
<code>public void initSystem() { try { <START> logger.info("Sending " + LIGHTING_DIAGNOSTIC_FRAME + " frame to (re)initialize LIGHTING"); <END> myPlant.sendCommandSync(LIGHTING_DIAGNOSTIC_FRAME); logger.info("Sending " + AUTOMATIONS_DIAGNOSTIC_FRAME + " frame to (re)initialize AUTOMATIONS"); myPlant.sendCommandSync(AUTOMATIONS_DIAGNOSTIC_FRAME); logger.info("Sending " + ALARM_DIAGNOSTIC_FRAME + " frame to (re)initialize ALARM"); myPlant.sendCommandSync(ALARM_DIAGNOSTIC_FRAME); logger.info("Sending " + POWER_MANAGEMENT_DIAGNOSTIC_FRAME + " frame to (re)initialize POWER MANAGEMENT"); myPlant.sendCommandSync(POWER_MANAGEMENT_DIAGNOSTIC_FRAME); logger.info("Sending *4#* frames to (re)initialize HEATING"); myPlant.sendCommandSync("*#4*#1*20##"); myPlant.sendCommandSync("*#4*#0##"); for (int i = 1; i <= m_heating_zones; i++) { myPlant.sendCommandSync("*#4*#" + i + "##"); myPlant.sendCommandSync("*#4*" + i + "##"); } } catch (Exception e) { logger.error("initSystem failed : " + e.getMessage()); } }</code><technical_language>of log statements (from line 138 163) DEBUG instead of INFO. Also, please reconfigure parameterized logging instead of string concatenation</technical_language>

Target:
public void initSystem() { try { logger.info("Sending frames to (re)initialize subsystems"); logger.debug("Sending frame to (re)initialize LIGHTING", LIGHTING_DIAGNOSTIC_FRAME); myPlant.sendCommandSync(LIGHTING_DIAGNOSTIC_FRAME); logger.debug("Sending frame to (re)initialize AUTOMATIONS", AUTOMATIONS_DIAGNOSTIC_FRAME); myPlant.sendCommandSync(AUTOMATIONS_DIAGNOSTIC_FRAME); logger.debug("Sending frame to (re)initialize ALARM", ALARM_DIAGNOSTIC_FRAME); myPlant.sendCommandSync(ALARM_DIAGNOSTIC_FRAME); logger.debug("Sending frame to (re)initialize POWER MANAGEMENT", POWER_MANAGEMENT_DIAGNOSTIC_FRAME); myPlant.sendCommandSync(POWER_MANAGEMENT_DIAGNOSTIC_FRAME); logger.debug("Sending Diagnostic Frame Actors to (re)initialize HEATING"); myPlant.sendCommandSync("*#4*#1*20##"); logger.debug("Sending Diagnostic Frame Main Unit to (re)initialize HEATING"); myPlant.sendCommandSync("*#4*#0##"); Calendar rightNow = Calendar.getInstance(); if (m_heating_zones > 0 && rightNow.get(Calendar.MINUTE) == 59) { logger.debug("Sending Diagnostic Frame Heat Zones 1 .. to (re)initialize HEATING", m_heating_zones); for (int i = 1; i <= m_heating_zones; i++) { logger.debug("Sending Diagnostic Frame Heat Zone to (re)initialize HEATING", i); myPlant.sendCommandSync("*#4*#" + i + "##"); myPlant.sendCommandSync("*#4*" + i + "##"); } logger.debug("Sending Diagnostic Frames to (re)initialize HEATING finished"); } } catch (Exception e) { logger.warn("initSystem failed : {}", e.getMessage()); } }
Source:
<code>private void handleSynchronization(Event event) { final Shell shell = event.display.getActiveShell(); SynchronizationBehavior syncBehavior = filterManager.getCurrentSynchronizationBehavior(); <START> if (syncBehavior != SynchronizationBehavior.NEVER) { <END> shell.getDisplay().asyncExec(new SynchronizationBehaviorRunnable(shell)); } }</code><technical_language>shell null, add "&& shell != null" if condition</technical_language>

Target:
private void handleSynchronization(Event event) { String sync = preferences.get(FiltersPreferencePage.SYNCHRONIZATION_BEHAVIOR, MessageDialogWithToggle.PROMPT); final Shell shell = event.display.getActiveShell(); if (MessageDialogWithToggle.PROMPT.equals(sync) && shell != null) { shell.getDisplay().asyncExec(new SynchronizationBehaviorRunnable(shell)); } else if (MessageDialogWithToggle.ALWAYS.equals(sync)) { setSelectedGroupAsDefault(isChecked()); } }
Source:
<code>public CustomUIPane(HaskellCatalog catalog) { this.connectionCreationManager = new ConnectionCreationManager(this); this.selectedBlock = new SimpleObjectProperty<>(Optional.empty()); this.dragStart = Point2D.ZERO; this.offset = Point2D.ZERO; this.catalog = catalog; this.envInstance = catalog.asEnvironment(); try { this.ghci = Optional.of(new GhciSession()); } catch (HaskellException e) { this.ghci = Optional.empty(); } this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handlePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::handleDrag); this.addEventHandler(MouseEvent.MOUSE_RELEASED, this::handleRelease); this.addEventHandler(ScrollEvent.SCROLL, this::handleScroll); this.addEventHandler(KeyEvent.KEY_PRESSED, this::handleKey); Platform.runLater(() -> inspector = new InspectorWindow(this)); <START> Platform.runLater(() -> preferences = new PreferencesWindow(this)); <END> }</code><technical_language>runLater if window creation done in ShowPreferences() instead</technical_language>

Target:
public CustomUIPane(HaskellCatalog catalog) { this.connectionCreationManager = new ConnectionCreationManager(this); this.selectedBlock = new SimpleObjectProperty<>(Optional.empty()); this.dragStart = Point2D.ZERO; this.offset = Point2D.ZERO; this.catalog = catalog; this.envInstance = catalog.asEnvironment(); try { this.ghci = Optional.of(new GhciSession()); } catch (HaskellException e) { this.ghci = Optional.empty(); } this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handlePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::handleDrag); this.addEventHandler(MouseEvent.MOUSE_RELEASED, this::handleRelease); this.addEventHandler(ScrollEvent.SCROLL, this::handleScroll); this.addEventHandler(KeyEvent.KEY_PRESSED, this::handleKey); }
Source:
<code>public void process(final K key, final V value) { <START> KeyValueTimestamp<Object, Object> keyValueTimestamp = new KeyValueTimestamp<>(key == null ? "null" : key, <END> value == null ? "null" : value, context().timestamp()); if (value != null) { lastValueAndTimestampPerKey.put(key, ValueAndTimestamp.make(value, context().timestamp())); } else { lastValueAndTimestampPerKey.remove(key); } processed.add(keyValueTimestamp); if (commitRequested) { context().commit(); commitRequested = false; } }</code><technical_language>replace null "null" ? (similar for value)</technical_language>

Target:
public void process(final K key, final V value) { KeyValueTimestamp<Object, Object> keyValueTimestamp = new KeyValueTimestamp<>(key, value, context().timestamp()); if (value != null) { lastValueAndTimestampPerKey.put(key, ValueAndTimestamp.make(value, context().timestamp())); } else { lastValueAndTimestampPerKey.remove(key); } processed.add(keyValueTimestamp); if (commitRequested) { context().commit(); commitRequested = false; } }
Source:
<code>protected LockProperties applyLockProperties(LockProperties lockProperties) { int timeout = Config.<Integer> getValue(ConfigValues.SetupNetworksWaitTimeout); return <START> lockProperties.withScope(Scope.Execution).withWaitTimeout(timeout * 1000); <END> }</code><technical_language>please replace TimeUnit.SECONDS.toNanos(timeout)</technical_language>

Target:
protected LockProperties applyLockProperties(LockProperties lockProperties) { int timeout = Config.<Integer> getValue(ConfigValues.SetupNetworksWaitTimeoutSeconds); return lockProperties.withScope(Scope.Execution).withWaitTimeout(TimeUnit.SECONDS.toMillis(timeout)); }