auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void handleAnyMatch(MethodInvocationTree anyMatchMIT) { ExpressionTree predicate = anyMatchMIT.arguments().get(0); if (anyMatchMIT.parent().is(Tree.Kind.LOGICAL_COMPLEMENT)) { if (predicate.is(Tree.Kind.LAMBDA_EXPRESSION) && ((LambdaExpressionTree) predicate).body().is(Tree.Kind.LOGICAL_COMPLEMENT)) { <START> context.reportIssue(this, MethodsHelper.methodName(anyMatchMIT), <END> "Replace this double negation with \"allMatch()\" and positive predicate."); } else { context.reportIssue(this, MethodsHelper.methodName(anyMatchMIT), "Replace this negation and \"anyMatch()\" with \"noneMatch()\"."); } } if (predicate.is(Tree.Kind.METHOD_REFERENCE) && isBooleanValueReference((MethodReferenceTree) predicate)) { previousMITInChain(anyMatchMIT) .filter(MAP_METHODS::anyMatch) .ifPresent(mapMIT -> context.reportIssue(this, MethodsHelper.methodName(anyMatchMIT), "Use predicate from \"map()\" directly in \"anyMatch()\".")); } }</code><technical_language>I MethodsHelper.methodName(anyMatchMIT) extracted in a dedicated reportTree, in 3 places</technical_language>

Target:
private void handleAnyMatch(MethodInvocationTree anyMatchMIT) { ExpressionTree predicate = anyMatchMIT.arguments().get(0); IdentifierTree reportTree = MethodsHelper.methodName(anyMatchMIT); if (anyMatchMIT.parent().is(Tree.Kind.LOGICAL_COMPLEMENT)) { if (predicate.is(Tree.Kind.LAMBDA_EXPRESSION) && ((LambdaExpressionTree) predicate).body().is(Tree.Kind.LOGICAL_COMPLEMENT)) { context.reportIssue(this, reportTree, "Replace this double negation with \"allMatch()\" and positive predicate."); } else { context.reportIssue(this, reportTree, "Replace this negation and \"anyMatch()\" with \"noneMatch()\"."); } } if (predicate.is(Tree.Kind.METHOD_REFERENCE) && isBooleanValueReference((MethodReferenceTree) predicate)) { previousMITInChain(anyMatchMIT) .filter(MAP_METHODS::anyMatch) .ifPresent(mapMIT -> context.reportIssue(this, reportTree, "Use mapper from \"map()\" directly as predicate in \"anyMatch()\".")); } }
Source:
<code>private void createDiffLinkAndText(final RevCommit parent, final Diff diff) throws IOException { String parentName = parent.toObjectId().abbreviate(7).name(); EditList interestingDiff = getInterestingDiff(diff.getEditList()); final Integer parentLine; if (!interestingDiff.isEmpty()) parentLine = Integer.valueOf(interestingDiff.get(0).getBeginA()); else parentLine = null; Link link = new Link(diffComposite, SWT.NONE); link.setText(NLS.bind(UIText.BlameInformationControl_DiffLinkText, <START> parentName)); <END> link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { blameParent(parent, diff, parentLine); } }); DiffViewer diffText = new DiffViewer(diffComposite, null, SWT.NONE); diffText.setEditable(false); diffText.getControl().setLayoutData( GridDataFactory.fillDefaults().grab(true, true).create()); IDocument document = new Document(); DiffStyleRangeFormatter diffFormatter = new DiffStyleRangeFormatter( document); diffFormatter.setRepository(revision.getRepository()); diffFormatter.format(interestingDiff, diff.getOldText(), diff.getNewText()); diffText.setDocument(document); diffText.setFormatter(diffFormatter); }</code><technical_language>I show commit header of parent commit this provides a lot more useful context human observer, I commitIds of interesting commits. nice if auto-scroll history view commit showing diff for in blame info control</technical_language>

Target:
private void createDiffLinkAndText(final RevCommit parent, final Diff diff) throws IOException { String parentId = parent.toObjectId().abbreviate(7).name(); String parentMessage = parent.getShortMessage(); EditList interestingDiff = getInterestingDiff(diff.getEditList()); final Integer parentLine; if (!interestingDiff.isEmpty()) parentLine = Integer.valueOf(interestingDiff.get(0).getBeginA()); else parentLine = null; Composite header = new Composite(diffComposite, SWT.NONE); header.setLayout(GridLayoutFactory.fillDefaults().numColumns(2) .create()); Label diffHeaderLabel = new Label(header, SWT.NONE); diffHeaderLabel.setText(NLS.bind( UIText.BlameInformationControl_DiffHeaderLabel, parentId, parentMessage)); Link showAnnotationsLink = new Link(header, SWT.NONE); showAnnotationsLink .setText(UIText.BlameInformationControl_ShowAnnotationsLink); showAnnotationsLink.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { blameParent(parent, diff, parentLine); } }); DiffViewer diffText = new DiffViewer(diffComposite, null, SWT.NONE); diffText.setEditable(false); diffText.getControl().setLayoutData( GridDataFactory.fillDefaults().grab(true, true).create()); IDocument document = new Document(); DiffStyleRangeFormatter diffFormatter = new DiffStyleRangeFormatter( document); diffFormatter.setRepository(revision.getRepository()); diffFormatter.format(interestingDiff, diff.getOldText(), diff.getNewText()); diffText.setDocument(document); diffText.setFormatter(diffFormatter); }
Source:
<code>private Optional<User> loadUserDetails(String username) { User user = strongboxUserManager.findByUserName(username); Date userLastUpdate = Optional.ofNullable(user) .flatMap(u -> Optional.ofNullable(u.getLastUpdate())) .orElse(Date.from(Instant.EPOCH)); Date userExpireDate = Date.from(Instant.ofEpochMilli(userLastUpdate.getTime()) .plusSeconds(externalUsersInvalidateSeconds)); Date nowDate = new Date(); if (user != null && (StringUtils.isBlank(user.getSourceId()) || nowDate.before(userExpireDate))) { return Optional.of(user); } for (Entry<String, UserDetailsService> userDetailsServiceEntry : userProviderMap.entrySet()) { String sourceId = userDetailsServiceEntry.getKey(); UserDetailsService userDetailsService = userDetailsServiceEntry.getValue(); try { return Optional.of(strongboxUserManager.updateExternalUserDetails(sourceId, userDetailsService.loadUserByUsername(username))); } catch (UsernameNotFoundException e) { continue; } } <START> strongboxUserManager.deleteByUserName(username); <END> return Optional.empty(); }</code><technical_language>Cosmetic: This method's name deleteByUsername(...)</technical_language>

