auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void process(final SonarLintJob job, ProgressIndicator indicator, final Collection<Issue> rawIssues, Collection<ClientInputFile> failedAnalysisFiles) { long start = System.currentTimeMillis(); Map<VirtualFile, Collection<LiveIssue>> transformedIssues = ReadAction.compute(() -> { Map<VirtualFile, Collection<LiveIssue>> issues = transformIssues(rawIssues, job.allFiles(), failedAnalysisFiles); manager.store(issues); return issues; }); Set<VirtualFile> failedVirtualFiles = asVirtualFiles(failedAnalysisFiles); if (failedVirtualFiles.containsAll(job.allFiles())) { <START> console.debug(""); <END> } else { logFoundIssuesIfAny(rawIssues, start, transformedIssues); } if (shouldUpdateServerIssues(job.trigger())) { Map<Module, Collection<VirtualFile>> filesWithIssuesPerModule = new LinkedHashMap<>(); for (Map.Entry<Module, Collection<VirtualFile>> e : job.filesPerModule().entrySet()) { Collection<VirtualFile> moduleFilesWithIssues = e.getValue().stream() .filter(f -> !transformedIssues.getOrDefault(f, Collections.emptyList()).isEmpty()) .collect(Collectors.toList()); if (!moduleFilesWithIssues.isEmpty()) { filesWithIssuesPerModule.put(e.getKey(), moduleFilesWithIssues); } } if (!filesWithIssuesPerModule.isEmpty()) { serverIssueUpdater.fetchAndMatchServerIssues(filesWithIssuesPerModule, indicator, job.waitForServerIssues()); } } AnalysisCallback callback = job.callback(); if (callback != null) { callback.onSuccess(failedVirtualFiles); } }</code><technical_language>Is needed log empty string</technical_language>

Target:
public void process(final SonarLintJob job, ProgressIndicator indicator, final Collection<Issue> rawIssues, Collection<ClientInputFile> failedAnalysisFiles) { long start = System.currentTimeMillis(); Map<VirtualFile, Collection<LiveIssue>> transformedIssues = ReadAction.compute(() -> { Map<VirtualFile, Collection<LiveIssue>> issues = transformIssues(rawIssues, job.allFiles(), failedAnalysisFiles); manager.store(issues); return issues; }); Set<VirtualFile> failedVirtualFiles = asVirtualFiles(failedAnalysisFiles); if (! failedVirtualFiles.containsAll(job.allFiles())) { logFoundIssuesIfAny(rawIssues, start, transformedIssues); } if (shouldUpdateServerIssues(job.trigger())) { Map<Module, Collection<VirtualFile>> filesWithIssuesPerModule = new LinkedHashMap<>(); for (Map.Entry<Module, Collection<VirtualFile>> e : job.filesPerModule().entrySet()) { Collection<VirtualFile> moduleFilesWithIssues = e.getValue().stream() .filter(f -> !transformedIssues.getOrDefault(f, Collections.emptyList()).isEmpty()) .collect(Collectors.toList()); if (!moduleFilesWithIssues.isEmpty()) { filesWithIssuesPerModule.put(e.getKey(), moduleFilesWithIssues); } } if (!filesWithIssuesPerModule.isEmpty()) { serverIssueUpdater.fetchAndMatchServerIssues(filesWithIssuesPerModule, indicator, job.waitForServerIssues()); } } AnalysisCallback callback = job.callback(); if (callback != null) { callback.onSuccess(failedVirtualFiles); } }
Source:
<code>AggregateMetricSenderSessionWrapper( AggregateMetricSender.Session metricSenderSession, Set<SignalFxReporter.MetricDetails> detailsToAdd, MetricMetadata metricMetadata, String defaultSourceName, String sourceDimension) { this(metricSenderSession, detailsToAdd, metricMetadata, defaultSourceName, sourceDimension, <START> false, ImmutableMap.<String, String> of()); <END> }</code><technical_language>Collections.emptyMap() (Not suggesting, curious if is a practice?)</technical_language>

Target:
AggregateMetricSenderSessionWrapper( AggregateMetricSender.Session metricSenderSession, Set<SignalFxReporter.MetricDetails> detailsToAdd, MetricMetadata metricMetadata, String defaultSourceName, String sourceDimension) { this(metricSenderSession, detailsToAdd, metricMetadata, defaultSourceName, sourceDimension, false, Collections.<String, DimensionInclusion> emptyMap()); }
Source:
<code>private void checkProgramRecords() { final SamReader in = SamReaderFactory .makeDefault() .referenceSequence(REFERENCE_SEQUENCE) .open(INPUT); for (final SAMProgramRecord pg : in.getFileHeader().getProgramRecords()) { if (pg.getProgramName() != null && pg.getProgramName().equals(PG_PROGRAM_NAME)) { String outText = "Found previous Program Record that indicates that this BAM has been downsampled already with this program. Operation not supported! Previous PG: " + pg.toString(); if (ALLOW_MULTIPLE_DOWNSAMPLING_DESPITE_WARNINGS) { <START> log.warn(outText); <END> } else { log.error(outText); throw new PicardException(outText); } } } CloserUtil.close(in); }</code><technical_language>warning downsampling is impossible, this downsample if ALLOW...DESPITE_WARNINGS=true is specified</technical_language>

Target:
private void checkProgramRecords() { final SamReader in = SamReaderFactory .makeDefault() .referenceSequence(REFERENCE_SEQUENCE) .open(INPUT); for (final SAMProgramRecord pg : in.getFileHeader().getProgramRecords()) { if (pg.getProgramName() != null && pg.getProgramName().equals(PG_PROGRAM_NAME)) { final String outText = "Found previous Program Record that indicates that this BAM has been downsampled already with this program. Operation not supported! Previous PG: " + pg.toString(); if (ALLOW_MULTIPLE_DOWNSAMPLING_DESPITE_WARNINGS) { log.warn(outText); } else { log.error(outText); throw new PicardException(outText); } } } CloserUtil.close(in); }
Source:
<code>public void testDeleteRelationInCatalog() throws Exception { ingestTestDataset(); Set<Integer> workers = server.getWorkersForRelation(relationKey, null); assertTrue(workers.size() == workerIDs.length); JsonAPIUtils.deleteDataset("localhost", masterDaemonPort, relationKey.getUserName(), relationKey.getProgramName(), relationKey.getRelationName()); <START> workers = server.getWorkersForRelation(relationKey, null); <END> assertTrue(workers == null); }</code><technical_language>this test if relation deleted catalog entirely, partitions exist</technical_language>