Target:
private Optional<User> loadUserDetails(String username) { User user = strongboxUserManager.findByUsername(username); Date userLastUpdate = Optional.ofNullable(user) .flatMap(u -> Optional.ofNullable(u.getLastUpdate())) .orElse(Date.from(Instant.EPOCH)); Date userExpireDate = Date.from(Instant.ofEpochMilli(userLastUpdate.getTime()) .plusSeconds(externalUsersInvalidateSeconds)); Date nowDate = new Date(); if (user != null && (StringUtils.isBlank(user.getSourceId()) || nowDate.before(userExpireDate))) { return Optional.of(user); } for (Entry<String, UserDetailsService> userDetailsServiceEntry : userProviderMap.entrySet()) { String sourceId = userDetailsServiceEntry.getKey(); UserDetailsService userDetailsService = userDetailsServiceEntry.getValue(); try { return Optional.of(strongboxUserManager.cacheExternalUserDetails(sourceId, userDetailsService.loadUserByUsername(username))); } catch (UsernameNotFoundException e) { continue; } } strongboxUserManager.deleteByUsername(username); return Optional.empty(); }
Source:
<code>private void copyDiskDevicesFromTemplate() { <START> List<VmDevice> disks = DbFacade.getInstance().getVmDeviceDao().getVmDeviceByVmIdAndType(getVmTemplateId(), VmDeviceGeneralType.DISK); <END> VmDeviceUtils.copyVmDevices( vmDisksSource.getId(), getVmId(), getVm(), getVm().getStaticData(), true, disks, getSrcDeviceIdToTargetDeviceIdMapping(), false, false, false, false, false ); }</code><technical_language>please vmDisksSource</technical_language>

Target:
private void copyDiskDevicesFromTemplate() { List<VmDevice> disks = DbFacade.getInstance().getVmDeviceDao().getVmDeviceByVmIdAndType(vmDisksSource.getId(), VmDeviceGeneralType.DISK); VmDeviceUtils.copyVmDevices( vmDisksSource.getId(), getVmId(), getVm(), getVm().getStaticData(), true, disks, getSrcDeviceIdToTargetDeviceIdMapping(), false, false, false, false, false ); }
Source:
<code>private int unsignedShortToInt(final byte[] bytes) { <START> ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); <END> return buffer.getInt(); }</code><technical_language>final</technical_language>

Target:
private int unsignedShortToInt(final byte[] bytes) { final ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); return buffer.getInt(); }
Source:
<code>public CheckPolicyResponseType checkPolicy(CheckPolicyRequestType request, AssertionType assertion) { LOG.trace("Begin AdapterPEPProxyWebServiceUnsecuredImpl.checkPolicy"); CheckPolicyResponseType checkPolicyResponse = new CheckPolicyResponseType(); String serviceName = NhincConstants.ADAPTER_PEP_SERVICE_NAME; try { LOG.debug("Before target system URL look up."); String url = oProxyHelper.getAdapterEndPointFromConnectionManager(serviceName); LOG.debug("After target system URL look up. URL for service: " + serviceName + " is: " + url); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AdapterPEPPortType> portDescriptor = new AdapterPEPServicePortDescriptor(); CONNECTClient<AdapterPEPPortType> client = getCONNECTClientUnsecured(portDescriptor, url, assertion); checkPolicyResponse = (CheckPolicyResponseType) client.invokePort(AdapterPEPPortType.class, "checkPolicy", request); } else { LOG.error("Failed to call the web service (" + serviceName + "). The URL is null."); } } catch (Exception ex) { String message = "Error occurred calling AdapterPEPProxyWebServiceUnsecuredImpl.checkPolicy. Error: " <START> + ex.getMessage(); <END> LOG.error(message, ex); throw new RuntimeException(message, ex); } LOG.trace("End AdapterPEPProxyWebServiceUnsecuredImpl.checkPolicy"); return checkPolicyResponse; }</code><technical_language>Optional: need log if rethrow exception (<LINK_0></technical_language>

Target:
public CheckPolicyResponseType checkPolicy(CheckPolicyRequestType request, AssertionType assertion) { LOG.trace("Begin AdapterPEPProxyWebServiceUnsecuredImpl.checkPolicy"); CheckPolicyResponseType checkPolicyResponse = new CheckPolicyResponseType(); String serviceName = NhincConstants.ADAPTER_PEP_SERVICE_NAME; try { LOG.debug("Before target system URL look up."); String url = oProxyHelper.getAdapterEndPointFromConnectionManager(serviceName); LOG.debug("After target system URL look up. URL for service: is: {}", serviceName, url); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AdapterPEPPortType> portDescriptor = new AdapterPEPServicePortDescriptor(); CONNECTClient<AdapterPEPPortType> client = getCONNECTClientUnsecured(portDescriptor, url, assertion); checkPolicyResponse = (CheckPolicyResponseType) client.invokePort(AdapterPEPPortType.class, "checkPolicy", request); } else { LOG.error("Failed to call the web service ({}). The URL is null.", serviceName); } } catch (Exception ex) { String message = "Error occurred calling AdapterPEPProxyWebServiceUnsecuredImpl.checkPolicy. Error: " + ex.getMessage(); throw new RuntimeException(message, ex); } LOG.trace("End AdapterPEPProxyWebServiceUnsecuredImpl.checkPolicy"); return checkPolicyResponse; }
Source:
<code>public DatastreamTaskImpl(InternalDatastreamTask internalDatastreamTask, List<Datastream> datastreams, ZkAdapter zkAdapter) { this(internalDatastreamTask, datastreams); <START> if (Strings.isNullOrEmpty(_transportProviderName)) { <END> _transportProviderName = zkAdapter.getDefaultTransportProviderName(); } _zkAdapter = zkAdapter; }</code><technical_language>this removed right</technical_language>