Target:
public void testDeleteRelationInCatalog() throws Exception { ingestTestDataset(); JsonAPIUtils.deleteDataset("localhost", masterDaemonPort, relationKey.getUserName(), relationKey.getProgramName(), relationKey.getRelationName()); assertTrue(server.getDatasetStatus(relationKey) == null); }
Source:
<code>private void expire(String correlationId) { final SettableListenableFuture<Message<?>> future = JmsOutboundGateway.this.futures <START> .remove(correlationId); <END> if (future != null) { try { if (getRequiresReply()) { future.setException(new JmsTimeoutException("No reply in " + this.receiveTimeout + " ms")); } else { if (logger.isDebugEnabled()) { logger.debug("Reply expired and reply not required for " + correlationId); } } } catch (Exception e) { logger.error("Exception while expiring future"); } } }</code><technical_language>JmsOutboundGateway. is redundant remove line. hurt, of course. fix merge</technical_language>

Target:
private void expire(String correlationId) { final SettableListenableFuture<AbstractIntegrationMessageBuilder<?>> future = this.futures.remove(correlationId); if (future != null) { try { if (getRequiresReply()) { future.setException(new JmsTimeoutException("No reply in " + this.receiveTimeout + " ms")); } else { if (logger.isDebugEnabled()) { logger.debug("Reply expired and reply not required for " + correlationId); } } } catch (Exception e) { logger.error("Exception while expiring future"); } } }
Source:
<code>public void close() throws IOException { if (closed) { return; } closed = true; if (!bufferedPages.isEmpty()) { dataSink.write(bufferedPages); <START> addStripeOffset(bufferedBytes); <END> } dataSink.write(ImmutableList.of(new PageFileFooterOutput(stripeOffsets))); dataSink.close(); }</code><technical_language>this effectively add offset for existing stripe</technical_language>

Target:
public void close() throws IOException { if (closed) { return; } closed = true; if (!bufferedPages.isEmpty()) { flushStripe(); } dataSink.write(ImmutableList.of(new PageFileFooterOutput(stripeOffsets))); dataSink.close(); }
Source:
<code>private RowMapper<?> rowMapperFor(Type type) throws SQLException { <START> if (rowMappers.containsKey(type)) { <END> return rowMappers.get(type); } RowMapper<?> mapper = ctx.findRowMapperFor(type) .orElseThrow(() -> new UnableToExecuteStatementException("No row mapper for " + type, ctx)) .memoize(rs, ctx); rowMappers.put(type, mapper); return mapper; }</code><technical_language>reason computeIfAbsent here</technical_language>

Target:
private RowMapper<?> rowMapperFor(Type type) throws SQLException { if (rowMappers.containsKey(type)) { return rowMappers.get(type); } RowMapper<?> mapper = ctx.findRowMapperFor(type) .orElseThrow(() -> new UnableToExecuteStatementException("No row mapper for " + type, ctx)) .specialize(rs, ctx); rowMappers.put(type, mapper); return mapper; }
Source:
<code>public void testStore() throws Exception { Checkpoint mockCheckpoint = mock(Checkpoint.class); PowerMockito.mockStatic(CheckpointManager.SaveInstanceStateRequest.class); CheckpointManager.SaveInstanceStateRequest mockSaveInstanceStateRequest = mock(CheckpointManager.SaveInstanceStateRequest.class); when(mockCheckpoint.checkpoint()).thenReturn(mockSaveInstanceStateRequest); <START> FSDataOutputStream mockFSDateOutpurStream = mock(FSDataOutputStream.class); <END> when(mockFileSystem.create(any(Path.class))).thenReturn(mockFSDateOutpurStream); doReturn(true).when(hdfsStorage).createDirs(anyString()); hdfsStorage.store(mockCheckpoint); verify(mockSaveInstanceStateRequest).writeTo(mockFSDateOutpurStream); }</code><technical_language>s/mockFSDateOutpurStream/mockFSDateOutputStream</technical_language>

Target:
public void testStore() throws Exception { PowerMockito.mockStatic(CheckpointManager.InstanceStateCheckpoint.class); CheckpointManager.InstanceStateCheckpoint mockCheckpointState = mock(CheckpointManager.InstanceStateCheckpoint.class); Checkpoint checkpoint = new Checkpoint(StatefulStorageTestContext.TOPOLOGY_NAME, instance, mockCheckpointState); FSDataOutputStream mockFSDateOutputStream = mock(FSDataOutputStream.class); when(mockFileSystem.create(any(Path.class))).thenReturn(mockFSDateOutputStream); doNothing().when(hdfsStorage).createDir(anyString()); hdfsStorage.store(checkpoint); verify(mockCheckpointState).writeTo(mockFSDateOutputStream); }
Source:
<code>private synchronized void startPolling(final long pollIntervalMinutes) { validPollIntervalMinutes(pollIntervalMinutes); if (scheduledPollingFuture != null) { scheduledPollingFuture.cancel(true); LOGGER.debug( "Stopped the scheduled process to poll all of the current sources at a fixed rate"); } try { scheduledPollingFuture = scheduledExecutorService.scheduleAtFixedRate( () -> poll(pollIntervalMinutes), 0, pollIntervalMinutes, TimeUnit.MINUTES); } catch (final RejectedExecutionException e) { final String message = "Unable to schedule polling at at a fixed rate of " + pollIntervalMinutes + " minute(s)"; <START> LOGGER.warn("{}. Try restarting.", message); <END> throw new IllegalStateException(message, e); } LOGGER.debug( "Successfully scheduled a process to poll all of the current sources at a fixed rate of minute(s), where polls will time out at minute(s)", pollIntervalMinutes, pollIntervalMinutes); }</code><technical_language>suggestion LOGGER.warn("{}. Try restarting system.", message, e);</technical_language>