Target:
public DatastreamTaskImpl(InternalDatastreamTask internalDatastreamTask, List<Datastream> datastreams, ZkAdapter zkAdapter) { this(internalDatastreamTask, datastreams); _zkAdapter = zkAdapter; }
Source:
<code>public String getPayloadAsString() throws InvalidUtf8Exception { if (payload instanceof String) { return (String) payload; } else if (payload instanceof byte[]){ <START> return Utf8Util.encodePayloadToUtf8ReplaceCharacters((byte[]) payload); <END> } else { return ""; } }</code><technical_language>string constructor instead behaviour (not advantage in providing a utility method for IMO)</technical_language>

Target:
public String getPayloadAsString(){ if (payload instanceof String) { return (String) payload; } else if (payload instanceof byte[]){ return new String((byte[]) payload, StandardCharsets.UTF_8); } else { return ""; } }
Source:
<code>public static void beforeClass() throws IOException { SWTBotUtils.initialize(); SWTBotPreferences.TIMEOUT = <START> 20000; fLogger.removeAllAppenders(); fLogger.addAppender(new NullAppender()); File parentDir = FileUtils.toFile(FileLocator.toFileURL(CtfTestTrace.TRACE_EXPERIMENT.getTraceURL())); File[] traceFiles = parentDir.listFiles(); ITmfTrace traceValidator = new CtfTmfTrace(); fBot = new SWTWorkbenchBot(); SWTBotUtils.createProject(PROJECT_NAME); int openedTraces = 0; for (File traceFile : traceFiles) { String absolutePath = traceFile.getAbsolutePath(); if (traceValidator.validate(null, absolutePath).isOK()) { SWTBotUtils.openTrace(PROJECT_NAME, absolutePath, TRACE_TYPE); fBot.closeAllEditors(); openedTraces++; if (openedTraces >= NUM_TRACES) { break; } } } traceValidator.dispose(); WaitUtils.waitForJobs(); setup(); }</code><technical_language>accelerate tests, this is time swtbot decides if waiting time for operation timeout</technical_language>

Target:
public static void beforeClass() throws IOException { SWTBotUtils.initialize(); SWTBotPreferences.TIMEOUT = 50000; fLogger.removeAllAppenders(); fLogger.addAppender(new NullAppender()); File parentDir = FileUtils.toFile(FileLocator.toFileURL(CtfTestTrace.TRACE_EXPERIMENT.getTraceURL())); File[] traceFiles = parentDir.listFiles(); ITmfTrace traceValidator = new CtfTmfTrace(); fBot = new SWTWorkbenchBot(); SWTBotUtils.createProject(PROJECT_NAME); int openedTraces = 0; for (File traceFile : traceFiles) { String absolutePath = traceFile.getAbsolutePath(); if (traceValidator.validate(null, absolutePath).isOK()) { SWTBotUtils.openTrace(PROJECT_NAME, absolutePath, TRACE_TYPE); fBot.closeAllEditors(); openedTraces++; if (openedTraces >= NUM_TRACES) { break; } } } traceValidator.dispose(); WaitUtils.waitForJobs(); SWTBotTreeItem tracesFolder = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); tracesFolder.contextMenu().menu("Open As Experiment...", "Generic Experiment").click(); SWTBotUtils.activateEditor(fBot, "Experiment"); SWTBotTreeItem project = SWTBotUtils.selectProject(fBot, PROJECT_NAME); SWTBotTreeItem experimentItem = SWTBotUtils.getTraceProjectItem(fBot, project, "Experiments", "Experiment"); fexperimentItem = experimentItem; experimentItem.select(); TmfTraceManager traceManager = TmfTraceManager.getInstance(); ftraceManager = traceManager; ITmfTrace trace = traceManager.getActiveTrace(); assertTrue(String.valueOf(trace), trace instanceof TmfExperiment); TmfExperiment experiment = (TmfExperiment) trace; assertNotNull(experiment); ITmfProjectModelElement elem = TmfProjectRegistry.findElement(experiment.getResource(), true); assertTrue(elem instanceof TmfExperimentElement); fOriginalExperiment = experiment; TmfTimeRange traceCutRange = getTraceCutRange(experiment); assertNotNull(traceCutRange); fRequestedTraceCutRange = traceCutRange; }
Source:
<code>public static void handleKey(SelectionKey key) { ConnectionHandler handler = ((ConnectionHandler)key.attachment()); try { if (handler == null) return; if (!key.isValid()) { handler.closeConnection(); return; } if (key.isReadable()) { int read = handler.channel.read(handler.readBuff); if (read == 0) return; else if (read == -1) { key.cancel(); handler.closeConnection(); return; } handler.readBuff.flip(); int bytesConsumed = checkNotNull(handler.parser).receiveBytes(handler.readBuff); checkState(handler.readBuff.position() == bytesConsumed); handler.readBuff.compact(); } if (key.isWritable()) handler.tryWriteBytes(); } catch (Exception e) { log.error("Error handling SelectionKey: {}", Throwables.getRootCause(e).getMessage()); <START> log.error("Error reason: ", e); <END> handler.closeConnection(); } }</code><technical_language>basically logging twice? reduce log item</technical_language>

Target:
public static void handleKey(SelectionKey key) { ConnectionHandler handler = ((ConnectionHandler)key.attachment()); try { if (handler == null) return; if (!key.isValid()) { handler.closeConnection(); return; } if (key.isReadable()) { int read = handler.channel.read(handler.readBuff); if (read == 0) return; else if (read == -1) { key.cancel(); handler.closeConnection(); return; } handler.readBuff.flip(); int bytesConsumed = checkNotNull(handler.parser).receiveBytes(handler.readBuff); checkState(handler.readBuff.position() == bytesConsumed); handler.readBuff.compact(); } if (key.isWritable()) handler.tryWriteBytes(); } catch (Exception e) { Throwable t = Throwables.getRootCause(e); log.error("Error handling SelectionKey: {}", t.getMessage() != null ? t.getMessage() : t.getClass().getName()); handler.closeConnection(); } }
Source:
<code>public void start() { String applicationName = ninjaProps.getWithDefault( NinjaConstant.applicationName, "Ninja"); if (ninjaProps.getBooleanWithDefault("metrics.jvm.enabled", false)) { registerAll("jvm.gc", new GarbageCollectorMetricSet()); registerAll("jvm.memory", new MemoryUsageGaugeSet()); registerAll("jvm.threads", new ThreadStatesGaugeSet()); registerAll("jvm.classes", new ClassLoadingGaugeSet()); log.debug("Registered JVM-Metrics integration"); } if (ninjaProps.getBooleanWithDefault("metrics.logback.enabled", false)) { final LoggerContext factory = (LoggerContext) LoggerFactory.getILoggerFactory(); final ch.qos.logback.classic.Logger root = factory.getLogger(Logger.ROOT_LOGGER_NAME); final InstrumentedAppender appender = new InstrumentedAppender(metricRegistry); appender.setContext(root.getLoggerContext()); appender.start(); root.addAppender(appender); log.debug("Registered Logback-Metrics integration"); } <START> if (ninjaProps.getBooleanWithDefault("metrics.jmx.enabled", true)) { <END> JmxReporter reporter = JmxReporter.forRegistry(metricRegistry) .inDomain(applicationName).build(); reporter.start(); reporters.add(reporter); log.debug("Started Ninja Metrics JMX reporter"); } log.info("Ninja Metrics is ready for collection."); }</code><technical_language>set false default..</technical_language>

Target:
public void start() { String applicationName = ninjaProps.getWithDefault( NinjaConstant.applicationName, "Ninja"); if (ninjaProps.getBooleanWithDefault("metrics.jvm.enabled", false)) { registerAll("jvm.gc", new GarbageCollectorMetricSet()); registerAll("jvm.memory", new MemoryUsageGaugeSet()); registerAll("jvm.threads", new ThreadStatesGaugeSet()); registerAll("jvm.classes", new ClassLoadingGaugeSet()); log.debug("Registered JVM-Metrics integration"); } if (ninjaProps.getBooleanWithDefault("metrics.logback.enabled", false)) { final LoggerContext factory = (LoggerContext) LoggerFactory.getILoggerFactory(); final ch.qos.logback.classic.Logger root = factory.getLogger(Logger.ROOT_LOGGER_NAME); final InstrumentedAppender appender = new InstrumentedAppender(metricRegistry); appender.setContext(root.getLoggerContext()); appender.start(); root.addAppender(appender); log.debug("Registered Logback-Metrics integration"); } if (ninjaProps.getBooleanWithDefault("metrics.mbeans.enabled", true)) { JmxReporter reporter = JmxReporter.forRegistry(metricRegistry) .inDomain(applicationName).build(); reporter.start(); reporters.add(reporter); log.debug("Started Ninja Metrics MBeans reporter"); } log.info("Ninja Metrics is ready for collection."); }
Source:
<code>private void updateVmTemplate() { vmHandler.updateVmInitToDB(getVmTemplate(), getCompensationContextIfEnabledByCaller()); CompensationUtils.updateEntity(getVmTemplate(), vmTemplateDao, getCompensationContextIfEnabledByCaller()); getVmDeviceUtils().updateSmartcardDevice(getVmTemplateId(), getParameters().getVmTemplateData().isSmartcardEnabled()); getVmDeviceUtils().updateSoundDevice(oldTemplate, getVmTemplate(), getCluster(), getVmTemplate().getCompatibilityVersion(), getParameters().isSoundDeviceEnabled()); getVmDeviceUtils().updateConsoleDevice(getVmTemplateId(), getParameters().isConsoleEnabled()); if (oldTemplate.getUsbPolicy() != getVmTemplate().getUsbPolicy() || oldTemplate.getVmType() != getVmTemplate().getVmType()) { Cluster newCluster = getCluster(); Cluster oldCluster; if (oldTemplate.getClusterId() <START> == newCluster.getId()) <END> { oldCluster = newCluster; } else { oldCluster = oldTemplate.getClusterId() != null ? clusterDao.get(oldTemplate.getClusterId()) : null; } getVmDeviceUtils().updateUsbSlots(oldTemplate, oldCluster, getVmTemplate(), newCluster); } getVmDeviceUtils().updateVirtioScsiController(getVmTemplate(), getParameters().isVirtioScsiEnabled()); if (getParameters().isBalloonEnabled() != null) { getVmDeviceUtils().updateMemoryBalloon(getVmTemplateId(), getParameters().isBalloonEnabled()); } getVmDeviceUtils().updateVideoDevices(oldTemplate, getParameters().getVmTemplateData()); }</code><technical_language>Objects compared equals() method</technical_language>

Target:
private void updateVmTemplate() { vmHandler.updateVmInitToDB(getVmTemplate(), getCompensationContextIfEnabledByCaller()); CompensationUtils.updateEntity(getVmTemplate(), vmTemplateDao, getCompensationContextIfEnabledByCaller()); getVmDeviceUtils().updateSmartcardDevice(getVmTemplateId(), getParameters().getVmTemplateData().isSmartcardEnabled()); getVmDeviceUtils().updateSoundDevice(oldTemplate, getVmTemplate(), getCluster(), getVmTemplate().getCompatibilityVersion(), getParameters().isSoundDeviceEnabled()); getVmDeviceUtils().updateConsoleDevice(getVmTemplateId(), getParameters().isConsoleEnabled()); if (oldTemplate.getUsbPolicy() != getVmTemplate().getUsbPolicy() || oldTemplate.getVmType() != getVmTemplate().getVmType()) { Cluster newCluster = getCluster(); Cluster oldCluster; if (oldTemplate.getClusterId().equals(newCluster.getId())) { oldCluster = newCluster; } else { oldCluster = oldTemplate.getClusterId() != null ? clusterDao.get(oldTemplate.getClusterId()) : null; } getVmDeviceUtils().updateUsbSlots(oldTemplate, oldCluster, getVmTemplate(), newCluster); } getVmDeviceUtils().updateVirtioScsiController(getVmTemplate(), getParameters().isVirtioScsiEnabled()); if (getParameters().isBalloonEnabled() != null) { getVmDeviceUtils().updateMemoryBalloon(getVmTemplateId(), getParameters().isBalloonEnabled()); } getVmDeviceUtils().updateVideoDevices(oldTemplate, getParameters().getVmTemplateData()); }
Source:
<code>private boolean <START> containOverlaps(Collection<LongRange> <END> candidates) { List<LongRange> elected = new ArrayList<>(candidates.size()); return candidates.stream().anyMatch(candidate -> { if (elected.stream().anyMatch(elect -> elect.overlapsRange(candidate))) { return true; } elected.add(candidate); return false; }); }</code><technical_language>check if is chance share code warning generation</technical_language>