Target:
private void startPolling(final long pollIntervalMinutes) { if (!startPollingLock.tryLock()) { final String message = "Unable to start the schedule. Multiple threads may not start the schedule at the same time."; LOGGER.warn("{} The Poller will not be periodically updated. Try restarting the system."); throw new IllegalStateException(message); } try { doStartPolling(pollIntervalMinutes); } finally { startPollingLock.unlock(); } }
Source:
<code>public static String appendPrefixHomeCommunityID(final String homeCommunityId) { <START> return checkPrefixBeforeAppend(homeCommunityId, "urn:oid:"); <END> }</code><technical_language>this variable defines NhincConstants.HCID_PREFIX</technical_language>

Target:
public static String appendPrefixHomeCommunityID(final String homeCommunityId) { return checkPrefixBeforeAppend(homeCommunityId, NhincConstants.HCID_PREFIX); }
Source:
<code>public boolean applies(Permanent permanent, Ability source, Game game) { boolean apply = false; if (permanent.getId().equals(source.getSourceId())) { apply = true; } <START> return apply; <END> }</code><technical_language>about: return permanent.getId().equals(source.getSourceId()) ? : return Objects.equals(permanent.getId(), source.getSourceId());</technical_language>

Target:
public boolean applies(Permanent permanent, Ability source, Game game) { return Objects.equals(permanent.getId(), source.getSourceId()); }
Source:
<code>String basicToString(int tab) { StringBuilder sb = new StringBuilder("\n"); for (int i = tab; --i >= 0;) { sb.append("\t"); } sb.append("--- Block Scope ---"); sb.append("\t"); sb.append("locals:"); for (int i = 0; i < this.localIndex; i++) { sb.append("\t"); <START> sb.append(this.locals[i].toString()); <END> } sb.append("startIndex = "); sb.append(this.startIndex); return sb.toString(); }</code><technical_language>toString() is required</technical_language>

Target:
String basicToString(int tab) { StringBuilder sb = new StringBuilder("\n"); for (int i = tab; --i >= 0;) { sb.append("\t"); } sb.append("--- Block Scope ---"); sb.append("\t"); sb.append("locals:"); for (int i = 0; i < this.localIndex; i++) { sb.append("\t"); sb.append(this.locals[i]); } sb.append("startIndex = "); sb.append(this.startIndex); return sb.toString(); }
Source:
<code>public void testRegexpForPackagesDefault() { String[] inputConfig = new String[]{"*"}; List<String> config = convertAllToPkgRegExps(inputConfig); <START> logger.info(Arrays.asList(config).toString()); <END> assertTrue(isPackageNameIncluded(Object.class.getPackage().getName(), config)); assertTrue(isPackageNameIncluded(ReactiveObject.class.getPackage().getName(), config)); assertTrue(isPackageNameIncluded("xyz.my", config)); }</code><technical_language>need covert list list above.</technical_language>