Target:
private boolean containOverlaps(Collection<LongRange> candidates) { List<LongRange> elected = new ArrayList<>(candidates.size()); return candidates.stream().anyMatch(candidate -> { if (isRangeCollectionOverlappedByOtherRange(elected, candidate)) { return true; } elected.add(candidate); return false; }); }
Source:
<code>public void requestPeriodicMeterReads(final String organisationIdentification, final String deviceIdentification, final String correlationUid, final PeriodicMeterReadsRequest periodicMeterReadsRequest, final DeviceResponseMessageSender responseMessageSender, final String domain, final String domainVersion, final String messageType) { LOGGER.info("requestPeriodicMeterReads called for device: for organisation: {}", deviceIdentification, organisationIdentification); try { final DlmsDevice device = this.domainHelperService.findDlmsDevice(deviceIdentification); final ClientConnection conn = this.dlmsConnectionFactory.getConnection(device); final PeriodicMeterReadsContainer periodicMeterReadsContainer; try { periodicMeterReadsContainer = this.getPeriodicMeterReadsCommandExecutor.execute(conn, periodicMeterReadsRequest); <START> } finally { <END> if (conn != null && conn.isConnected()) { conn.close(); } } this.sendResponseMessage(domain, domainVersion, messageType, correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.OK, null, responseMessageSender, periodicMeterReadsContainer); } catch (final Exception e) { LOGGER.error("Unexpected exception during requestPeriodicMeterReads", e); final OsgpException ex = this.ensureOsgpException(e); this.sendResponseMessage(domain, domainVersion, messageType, correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.NOT_OK, ex, responseMessageSender, null); } }</code><technical_language>If this.getPeriodicMeterReadsCommandExecutor.execute() throws exception, is handled? this try - finally a catch, I this code handles exceptions thrown a CommandExecutor</technical_language>

Target:
public void requestPeriodicMeterReads(final String organisationIdentification, final String deviceIdentification, final String correlationUid, final PeriodicMeterReadsRequest periodicMeterReadsRequest, final DeviceResponseMessageSender responseMessageSender, final String domain, final String domainVersion, final String messageType) { LOGGER.info("requestPeriodicMeterReads called for device: for organisation: {}", deviceIdentification, organisationIdentification); ClientConnection conn = null; try { final DlmsDevice device = this.domainHelperService.findDlmsDevice(deviceIdentification); conn = this.dlmsConnectionFactory.getConnection(device); final PeriodicMeterReadsContainer periodicMeterReadsContainer = this.getPeriodicMeterReadsCommandExecutor .execute(conn, periodicMeterReadsRequest); this.sendResponseMessage(domain, domainVersion, messageType, correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.OK, null, responseMessageSender, periodicMeterReadsContainer); } catch (final Exception e) { LOGGER.error("Unexpected exception during requestPeriodicMeterReads", e); final OsgpException ex = this.ensureOsgpException(e); this.sendResponseMessage(domain, domainVersion, messageType, correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.NOT_OK, ex, responseMessageSender, null); } finally { if (conn != null && conn.isConnected()) { conn.close(); } } }
Source:
<code>public void unmarshallAccountSummaryBlankAccount() throws Exception { <START> AccountSummary accountSummary = dao.unmarshallAccountSummary(makeValidHibernateAccount(false, false)); <END> assertNotNull(accountSummary); }</code><technical_language>purpose of this test is unmarshallAccountSummary is robust account is (for some reason) null. in mind, want pass in new HibernateAccount(), makeValidHibernateAccount()</technical_language>

Target:
public void unmarshallAccountSummaryBlankAccount() throws Exception { AccountSummary accountSummary = dao.unmarshallAccountSummary(new HibernateAccount()); assertNotNull(accountSummary); }
Source:
<code>public void actionPerformed(ActionEvent e) { <START> final Resource resource = appContext.getResource(); <END> checkState(resource != null); final Project project = resource.getProject(); checkState(MAVEN_ID.equals(project.getType())); final String pathToProjectsDir = "/projects"; final String absolutePathToProjectPom = pathToProjectsDir + project.getLocation().toString() + "/pom.xml"; GetEffectivePomParameters paramsDto = dtoFactory .createDto(GetEffectivePomParameters.class) .withPathToProjectPom(absolutePathToProjectPom); javaLanguageExtensionServiceClient .effectivePom(paramsDto) .then( content -> { editorAgent.openEditor( new SyntheticFile( "pom.xml", project.getAttributes().get(MavenAttributes.ARTIFACT_ID).get(0) + " [effective pom]", content)); }) .catchError( error -> { notificationManager.notify( "Problem with generating effective pom file", error.getMessage(), FAIL, EMERGE_MODE); }); }</code><technical_language>API change here</technical_language>

Target:
public void actionPerformed(ActionEvent e) { final Resource resource = appContext.getResource(); checkNotNull(resource); final Project project = resource.getProject(); checkState(MAVEN_ID.equals(project.getType())); javaLanguageExtensionServiceClient .effectivePom(project.getLocation().toString()) .then( content -> { showEffectivePomInEditor(project, content); }) .catchError( error -> { notificationManager.notify( "Problem with generating effective pom file", error.getMessage(), FAIL, EMERGE_MODE); }); }
Source:
<code>private ThingUID getSceneUID(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID) { <START> if (thingUID == null) { <END> String sceneID = SceneHandler.getSceneID(configuration, bridgeHandlers.get(bridgeUID)); switch (sceneID) { case SceneHandler.SCENE_WRONG: logger.error( "Configured scene '{}' does not exist or can not be used, please check your configuration.", configuration.get(DigitalSTROMBindingConstants.SCENE_ID)); break; case SceneHandler.ZONE_WRONG: logger.error("Configured zone '{}' does not exist, please check your configuration.", configuration.get(DigitalSTROMBindingConstants.ZONE_ID)); break; case SceneHandler.GROUP_WRONG: logger.error("Configured group '{}' does not exist, please check your configuration.", configuration.get(DigitalSTROMBindingConstants.GROUP_ID)); break; case SceneHandler.NO_STRUC_MAN: logger.error("Waiting for building digitalSTROM model."); break; case SceneHandler.NO_SCENE: logger.error("No Scene-ID is set!"); break; case SceneHandler.NO_BRIDGE: logger.error("No related bridge found!"); default: return new ThingUID(thingTypeUID, bridgeUID, sceneID); } } return thingUID; }</code><technical_language>early return again? This indent code of method enlarge diff..</technical_language>

Target:
private ThingUID getSceneUID(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID) { if (thingUID != null) { return thingUID; } String sceneID = SceneHandler.getSceneID(configuration, bridgeHandlers.get(bridgeUID)); switch (sceneID) { case SceneHandler.SCENE_WRONG: logger.error( "Configured scene '{}' does not exist or can not be used, please check your configuration.", configuration.get(DigitalSTROMBindingConstants.SCENE_ID)); break; case SceneHandler.ZONE_WRONG: logger.error("Configured zone '{}' does not exist, please check your configuration.", configuration.get(DigitalSTROMBindingConstants.ZONE_ID)); break; case SceneHandler.GROUP_WRONG: logger.error("Configured group '{}' does not exist, please check your configuration.", configuration.get(DigitalSTROMBindingConstants.GROUP_ID)); break; case SceneHandler.NO_STRUC_MAN: logger.error("Waiting for building digitalSTROM model."); break; case SceneHandler.NO_SCENE: logger.error("No Scene-ID is set!"); break; case SceneHandler.NO_BRIDGE: logger.error("No related bridge found!"); default: return new ThingUID(thingTypeUID, bridgeUID, sceneID); } return thingUID; }
Source:
<code>static void updateFromSession(final HttpSession session) { final String json = (String) session.getAttribute(LOGGED_USER_AUTHENTICATION_CONTEXT_ATTRIBUTE); <START> final AuthenticationContext authenticationContext = AuthenticationContext.importFromJson(json); <END> final User user = authenticationContext.getUser(); if (user != null && FenixFramework.isDomainObjectValid(user)) { loggedUserContext.set(authenticationContext); } else { clear(); } }</code><technical_language>retrieve AuthenticationContext object</technical_language>

Target:
static void updateFromSession(final HttpSession session) { if (session != null) { final AuthenticationContext authenticationContext = (AuthenticationContext) session.getAttribute(LOGGED_USER_AUTHENTICATION_CONTEXT_ATTRIBUTE); if (authenticationContext != null) { final User user = authenticationContext.getUser(); if (user != null && FenixFramework.isDomainObjectValid(user)) { loggedUserContext.set(authenticationContext); } else { clear(); } } } }
Source:
<code>public Azure azure(AzureTokenCredentials credentials, AzureProperties azureProperties) throws IOException { RestClient restClient = new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials).withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()).withUserAgent(SPRING_CLOUD_USER_AGENT) .build(); if (azureProperties.getSubscriptionId() == null) { return Azure.authenticate(restClient, credentials.domain()) .withSubscription(credentials.defaultSubscriptionId()); } else { return Azure.authenticate(restClient, credentials.domain()) <START> .withSubscription(azureProperties.getSubscriptionId()); <END> } }</code><technical_language>I prefer code: String subscriptionId = Optional.of(azureProperties) .map(AzureProperties::getSubscriptionId) .orElseGet(credentials::defaultSubscriptionId); return Azure.authenticate(restClient, credentials.domain()) .withSubscription(subscriptionId);</technical_language>

Target:
public Azure azure(AzureTokenCredentials credentials, AzureProperties azureProperties) throws IOException { RestClient restClient = new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials).withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()).withUserAgent(SPRING_CLOUD_USER_AGENT) .build(); String subscriptionId = Optional.of(azureProperties.getSubscriptionId()) .orElseGet(credentials::defaultSubscriptionId); return Azure.authenticate(restClient, credentials.domain()) .withSubscription(subscriptionId); }
Source:
<code>private List getListOfMirrors() { try { <START> Configuration config = new PropertiesConfiguration("src/main/resources/config.properties"); <END> List mirrorList = config.getList("mirror1"); return mirrorList; } catch (ConfigurationException e1) { return new ArrayList<String>(); } }</code><technical_language>This work a runtime-system</technical_language>