Target:
public void testRegexpForPackagesDefault() { String[] inputConfig = new String[]{"*"}; List<String> config = convertAllToPkgRegExps(inputConfig); logger.info(config.toString()); assertTrue(isPackageNameIncluded(Object.class.getPackage().getName(), config)); assertTrue(isPackageNameIncluded(ReactiveObject.class.getPackage().getName(), config)); assertTrue(isPackageNameIncluded("xyz.my", config)); }
Source:
<code>public TimestampIncrementingTableQuerier(DatabaseDialect dialect, QueryMode mode, String name, String topicPrefix, List<String> timestampColumnNames, String incrementingColumnName, Map<String, Object> offsetMap, Long timestampDelay, <START> TimeZone timeZone, String suffix) { <END> super(dialect, mode, name, topicPrefix); this.incrementingColumnName = incrementingColumnName; this.timestampColumnNames = timestampColumnNames != null ? timestampColumnNames : Collections.<String>emptyList(); this.timestampDelay = timestampDelay; this.offset = TimestampIncrementingOffset.fromMap(offsetMap); this.timestampColumns = new ArrayList<>(); for (String timestampColumn : this.timestampColumnNames) { if (timestampColumn != null && !timestampColumn.isEmpty()) { timestampColumns.add(new ColumnId(tableId, timestampColumn)); } } switch (mode) { case TABLE: String tableName = tableId.tableName(); topic = topicPrefix + tableName; partition = OffsetProtocols.sourcePartitionForProtocolV1(tableId); break; case QUERY: partition = Collections.singletonMap(JdbcSourceConnectorConstants.QUERY_NAME_KEY, JdbcSourceConnectorConstants.QUERY_NAME_VALUE); topic = topicPrefix; break; default: throw new ConnectException("Unexpected query mode: " + mode); } this.timeZone = timeZone; this.suffix = suffix; }</code><technical_language>nit: suggestion TimeZone timeZone, String suffix) { I rest of formatting is screwed whatever</technical_language>

Target:
public TimestampIncrementingTableQuerier(DatabaseDialect dialect, QueryMode mode, String name, String topicPrefix, List<String> timestampColumnNames, String incrementingColumnName, Map<String, Object> offsetMap, Long timestampDelay, TimeZone timeZone, String suffix) { super(dialect, mode, name, topicPrefix, suffix); this.incrementingColumnName = incrementingColumnName; this.timestampColumnNames = timestampColumnNames != null ? timestampColumnNames : Collections.<String>emptyList(); this.timestampDelay = timestampDelay; this.offset = TimestampIncrementingOffset.fromMap(offsetMap); this.timestampColumns = new ArrayList<>(); for (String timestampColumn : this.timestampColumnNames) { if (timestampColumn != null && !timestampColumn.isEmpty()) { timestampColumns.add(new ColumnId(tableId, timestampColumn)); } } switch (mode) { case TABLE: String tableName = tableId.tableName(); topic = topicPrefix + tableName; partition = OffsetProtocols.sourcePartitionForProtocolV1(tableId); break; case QUERY: partition = Collections.singletonMap(JdbcSourceConnectorConstants.QUERY_NAME_KEY, JdbcSourceConnectorConstants.QUERY_NAME_VALUE); topic = topicPrefix; break; default: throw new ConnectException("Unexpected query mode: " + mode); } this.timeZone = timeZone; }
Source:
<code>private boolean handleLogin(HttpServletRequest httpRequest, HttpServletResponse httpResponse) { String baseURL = service.getBaseURL(httpRequest); for (String pluginName : service.getAuthChain(httpRequest)) { NuxeoAuthenticationPlugin plugin = service.getPlugin(pluginName); AuthenticationPluginDescriptor descriptor = service.getDescriptor(pluginName); if (Boolean.TRUE.equals(plugin.needLoginPrompt(httpRequest))) { if (descriptor.getNeedStartingURLSaving()) { saveRequestedURLBeforeRedirect(httpRequest, httpResponse); } HttpServletResponse response = new HttpServletResponseWrapper(httpResponse) { @Override public void sendRedirect(String location) throws IOException { HttpServletResponse response = (HttpServletResponse) getResponse(); StringBuilder sb = new StringBuilder(); sb.append("<script type=\"text/javascript\">\n"); sb.append("document.cookie = '" + NXAuthConstants.START_PAGE_FRAGMENT_KEY + "=' + window.location.hash.substring(1) + '; path=/';\n"); sb.append("window.location = '" + location + "';\n"); <START> sb.append("</script>"); <END> String script = sb.toString(); response.setStatus(SC_UNAUTHORIZED); response.setContentType("text/html;charset=UTF-8"); response.setContentLength(script.length()); response.getWriter().write(script); } }; return Boolean.TRUE.equals(plugin.handleLoginPrompt(httpRequest, response, baseURL)); } } log.warn("No auth plugin can be found to do the Login Prompt"); return false; }</code><technical_language>window.location.hash.substring(1) location escaped avoid XSS</technical_language>

Target:
private boolean handleLogin(HttpServletRequest httpRequest, HttpServletResponse httpResponse) { String baseURL = service.getBaseURL(httpRequest); for (String pluginName : service.getAuthChain(httpRequest)) { NuxeoAuthenticationPlugin plugin = service.getPlugin(pluginName); AuthenticationPluginDescriptor descriptor = service.getDescriptor(pluginName); if (Boolean.TRUE.equals(plugin.needLoginPrompt(httpRequest))) { if (descriptor.getNeedStartingURLSaving()) { saveRequestedURLBeforeRedirect(httpRequest, httpResponse); } HttpServletResponse response = new HttpServletResponseWrapper(httpResponse) { @Override public void sendRedirect(String location) throws IOException { HttpServletResponse response = (HttpServletResponse) getResponse(); StringBuilder sb = new StringBuilder(); sb.append("<script type=\"text/javascript\">\n"); sb.append("var h = window.location.hash.substring(1) || '';"); sb.append("document.cookie = '" + NXAuthConstants.START_PAGE_FRAGMENT_KEY + "=' + h.replace(/'/g, '\\\''); + '; path=/';\n"); sb.append("window.location = '" + location + "';\n"); sb.append("</script>"); String script = sb.toString(); response.setStatus(SC_UNAUTHORIZED); response.setContentType("text/html;charset=UTF-8"); response.setContentLength(script.length()); response.getWriter().write(script); } }; return Boolean.TRUE.equals(plugin.handleLoginPrompt(httpRequest, response, baseURL)); } } log.warn("No auth plugin can be found to do the Login Prompt"); return false; }
Source:
<code>public void init() { get( "/forms/query", (req, res) -> util.getMetacardsByFilter(QUERY_TEMPLATE_TAG) .values() .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .map(transformer::toFormTemplate) .filter(Objects::nonNull) .collect(Collectors.toList()), MAPPER::toJson); get( "/forms/result", (req, res) -> util.getMetacardsByFilter(ATTRIBUTE_GROUP_TAG) .values() .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .map(transformer::toFieldFilter) .filter(Objects::nonNull) .collect(Collectors.toList()), MAPPER::toJson); delete( "/forms/:id", APPLICATION_JSON, (req, res) -> { String id = req.params(":id"); <START> catalogFramework.delete(new DeleteRequestImpl(id)); <END> return ImmutableMap.of("message", "Successfully deleted."); }, util::getJson); }</code><technical_language>try/catch return a 500 delete fails</technical_language>

Target:
public void init() { get( "/forms/query", (req, res) -> util.getMetacardsByFilter(QUERY_TEMPLATE_TAG) .values() .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .map(transformer::toFormTemplate) .filter(Objects::nonNull) .collect(Collectors.toList()), MAPPER::toJson); get( "/forms/result", (req, res) -> util.getMetacardsByFilter(ATTRIBUTE_GROUP_TAG) .values() .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .map(transformer::toFieldFilter) .filter(Objects::nonNull) .collect(Collectors.toList()), MAPPER::toJson); delete( "/forms/:id", APPLICATION_JSON, (req, res) -> { String id = req.params(":id"); DeleteResponse deleteResponse = catalogFramework.delete(new DeleteRequestImpl(id)); if (!deleteResponse.getProcessingErrors().isEmpty()) { res.status(500); LOGGER.debug("Failed to Delete Form {}", id); return ImmutableMap.of("message", "Failed to delete."); } return ImmutableMap.of("message", "Successfully deleted."); }, util::getJson); }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((actionType == null) ? 0 : actionType.hashCode()); result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode()); result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + (isVisible ? 1231 : 1237); result = prime * result + ((jobSubjectEntities == null) ? 0 : jobSubjectEntities.hashCode()); result = prime * result + ((lastUpdateTime == null) ? 0 : lastUpdateTime.hashCode()); result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode()); result = prime * result + ((startTime == null) ? 0 : startTime.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((steps == null) ? 0 : steps.hashCode()); <START> result = prime * result + (external ? 1231 : 1237); <END> return result; }</code><technical_language>autoCleared a part of hashCode calculation</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((actionType == null) ? 0 : actionType.hashCode()); result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode()); result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + (isVisible ? 1231 : 1237); result = prime * result + ((jobSubjectEntities == null) ? 0 : jobSubjectEntities.hashCode()); result = prime * result + ((lastUpdateTime == null) ? 0 : lastUpdateTime.hashCode()); result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode()); result = prime * result + ((startTime == null) ? 0 : startTime.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((steps == null) ? 0 : steps.hashCode()); result = prime * result + (external ? 1231 : 1237); result = prime * result + (autoCleared ? 1231 : 1237); return result; }
Source:
<code><START> protected Intent buildIntentForUri(Uri uri) { <END> return new Intent(Intent.ACTION_VIEW, uri); }</code><technical_language>suggestion /* package */ Intent buildIntentForUri(Uri uri) {</technical_language>

Target:
Intent buildIntentForUri(Uri uri) { return new Intent(Intent.ACTION_VIEW, uri); }
Source:
<code><START> protected void updateVmDeviceAddress(final String address, final VmDevice vmDevice) { <END> vmDevice.setAddress(address); vmDeviceDao.update(vmDevice); }</code><technical_language>1. if this code is executed a transaction, issue this changes committed immediately, another caller address (unfurtonatly relevant for AttachDiskToVmCommand) lock is released, change command transactive (not in this patch). 2. Compensation problematic - try this scenario: a. i want plug disk A SPAPR_VSCSI interface, i fail - device remains selected address (because compensation used). 2. I change disk interface IDE attempt plug it. 3. address for SPAPR_VSCSI passed IDE interface fail</technical_language>

Target:
protected void updateVmDeviceAddress(final String address, final VmDevice vmDevice) { vmDevice.setAddress(address); getCompensationContext().snapshotEntity(vmDevice); vmDeviceDao.update(vmDevice); getCompensationContext().stateChanged(); }
Source:
<code>public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.optAttribute("height", height) .optAttribute("width", width) .rightAngleBracket(); <START> if (!xmlEnvironment.getNamespace().contentEquals(NAMESPACE)) { <END> xmlEnvironment = XmlEnvironment.builder() .withNamespace(MediaElement.NAMESPACE) .withNext(null) .build(); } xml.append(uris, xmlEnvironment); xml.closeElement(this); return xml; }</code><technical_language>NPEs, consider switching getNamespace() NAMESPACE</technical_language>

Target:
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.optAttribute("height", height) .optAttribute("width", width) .rightAngleBracket(); if (!NAMESPACE.contentEquals(xmlEnvironment.getNamespace())) { xmlEnvironment = XmlEnvironment.builder() .withNamespace(MediaElement.NAMESPACE) .withNext(null) .build(); } xml.append(uris, xmlEnvironment); xml.closeElement(this); return xml; }
Source:
<code>public void getAltNetwork() { class AltNetwork extends MainNetParams { <START> private AltNetwork() { <END> super(); id = "alt.network"; addressHeader = 48; p2shHeader = 5; } } AltNetwork altNetwork = new AltNetwork(); Networks.register(altNetwork); NetworkParameters params = LegacyAddress.getParametersFromAddress("LLxSnHLN2CYyzB5eWTR9K9rS9uWtbTQFb6"); assertEquals(altNetwork.getId(), params.getId()); params = LegacyAddress.getParametersFromAddress("17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL"); assertEquals(MAINNET.getId(), params.getId()); Networks.unregister(altNetwork); try { LegacyAddress.getParametersFromAddress("LLxSnHLN2CYyzB5eWTR9K9rS9uWtbTQFb6"); fail(); } catch (AddressFormatException e) { } }</code><technical_language>This is unrelated change I guess</technical_language>

Target:
public void getAltNetwork() { class AltNetwork extends MainNetParams { AltNetwork() { super(); id = "alt.network"; addressHeader = 48; p2shHeader = 5; } } AltNetwork altNetwork = new AltNetwork(); Networks.register(altNetwork); NetworkParameters params = LegacyAddress.getParametersFromAddress("LLxSnHLN2CYyzB5eWTR9K9rS9uWtbTQFb6"); assertEquals(altNetwork.getId(), params.getId()); params = LegacyAddress.getParametersFromAddress("17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL"); assertEquals(MAINNET.getId(), params.getId()); Networks.unregister(altNetwork); try { LegacyAddress.getParametersFromAddress("LLxSnHLN2CYyzB5eWTR9K9rS9uWtbTQFb6"); fail(); } catch (AddressFormatException e) { } }
Source:
<code>public SELF isEmpty() { isNotNull(); <START> isFlipped(); <END> if (actual.limit() != 0) throwAssertionError(shouldBeEmpty(actual)); return myself; }</code><technical_language>ok, some googling I guess is required read data</technical_language>

Target:
public SELF isEmpty() { isNotNull(); if (actual.position() != actual.limit()) throwAssertionError(shouldBeEmpty(actual)); return myself; }
Source:
<code>public void onPause() { <START> scrollPosition = translationView.findFirstCompletelyVisibleItemPosition(); <END> ayahTrackerPresenter.unbind(this); presenter.unbind(this); super.onPause(); }</code><technical_language>move this onSaveInstanceState</technical_language>

Target:
public void onPause() { ayahTrackerPresenter.unbind(this); presenter.unbind(this); super.onPause(); }
Source:
<code>public String toString() { <START> StringBuilder builder = new StringBuilder(); <END> builder.append("PlaceRequest(nameToken="); builder.append(nameToken); builder.append(", params="); builder.append(params); builder.append(")"); return builder.toString(); }</code><technical_language>I decide if StringBuilder is overkill. String concatenation is enough. do @christiangoudreau</technical_language>

Target:
public String toString() { return "PlaceRequest(nameToken=" + nameToken + ", params=" + params + ")"; }
Source:
<code>public void createAsynchronousServiceBusReceiverWithAad() { <START> DefaultAzureCredential credential = new DefaultAzureCredentialBuilder() <END> .build(); ServiceBusReceiverAsyncClient receiver = new ServiceBusClientBuilder() .credential("<<fully-qualified-namespace>>", credential) .buildReceiverClientBuilder() .queueName("<<queue-name>>") .buildAsyncClient(); }</code><technical_language>This is code sample in 44 - 52</technical_language>

Target:
public void createAsynchronousServiceBusReceiverWithAad() { ClientSecretCredential credential = new ClientSecretCredentialBuilder() .clientId("<< APPLICATION (CLIENT) ID >>") .clientSecret("<< APPLICATION SECRET >>") .tenantId("<< TENANT ID >>") .build(); ServiceBusReceiverAsyncClient receiver = new ServiceBusClientBuilder() .credential("<<fully-qualified-namespace>>", credential) .receiver() .queueName("<<queue-name>>") .buildAsyncClient(); }
Source:
<code>private void writeFeed(Writer writer, Feed feed, String feedTemplate) throws IOException { String feedInfo = feedTemplate <START> .replaceAll("\\{FEED_IMG\\}", feed.getImageUrl()) <END> .replaceAll("\\{FEED_TITLE\\}", feed.getTitle()) .replaceAll("\\{FEED_LINK\\}", feed.getLink()) .replaceAll("\\{FEED_WEBSITE\\}", feed.getDownload_url()); writer.append(feedInfo); }</code><technical_language>I replace enough here. replaces occurrences a regex</technical_language>