Target:
private List<String> getListOfMirrors() { Properties prop = new Properties(); List<String> mirrorList = new ArrayList<String>(); try { prop.load(ClassLoader.getSystemResourceAsStream("config.properties")); int i = 1; while (prop.getProperty("mirror" + i) != null) { mirrorList.add(prop.getProperty("mirror" + i)); i++; } } catch (IOException e) { } return mirrorList; }
Source:
<code>public HttpPanelSender(HttpPanelRequest requestPanel, HttpPanelResponse responsePanel) { this.responsePanel = responsePanel; requestPanel.addOptions( getButtonUseTrackingSessionState(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); requestPanel.addOptions(getButtonUseCookies(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); requestPanel.addOptions( getButtonFollowRedirects(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); <START> requestPanel.addOptions(getButtonUseCsrf(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); <END> final boolean isSessionTrackingEnabled = Model.getSingleton().getOptionsParam().getConnectionParam().isHttpStateEnabled(); getButtonUseTrackingSessionState().setEnabled(isSessionTrackingEnabled); }</code><technical_language>add extension is enabled</technical_language>

Target:
public HttpPanelSender(HttpPanelRequest requestPanel, HttpPanelResponse responsePanel) { this.responsePanel = responsePanel; extAntiCSRF = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAntiCSRF.class); requestPanel.addOptions( getButtonUseTrackingSessionState(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); requestPanel.addOptions(getButtonUseCookies(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); requestPanel.addOptions( getButtonFollowRedirects(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); if (extAntiCSRF != null) { requestPanel.addOptions(getButtonUseCsrf(), HttpPanel.OptionsLocation.AFTER_COMPONENTS); } final boolean isSessionTrackingEnabled = Model.getSingleton().getOptionsParam().getConnectionParam().isHttpStateEnabled(); getButtonUseTrackingSessionState().setEnabled(isSessionTrackingEnabled); }
Source:
<code>void initTableButtons() { getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.addDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getNewCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.removeDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getRemoveCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.moveDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getMoveCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.copyDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getCopyCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.getDiskAlignment(), CommandLocation.OnlyFromContext) { @Override protected UICommand resolveCommand() { return getMainModel().getScanAlignmentCommand(); } }); <START> getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.uploadDisk()) { <END> @Override protected UICommand resolveCommand() { return getMainModel().getUploadCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.assignQuota()) { @Override protected UICommand resolveCommand() { return getMainModel().getChangeQuotaCommand(); } }); }</code><technical_language>sure, expose this command 'OnlyFromContext'</technical_language>

Target:
void initTableButtons() { getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.addDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getNewCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.removeDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getRemoveCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.moveDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getMoveCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.copyDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getCopyCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.getDiskAlignment(), CommandLocation.OnlyFromContext) { @Override protected UICommand resolveCommand() { return getMainModel().getScanAlignmentCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.exportDisk()) { @Override protected UICommand resolveCommand() { return getMainModel().getExportCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Disk>(constants.assignQuota()) { @Override protected UICommand resolveCommand() { return getMainModel().getChangeQuotaCommand(); } }); }
Source:
<code>public void writeMergeHeads(List<ObjectId> heads) throws IOException { File mergeHeadFile = new File(gitDir, Constants.MERGE_HEAD); if (heads != null) { FileOutputStream fos = new FileOutputStream(mergeHeadFile); try { boolean first = true; for (ObjectId id : heads) { if (first) first = false; else <START> fos.write(10); <END> fos.write(id.name().getBytes(Constants.CHARACTER_ENCODING)); } } finally { fos.close(); } } else { mergeHeadFile.delete(); } }</code><technical_language>Please spell '\n' '\n'</technical_language>

Target:
public void writeMergeHeads(List<ObjectId> heads) throws IOException { File mergeHeadFile = new File(gitDir, Constants.MERGE_HEAD); if (heads != null) { BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream(mergeHeadFile)); try { for (ObjectId id : heads) { id.copyTo(bos); bos.write('\n'); } } finally { bos.close(); } } else { mergeHeadFile.delete(); } }
Source:
<code>public static CLProgram getProgram(String name) { if (programs.containsKey(name)) { return programs.get(name); } else { if (openCLDir.exists() && openCLDir.isDirectory()) { File file = new File(openCLDir, name); if (file.exists()) { try (InputStream input = new FileInputStream(file)) { CLProgram program = context.createProgram(input).build(); programs.put(name, program); return program; } catch (IOException ex) { GlowServer.logger.log(Level.WARNING, <START> "Could not load custom OpenCL program. Trying builtins.", ex); <END> } } else { try (InputStream input = CLASS_LOADER .getResourceAsStream("builtin/opencl/" + name)) { CLProgram program = context.createProgram(input).build(); programs.put(name, program); return program; } catch (IOException ex) { GlowServer.logger.log(Level.WARNING, "Could not load builtin OpenCL program.", ex); } } } } return null; }</code><technical_language>remove "Trying builtins" part, false</technical_language>

Target:
public static CLProgram getProgram(String name) { if (programs.containsKey(name)) { return programs.get(name); } else { if (openCLDir.exists() && openCLDir.isDirectory()) { File file = new File(openCLDir, name); if (file.exists()) { try (InputStream input = new FileInputStream(file)) { CLProgram program = context.createProgram(input).build(); programs.put(name, program); return program; } catch (IOException ex) { GlowServer.logger.log(Level.WARNING, "Could not load custom OpenCL program.", ex); } } else { try (InputStream input = CLASS_LOADER .getResourceAsStream("builtin/opencl/" + name)) { CLProgram program = context.createProgram(input).build(); programs.put(name, program); return program; } catch (IOException ex) { GlowServer.logger.log(Level.WARNING, "Could not load builtin OpenCL program.", ex); } } } } return null; }
Source:
<code>private void startTask(String timestampColumn, String incrementingColumn, String query, Long delay) { String mode = null; if (timestampColumn != null && incrementingColumn != null) { mode = JdbcSourceConnectorConfig.MODE_TIMESTAMP_INCREMENTING; } else if (timestampColumn != null) { mode = JdbcSourceConnectorConfig.MODE_TIMESTAMP; } else if (incrementingColumn != null) { mode = JdbcSourceConnectorConfig.MODE_INCREMENTING; } else { mode = JdbcSourceConnectorConfig.MODE_BULK; } initializeTask(); Map<String, String> taskConfig = singleTableConfig(); taskConfig.put(JdbcSourceConnectorConfig.MODE_CONFIG, mode); if (query != null) { taskConfig.put(JdbcSourceTaskConfig.QUERY_CONFIG, query); taskConfig.put(JdbcSourceTaskConfig.TABLES_CONFIG, ""); } if (timestampColumn != null) { taskConfig.put(JdbcSourceConnectorConfig.TIMESTAMP_COLUMN_NAME_CONFIG, timestampColumn); } if (incrementingColumn != null) { taskConfig.put(JdbcSourceConnectorConfig.INCREMENTING_COLUMN_NAME_CONFIG, incrementingColumn); } <START> taskConfig.put(JdbcSourceConnectorConfig.TIMESTAMP_DELAY_INTERVAL_MS_CONFIG, delay.toString()); <END> task.start(taskConfig); }</code><technical_language>check delay!= null calling toString()</technical_language>

Target:
private void startTask(String timestampColumn, String incrementingColumn, String query, Long delay) { String mode = null; if (timestampColumn != null && incrementingColumn != null) { mode = JdbcSourceConnectorConfig.MODE_TIMESTAMP_INCREMENTING; } else if (timestampColumn != null) { mode = JdbcSourceConnectorConfig.MODE_TIMESTAMP; } else if (incrementingColumn != null) { mode = JdbcSourceConnectorConfig.MODE_INCREMENTING; } else { mode = JdbcSourceConnectorConfig.MODE_BULK; } initializeTask(); Map<String, String> taskConfig = singleTableConfig(); taskConfig.put(JdbcSourceConnectorConfig.MODE_CONFIG, mode); if (query != null) { taskConfig.put(JdbcSourceTaskConfig.QUERY_CONFIG, query); taskConfig.put(JdbcSourceTaskConfig.TABLES_CONFIG, ""); } if (timestampColumn != null) { taskConfig.put(JdbcSourceConnectorConfig.TIMESTAMP_COLUMN_NAME_CONFIG, timestampColumn); } if (incrementingColumn != null) { taskConfig.put(JdbcSourceConnectorConfig.INCREMENTING_COLUMN_NAME_CONFIG, incrementingColumn); } taskConfig.put(JdbcSourceConnectorConfig.TIMESTAMP_DELAY_INTERVAL_MS_CONFIG, delay == null ? "0" : delay.toString()); task.start(taskConfig); }
Source:
<code>private Map<String, Map<String, RuntimeAndCompileTimeVersions>> getRuntimeInfo() { Map<String, RuntimeAndCompileTimeVersions> coreDeps = fetchDependenciesFromFile( this.getClass().getResourceAsStream("/com/datastax/dse/driver/internal/deps.txt")); Map<String, RuntimeAndCompileTimeVersions> queryBuilderDeps = fetchDependenciesFromFile( this.getClass() .getResourceAsStream("/com/datastax/dse/driver/internal/querybuilder/deps.txt")); Map<String, RuntimeAndCompileTimeVersions> mapperProcessorDeps = fetchDependenciesFromFile( this.getClass() .getResourceAsStream( "/com/datastax/oss/driver/internal/mapper/processor/deps.txt")); Map<String, RuntimeAndCompileTimeVersions> mapperRuntimeDeps = fetchDependenciesFromFile( this.getClass() .getResourceAsStream("/com/datastax/oss/driver/internal/mapper/deps.txt")); Map<String, Map<String, RuntimeAndCompileTimeVersions>> runtimeDependencies = new LinkedHashMap<>(); putIfNonEmpty(coreDeps, runtimeDependencies, "core"); putIfNonEmpty(queryBuilderDeps, runtimeDependencies, "query-builder"); <START> putIfNonEmpty(mapperProcessorDeps, runtimeDependencies, "mapper-processor"); <END> putIfNonEmpty(mapperRuntimeDeps, runtimeDependencies, "mapper-runtime"); addJavaVersion(runtimeDependencies); return runtimeDependencies; }</code><technical_language>Thanks for addressing this - validate dependencies generated picked insight client</technical_language>

Target:
private Map<String, Map<String, RuntimeAndCompileTimeVersions>> getRuntimeInfo() { Map<String, RuntimeAndCompileTimeVersions> coreDeps = fetchDependenciesFromFile( this.getClass().getResourceAsStream("/com/datastax/dse/driver/internal/deps.txt")); Map<String, RuntimeAndCompileTimeVersions> queryBuilderDeps = fetchDependenciesFromFile( this.getClass() .getResourceAsStream("/com/datastax/dse/driver/internal/querybuilder/deps.txt")); Map<String, RuntimeAndCompileTimeVersions> mapperProcessorDeps = fetchDependenciesFromFile( this.getClass() .getResourceAsStream( "/com/datastax/dse/driver/internal/mapper/processor/deps.txt")); Map<String, RuntimeAndCompileTimeVersions> mapperRuntimeDeps = fetchDependenciesFromFile( this.getClass() .getResourceAsStream("/com/datastax/dse/driver/internal/mapper/deps.txt")); Map<String, Map<String, RuntimeAndCompileTimeVersions>> runtimeDependencies = new LinkedHashMap<>(); putIfNonEmpty(coreDeps, runtimeDependencies, "core"); putIfNonEmpty(queryBuilderDeps, runtimeDependencies, "query-builder"); putIfNonEmpty(mapperProcessorDeps, runtimeDependencies, "mapper-processor"); putIfNonEmpty(mapperRuntimeDeps, runtimeDependencies, "mapper-runtime"); addJavaVersion(runtimeDependencies); return runtimeDependencies; }
Source:
<code>public final Subscription subscribe(final Action0 onComplete) { requireNonNull(onComplete); final MultipleAssignmentSubscription mad = new MultipleAssignmentSubscription(); subscribe(new CompletableSubscriber() { @Override public void onCompleted() { <START> mad.unsubscribe(); <END> try { onComplete.call(); } catch (Throwable e) { ERROR_HANDLER.handleError(e); } } @Override public void onError(Throwable e) { mad.unsubscribe(); ERROR_HANDLER.handleError(e); } @Override public void onSubscribe(Subscription d) { mad.set(d); } }); return mad; }</code><technical_language>This called onComplete.call()</technical_language>

Target:
public final Subscription subscribe(final Action0 onComplete) { requireNonNull(onComplete); final MultipleAssignmentSubscription mad = new MultipleAssignmentSubscription(); subscribe(new CompletableSubscriber() { @Override public void onCompleted() { try { onComplete.call(); } catch (Throwable e) { ERROR_HANDLER.handleError(e); } mad.unsubscribe(); } @Override public void onError(Throwable e) { ERROR_HANDLER.handleError(e); mad.unsubscribe(); } @Override public void onSubscribe(Subscription d) { mad.set(d); } }); return mad; }