Target:
private void writeFeed(Writer writer, Feed feed, String feedTemplate) throws IOException { String feedInfo = feedTemplate .replace("{FEED_IMG}", feed.getImageUrl()) .replace("{FEED_TITLE}", feed.getTitle()) .replace("{FEED_LINK}", feed.getLink()) .replace("{FEED_WEBSITE}", feed.getDownload_url()); writer.append(feedInfo); }
Source:
<code>public void testWrongChunkFormat1() throws IOException { Path foo = scratch.file("/root/foo.cc", "#include <stdio.h>", "", "void main(){", " printf(\"Hello foo\");", "}"); Path patchFile = scratch.file("/root/patchfile", "diff --git a/foo.cc b/foo.cc", "index f3008f9..ec4aaa0 100644", "--- a/foo.cc", "+++ b/foo.cc", "@@ -2,4 +2,5 @@", " ", " void main(){", " printf(\"Hello foo\");", "+ printf(\"Hello from patch\");", "+", " }"); PatchFailedException expected = assertThrows( PatchFailedException.class, () -> PatchUtil.apply(patchFile, 1, root)); <START> assertThat(expected).hasMessageThat() <END> .contains("Wrong chunk detected near line 11: }"); }</code><technical_language>wrong means?:) more verbose here</technical_language>

Target:
public void testWrongChunkFormat1() throws IOException { Path foo = scratch.file("/root/foo.cc", "#include <stdio.h>", "", "void main(){", " printf(\"Hello foo\");", "}"); Path patchFile = scratch.file("/root/patchfile", "diff --git a/foo.cc b/foo.cc", "index f3008f9..ec4aaa0 100644", "--- a/foo.cc", "+++ b/foo.cc", "@@ -2,4 +2,5 @@", " ", " void main(){", " printf(\"Hello foo\");", "+ printf(\"Hello from patch\");", "+", " }"); PatchFailedException expected = assertThrows( PatchFailedException.class, () -> PatchUtil.apply(patchFile, 1, root)); assertThat(expected).hasMessageThat() .contains("Wrong chunk detected near line 11: }, does not expect an equal line here."); }
Source:
<code>private boolean setArtworkFromMetadata(Metadata metadata) { boolean isArtworkSet = false; <START> int currentPicType = -1; <END> for (int i = 0; i < metadata.length(); i++) { Metadata.Entry metadataEntry = metadata.get(i); int picType; byte[] bitmapData; if (metadataEntry instanceof ApicFrame) { bitmapData = ((ApicFrame) metadataEntry).pictureData; picType = ((ApicFrame) metadataEntry).pictureType; } else if (metadataEntry instanceof PictureFrame) { bitmapData = ((PictureFrame) metadataEntry).pictureData; picType = ((PictureFrame) metadataEntry).pictureType; } else { continue; } if (currentPicType != PICTURE_TYPE_FRONT_COVER) { Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapData, 0, bitmapData.length); isArtworkSet = setDrawableArtwork(new BitmapDrawable(getResources(), bitmap)); currentPicType = picType; } } return isArtworkSet; }</code><technical_language>currentPictureType / pictureType L1255</technical_language>

Target:
private boolean setArtworkFromMetadata(Metadata metadata) { boolean isArtworkSet = false; int currentPictureType = PICTURE_TYPE_NOT_SET; for (int i = 0; i < metadata.length(); i++) { Metadata.Entry metadataEntry = metadata.get(i); int pictureType; byte[] bitmapData; if (metadataEntry instanceof ApicFrame) { bitmapData = ((ApicFrame) metadataEntry).pictureData; pictureType = ((ApicFrame) metadataEntry).pictureType; } else if (metadataEntry instanceof PictureFrame) { bitmapData = ((PictureFrame) metadataEntry).pictureData; pictureType = ((PictureFrame) metadataEntry).pictureType; } else { continue; } if (currentPictureType == PICTURE_TYPE_NOT_SET || pictureType == PICTURE_TYPE_FRONT_COVER) { Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapData, 0, bitmapData.length); isArtworkSet = setDrawableArtwork(new BitmapDrawable(getResources(), bitmap)); currentPictureType = pictureType; if (currentPictureType == PICTURE_TYPE_FRONT_COVER) { break; } } } return isArtworkSet; }
Source:
<code>public DataverseRequest(User aUser, HttpServletRequest aHttpServletRequest) { this.user = aUser; String saneDefault = undefined; String remoteAddressStr = saneDefault; IpAddress address = null; if (aHttpServletRequest != null) { if (headerToUse != null && ALLOWED_HEADERS.contains(headerToUse.toLowerCase())) { Enumeration<String> ipEnumeration = aHttpServletRequest.getHeaders(headerToUse); if (ipEnumeration.hasMoreElements()) { String ip = ipEnumeration.nextElement(); while (ipEnumeration.hasMoreElements()) { ip = ipEnumeration.nextElement(); } int index = ip.indexOf(','); if (index >= 0) { ip = ip.substring(index + 1); } if (ip != null) { try { address = IpAddress.valueOf(ip); } catch (IllegalArgumentException iae) { logger.warning("Ignoring invalid IP address received in header " + headerToUse + " : " + ip); address = null; } if (address!= null && address.isLocalhost()) { logger.warning("Ignoring localhost received as IP address in header " + headerToUse + " : " + ip); address = null; } } } if (address == null) { <START> String remoteAddressFromRequest = aHttpServletRequest.getRemoteAddr(); if (remoteAddressFromRequest != null) { remoteAddressStr = remoteAddressFromRequest; try { address = IpAddress.valueOf(remoteAddressStr); } catch (IllegalArgumentException iae) { address = IpAddress.valueOf(saneDefault); } <END> } } } } sourceAddress = address; }</code><technical_language>This is verbose. sense refactor code of IpAddress.valueOf() null safe a default parameter? render this a oneliner, easier read understand</technical_language>

Target:
public DataverseRequest(User aUser, HttpServletRequest aHttpServletRequest) { this.user = aUser; IpAddress address = null; if (aHttpServletRequest != null) { if (headerToUse != null) { Enumeration<String> ipEnumeration = aHttpServletRequest.getHeaders(headerToUse); if (ipEnumeration.hasMoreElements()) { String ip = ipEnumeration.nextElement(); while (ipEnumeration.hasMoreElements()) { ip = ipEnumeration.nextElement(); } int index = ip.lastIndexOf(','); if (index >= 0) { ip = ip.substring(index + 1); } if (ip != null) { try { address = IpAddress.valueOf(ip); } catch (IllegalArgumentException iae) { logger.warning("Ignoring invalid IP address received in header " + headerToUse + " : " + ip); address = null; } if (address!= null && address.isLocalhost()) { logger.warning("Ignoring localhost received as IP address in header " + headerToUse + " : " + ip); address = null; } } } } if (address == null) { String remoteAddressFromRequest = aHttpServletRequest.getRemoteAddr(); if (remoteAddressFromRequest != null) { String remoteAddressStr = remoteAddressFromRequest; try { address = IpAddress.valueOf(remoteAddressStr); } catch (IllegalArgumentException iae) { address = IpAddress.valueOf(undefined); } } } } sourceAddress = address; }
Source:
<code>public EventDiskCache(Tracker tracker) { <START> File baseDir = new File(tracker.getPiwik().getContext().getCacheDir(), CACHE_DIR_NAME); <END> mCacheDir = new File(baseDir, tracker.getAPIUrl().getHost() + "_" + tracker.getAPIUrl().getPort()); File[] storedContainers = mCacheDir.listFiles(); if (storedContainers != null) { Arrays.sort(storedContainers); mEventContainer.addAll(Arrays.asList(storedContainers)); } else mCacheDir.mkdirs(); }</code><technical_language>Hello, I a : for API 18 previous, external cache (SDRAM), ? tested ? Thanks, Eric</technical_language>

Target:
public EventDiskCache(Tracker tracker) { mMaxAge = tracker.getOfflineCacheAge(); mMaxSize = tracker.getOfflineCacheSize(); File baseDir = new File(tracker.getPiwik().getContext().getCacheDir(), CACHE_DIR_NAME); mCacheDir = new File(baseDir, tracker.getAPIUrl().getHost()); File[] storedContainers = mCacheDir.listFiles(); if (storedContainers != null) { Arrays.sort(storedContainers); for (File container : storedContainers) { mCurrentSize += container.length(); mEventContainer.add(container); } } else { if (!mCacheDir.mkdirs()) Timber.tag(TAG).e("Failed to make disk-cache dir %s", mCacheDir); } }
Source:
<code>public void deleteModelWithResponse() { String modelId = "{model_id}"; formTrainingAsyncClient.deleteModelWithResponse(modelId).subscribe(val -> <START> System.out.printf("Model ID = %s is deleted%n", modelId)); <END> END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.deleteModelWithResponse#string-string }</code><technical_language>subscribe print response status</technical_language>

Target:
public void deleteModelWithResponse() { String modelId = "{model_id}"; formTrainingAsyncClient.deleteModelWithResponse(modelId).subscribe(response -> { System.out.printf("Response Status Code: %d.", response.getStatusCode()); System.out.printf("Model Id: %s is deleted%n", modelId); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.deleteModelWithResponse#string }
Source:
<code>public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); <START> fEventFactor = Math.max(DEFAULT_FACTOR, nbEvents / DEFAULT_FACTOR); <END> fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR + 2); }</code><technical_language>This is correct. I suggest a index i starting 1, report 1 unit of work nbRead > nbEvents*i/factor, incrementing i time. of 'factor' nbEvents clampled [1,DEFAULT_FACTOR], in case nbEvents is < DEFAULT_FACTOR 0. This factor SubMonitor's number of ticks</technical_language>

Target:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = Math.max(1, nbEvents / DEFAULT_FACTOR); fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR); }
Source:
<code>public <T> List<T> listServices(Class<T> clazz, String filterString) throws InvalidSyntaxException { Filter filter = makeFilter(clazz, filterString); ServiceTracker tracker = new ServiceTracker(bundleContext, filter, null); return getListFromTracker(tracker); <START> <END> }</code><technical_language>backspace</technical_language>

Target:
public <T> List<T> listServices(Class<T> clazz, String filterString) throws IllegalArgumentException { Filter filter = makeFilter(clazz, filterString); ServiceTracker tracker = new ServiceTracker(bundleContext, filter, null); return getListFromTracker(tracker); }
Source:
<code>private void processVmsWithDevicesChange() { if (!VmDeviceCommonUtils.isOldClusterVersion(vdsManager.getGroupCompatibilityVersion())) { if (!vmsWithChangedDevices.isEmpty()) { ArrayList<String> vmsToUpdate = new ArrayList<>(vmsWithChangedDevices.size()); for (Pair<VM, VmInternalData> pair : vmsWithChangedDevices) { Guid vmId = pair.getFirst().getId(); VmAnalyzer vmAnalyzer = vmAnalyzers.stream() .filter(analyzer -> vmId.equals(analyzer.getVdsmVm().getVmDynamic().getId())) .collect(Collectors.toList()) <START> .get(0); <END> if (vmAnalyzer.getVmDynamicToSave() != null) { vmAnalyzer.getVmDynamicToSave().setHash(pair.getSecond().getVmDynamic().getHash()); vmsToUpdate.add(vmId.toString()); } else { log.warn("VM '{}' not in changed list, skipping devices update.", vmId); } } updateVmDevices(vmsToUpdate); } } }</code><technical_language>This NPE if is vmId in vmDynamicToSave. is faster more safe .getFirst().orElse(null) instead of collector</technical_language>

Target:
private void processVmsWithDevicesChange() { if (!VmDeviceCommonUtils.isOldClusterVersion(vdsManager.getGroupCompatibilityVersion())) { if (!vmsWithChangedDevices.isEmpty()) { ArrayList<String> vmsToUpdate = new ArrayList<>(vmsWithChangedDevices.size()); for (Pair<VM, VmInternalData> pair : vmsWithChangedDevices) { Guid vmId = pair.getFirst().getId(); VmAnalyzer vmAnalyzer = vmAnalyzers.stream() .filter(analyzer -> vmId.equals(analyzer.getVdsmVm().getVmDynamic().getId())) .findFirst().orElse(null); if (vmAnalyzer != null && vmAnalyzer.getVmDynamicToSave() != null) { vmAnalyzer.getVmDynamicToSave().setHash(pair.getSecond().getVmDynamic().getHash()); vmsToUpdate.add(vmId.toString()); } else { log.warn("VM '{}' not in changed list, skipping devices update.", vmId); } } updateVmDevices(vmsToUpdate); } } }
Source:
<code>public void signal(String sessionId, String connectionId, SignalProperties props) throws OpenTokException , RequestException , InvalidArgumentException { <START> if (sessionId == null || sessionId == "" || connectionId == null || connectionId == "") { <END> throw new InvalidArgumentException("Session or Connection string null or empty"); } try { this.client.signal(sessionId, connectionId, props); } catch (Exception e) { throw e; } }</code><technical_language>isEmpty() instead of empty string comparison</technical_language>

Target:
public void signal(String sessionId, String connectionId, SignalProperties props) throws OpenTokException , RequestException , InvalidArgumentException { if (sessionId == null || sessionId.isEmpty() || connectionId == null || connectionId.isEmpty()) { throw new InvalidArgumentException("Session or Connection string null or empty"); } try { this.client.signal(sessionId, connectionId, props); } catch (Exception e) { throw e; } }
Source:
<code>public void validIsbnNumber() { <START> Assert.assertEquals(true, isbnVerifier.isValid("3-598-21508-8")); <END> }</code><technical_language>assertTrue assertFalse instead of assertEquals, give error messages tests fails :)</technical_language>

Target:
public void validIsbnNumber() { assertTrue(isbnVerifier.isValid("3-598-21508-8")); }
Source:
<code>private static void checkNotIndeterminate(Boolean equalsResult) { if (equalsResult == null) { <START> throw new PrestoException(NOT_SUPPORTED, "array_position does not support indeterminate comparison results"); <END> } }</code><technical_language>ditto "indeterminate" in error messages</technical_language>

Target:
private static void checkNotIndeterminate(Boolean equalsResult) { if (equalsResult == null) { throw new PrestoException(NOT_SUPPORTED, "array_position does not support arrays with elements that are null or contain null"); } }
Source:
<code>public void checkWebhooks() { final long start = System.currentTimeMillis(); final List<SingularityWebhook> webhooks = webhookManager.getActiveWebhooks(); if (webhooks.isEmpty()) { return; } int taskUpdates = 0; int requestUpdates = 0; int deployUpdates = 0; <START> List<CompletableFuture<Void>> webhookFutures = new ArrayList<>(); <END> for (SingularityWebhook webhook : webhooks) { switch (webhook.getType()) { case TASK: taskUpdates += checkTaskUpdates(webhook, webhookFutures); break; case REQUEST: requestUpdates += checkRequestUpdates(webhook, webhookFutures); break; case DEPLOY: deployUpdates += checkDeployUpdates(webhook, webhookFutures); break; default: break; } } CompletableFutures.allOf(webhookFutures) .exceptionally((t) -> { LOG.error("Exception in webhook", t); return null; }); LOG.info("Sent task, request, and deploy updates for webhooks in {}", taskUpdates, requestUpdates, deployUpdates, webhooks.size(), JavaUtils.duration(start)); }</code><technical_language>Is this list written to</technical_language>

Target:
public void checkWebhooks() { final long start = System.currentTimeMillis(); final List<SingularityWebhook> webhooks = webhookManager.getActiveWebhooks(); if (webhooks.isEmpty()) { return; } int taskUpdates = 0; int requestUpdates = 0; int deployUpdates = 0; List<CompletableFuture<Response>> webhookFutures = new ArrayList<>(); for (SingularityWebhook webhook : webhooks) { switch (webhook.getType()) { case TASK: taskUpdates += checkTaskUpdates(webhook, webhookFutures); break; case REQUEST: requestUpdates += checkRequestUpdates(webhook, webhookFutures); break; case DEPLOY: deployUpdates += checkDeployUpdates(webhook, webhookFutures); break; default: break; } } CompletableFutures.allOf(webhookFutures) .exceptionally((t) -> { LOG.error("Exception in webhook", t); return null; }); LOG.info("Sent task, request, and deploy updates for webhooks in {}", taskUpdates, requestUpdates, deployUpdates, webhooks.size(), JavaUtils.duration(start)); }
Source:
<code>private BlockingChannel getBlockingChannelBasedOnPortType(String host, int port) { BlockingChannel channel = null; if (portType == PortType.PLAINTEXT) { channel = new BlockingChannel(host, port, config.connectionPoolReadBufferSizeBytes, config.connectionPoolWriteBufferSizeBytes, config.connectionPoolReadTimeoutMs, config.connectionPoolConnectTimeoutMs); } else if (portType == PortType.SSL) { channel = new SSLBlockingChannel(host, port, config.connectionPoolReadBufferSizeBytes, config.connectionPoolWriteBufferSizeBytes, config.connectionPoolReadTimeoutMs, config.connectionPoolConnectTimeoutMs); <START> } <END> return channel; }</code><technical_language>else throw exception I</technical_language>

Target:
private BlockingChannel getBlockingChannelBasedOnPortType(String host, int port) { BlockingChannel channel = null; if (this.port.getPortType() == PortType.PLAINTEXT) { channel = new BlockingChannel(host, port, config.connectionPoolReadBufferSizeBytes, config.connectionPoolWriteBufferSizeBytes, config.connectionPoolReadTimeoutMs, config.connectionPoolConnectTimeoutMs); } else if (this.port.getPortType() == PortType.SSL) { channel = new SSLBlockingChannel(host, port, config.connectionPoolReadBufferSizeBytes, config.connectionPoolWriteBufferSizeBytes, config.connectionPoolReadTimeoutMs, config.connectionPoolConnectTimeoutMs); } return channel; }