auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> generatesFiles(JavaFileObject first, JavaFileObject... rest) { <END> CompilationResult result = compile(getSubject()); if (result.successful()) { List<JavaFileObject> expectedList = Lists.newArrayList(Lists.asList(first, rest)); Iterator<JavaFileObject> expectedIterator = expectedList.iterator(); while (expectedIterator.hasNext()) { if (wasGenerated(result, expectedIterator.next())) { expectedIterator.remove(); } } if (!expectedList.isEmpty()) { failureStrategy.fail("Failed to find some files: " + expectedList); } } else { System.out.println(result.diagnosticsByKind); failureStrategy.fail("Failed with some errors: " + result.output); } return result.diagnosticsByKind; }</code><technical_language>sweet</technical_language>

Target:
generatesFiles(JavaFileObject first, JavaFileObject... rest) { CompilationResult result = compile(getSubject()); if (result.successful()) { List<JavaFileObject> expectedList = Lists.newArrayList(Lists.asList(first, rest)); Iterator<JavaFileObject> expectedIterator = expectedList.iterator(); while (expectedIterator.hasNext()) { if (wasGenerated(result, expectedIterator.next())) { expectedIterator.remove(); } } if (!expectedList.isEmpty()) { failureStrategy.fail("Failed to find some files: " + expectedList); } } else { failureStrategy.fail("Failed with some errors: " + result.output); } return result.diagnosticsByKind; }
Source:
<code>public static TestingMySqlServer setupMySql() throws Exception { TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", ImmutableList.of(XDB), MY_SQL_OPTIONS); try (Handle handle = getJdbi(mySqlServer).open()) { <START> handle.execute("CREATE TABLE benchmark_suites (\n" + " id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n" + " suite varchar(256) NOT NULL,\n" + " query_set varchar(256) NOT NULL,\n" + " phases mediumtext NOT NULL,\n" + " session_properties mediumtext NOT NULL,\n" + " created_by varchar(256) NOT NULL,\n" + " create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + " update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" + " PRIMARY KEY (id),\n" + " UNIQUE KEY suite (suite))"); handle.execute("CREATE TABLE benchmark_queries (\n" + " id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n" + " query_set varchar(256) NOT NULL,\n" + " name varchar(256) NOT NULL,\n" + " catalog varchar(256) NOT NULL,\n" + " benchmark_schema varchar(256) NOT NULL,\n" + " query mediumtext NOT NULL,\n" + " create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + " update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" + " PRIMARY KEY (id),\n" + " UNIQUE KEY query_set_name (query_set,name))"); <END> } return mySqlServer; }</code><technical_language>mentioned above, move BenchmarkSuiteDao</technical_language>

Target:
public static TestingMySqlServer setupMySql() throws Exception { TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", ImmutableList.of(XDB)); Handle handle = getJdbi(mySqlServer).open(); BenchmarkSuiteDao benchmarkDao = handle.attach(BenchmarkSuiteDao.class); benchmarkDao.createBenchmarkSuitesTable("benchmark_suites"); benchmarkDao.createBenchmarkQueriesTable("benchmark_queries"); return mySqlServer; }
Source:
<code>public ReplicationPolicy getSystemReplicationPolicy() { <START> DatabaseAccount databaseAccount = this.globalEndpointManager.getDatabaseAccountFromCache(this.serviceEndpoint).block(); <END> return BridgeInternal.getSystemReplicationPolicy(databaseAccount); }</code><technical_language>blocking calls SDK good. deadlock, perf hit, etc. blocking calls else</technical_language>

Target:
public Mono<ReplicationPolicy> getSystemReplicationPolicy() { return this.globalEndpointManager.getDatabaseAccountFromCache(this.serviceEndpoint).map(databaseAccount -> BridgeInternal.getSystemReplicationPolicy(databaseAccount)); }
Source:
<code>private Cursor makeEmojiCursor(CharSequence emoji) throws SQLException { if (emoji == null) { emoji = ""; } return ((AndroidDatabaseResults) app .getDao(Emoji.class) <START> .queryRaw("SELECT rowid _id,* FROM emoji WHERE name LIKE '%" + emoji + "%'") <END> .closeableIterator().getRawResults()).getRawCursor(); }</code><technical_language>practice name fields expecting return, instead of * glob pattern</technical_language>

Target:
private Cursor makeEmojiCursor(CharSequence emoji) throws SQLException { if (emoji == null) { emoji = ""; } return ((AndroidDatabaseResults) app .getDao(Emoji.class) .queryRaw("SELECT rowid _id,name FROM emoji WHERE name LIKE '%" + emoji + "%'") .closeableIterator().getRawResults()).getRawCursor(); }
Source:
<code>public void deactivate(ComponentContext context) { <START> super.deactivate(context); <END> subscribers.clear(); provider.close(); provider = null; }</code><technical_language>for super.deactivate, call last</technical_language>

Target:
public void deactivate(ComponentContext context) { subscribers.clear(); provider.close(); provider = null; super.deactivate(context); }
Source:
<code>private void removeFromCache(String path) { if (isSubscription(path)) { <START> subscriptionConstraintsCache.remove(SubscriptionName.fromString(paths.extractChildNode(path, "/hermes/consumers-workload-constraints"))); <END> } else { topicConstraintsCache.remove(TopicName.fromQualifiedName(paths.extractChildNode(path, "/hermes/consumers-workload-constraints"))); } }</code><technical_language>paths.consumersWorkloadConstraintsPath()</technical_language>

Target:
private void removeFromCache(String path) { if (isSubscription(path)) { subscriptionConstraintsCache.remove( SubscriptionName.fromString(paths.extractChildNode(path, paths.consumersWorkloadConstraintsPath()))); } else { topicConstraintsCache.remove( TopicName.fromQualifiedName(paths.extractChildNode(path, paths.consumersWorkloadConstraintsPath()))); } }
Source:
<code>public String toString() { return "DataSchema{" + "dataSource='" + dataSource + '\'' + ", aggregators=" + Arrays.toString(aggregators) + ", granularitySpec=" + granularitySpec + ", transformSpec=" + transformSpec + <START> (parserMap == null ? "" : ", parserMap=" + parserMap) + <END> ", timestampSpec=" + timestampSpec + ", dimensionsSpec=" + dimensionsSpec + '}'; }</code><technical_language>print parserMap=null if null</technical_language>

Target:
public String toString() { return "DataSchema{" + "dataSource='" + dataSource + '\'' + ", aggregators=" + Arrays.toString(aggregators) + ", granularitySpec=" + granularitySpec + ", transformSpec=" + transformSpec + ", parserMap=" + parserMap + ", timestampSpec=" + timestampSpec + ", dimensionsSpec=" + dimensionsSpec + ", inputRowParser=" + inputRowParser + '}'; }
Source:
<code>public Pair<ExecutionStatus, T> execute(Supplier<T> callable) { Callable<T> task = callable::get; final long startTime = System.currentTimeMillis(); Future<T> futureObject = executor.submit(() -> { xrayUtils.beginSegment(); long totalWaitTime = System.currentTimeMillis() - startTime; logger.debug("Card operation task spent ms in queue", totalWaitTime); if (totalWaitTime > QUEUE_WAIT_WARN_THRESHOLD_MILLIS) { logger.warn("CardExecutor Service delay - queue_wait_time={}", totalWaitTime); } metricRegistry.histogram("card-executor.delay").update(totalWaitTime); try { return task.call(); } finally { xrayUtils.endSegment(); } }); try { return Pair.of(COMPLETED, futureObject.get(config.getTimeoutInSeconds(), TimeUnit.SECONDS)); } catch (ExecutionException | InterruptedException exception) { <START> Throwable cause = exception.getCause(); <END> if (cause instanceof WebApplicationException) { throw (WebApplicationException) cause; } return Pair.of(FAILED, null); } catch (TimeoutException timeoutException) { return Pair.of(IN_PROGRESS, null); } }</code><technical_language>Huh?!?!? wrong before? (Well, logic is a bit weird is fault do need extract out a local variable first?)</technical_language>

Target:
public Pair<ExecutionStatus, T> execute(Supplier<T> callable) { Callable<T> task = callable::get; final long startTime = System.currentTimeMillis(); Future<T> futureObject = executor.submit(() -> { xrayUtils.beginSegment(); long totalWaitTime = System.currentTimeMillis() - startTime; logger.debug("Card operation task spent ms in queue", totalWaitTime); if (totalWaitTime > QUEUE_WAIT_WARN_THRESHOLD_MILLIS) { logger.warn("CardExecutor Service delay - queue_wait_time={}", totalWaitTime); } metricRegistry.histogram("card-executor.delay").update(totalWaitTime); try { return task.call(); } finally { xrayUtils.endSegment(); } }); try { return Pair.of(COMPLETED, futureObject.get(config.getTimeoutInSeconds(), TimeUnit.SECONDS)); } catch (ExecutionException | InterruptedException exception) { if (exception.getCause() instanceof WebApplicationException) { throw (WebApplicationException) exception.getCause(); } return Pair.of(FAILED, null); } catch (TimeoutException timeoutException) { return Pair.of(IN_PROGRESS, null); } }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); sourceConfig.validate(collector); Class<? extends Driver> driverClass = dbManager.validateJDBCPluginPipeline(pipelineConfigurer, getJDBCPluginId(), collector); Schema configuredSchema = sourceConfig.getSchema(collector); <START> if (configuredSchema != null) { <END> pipelineConfigurer.getStageConfigurer().setOutputSchema(sourceConfig.getSchema(collector)); } else if (sourceConfig.query != null) { try { pipelineConfigurer.getStageConfigurer().setOutputSchema(getSchema(driverClass)); } catch (IllegalAccessException | InstantiationException e) { throw new InvalidStageException("Unable to instantiate JDBC driver: " + e.getMessage(), e); } catch (SQLException e) { throw new IllegalArgumentException("SQL error while getting query schema: " + e.getMessage(), e); } } }</code><technical_language>super.configurePipeline throw IllegalArgumentException in case reference name is invalid. catch add collector</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); sourceConfig.validate(collector); Class<? extends Driver> driverClass = dbManager.validateJDBCPluginPipeline(pipelineConfigurer, getJDBCPluginId(), collector); collector.getOrThrowException(); Schema configuredSchema = sourceConfig.getSchema(collector); if (configuredSchema != null) { pipelineConfigurer.getStageConfigurer().setOutputSchema(configuredSchema); } else if (!sourceConfig.containsMacro(DBSourceConfig.IMPORT_QUERY)) { try { pipelineConfigurer.getStageConfigurer().setOutputSchema(getSchema(driverClass)); } catch (IllegalAccessException | InstantiationException e) { collector.addFailure(String.format("Failed to instantiate JDBC driver: %s", e.getMessage()), null); } catch (SQLException e) { collector.addFailure( String.format("Encountered SQL error while getting query schema: %s", e.getMessage()), null); } } }
Source:
<code>private synchronized void scheduleDriversForSplitLifeCycle(List<TaskSource> sources) { checkArgument(sources.stream().allMatch(TaskSource::isNoMoreSplits), "All task sources are expected to be final"); <START> Map<PlanNodeId, List<ScheduledSplit>> splits = sources.stream() <END> .collect(groupingBy( TaskSource::getPlanNodeId, collectingAndThen( mapping(TaskSource::getSplits, toImmutableList()), s -> s.stream().flatMap(Set::stream).collect(toImmutableList())))); for (PlanNodeId planNodeId : schedulingOrder) { DriverSplitRunnerFactory driverSplitRunnerFactory = driverRunnerFactoriesWithSplitLifeCycle.get(planNodeId); List<ScheduledSplit> planNodeSplits = splits.getOrDefault(planNodeId, ImmutableList.of()); scheduleTableScanSource(driverSplitRunnerFactory, planNodeSplits); } }</code><technical_language>I thinking if sense write imperative for-loop here? -- general preference is Stream API is in a complicated way, more difficult understand good for-loop. a personal taste</technical_language>

Target:
private synchronized void scheduleDriversForSplitLifeCycle(List<TaskSource> sources) { checkArgument(sources.stream().allMatch(TaskSource::isNoMoreSplits), "All task sources are expected to be final"); ListMultimap<PlanNodeId, ScheduledSplit> splits = ArrayListMultimap.create(); for (TaskSource taskSource : sources) { splits.putAll(taskSource.getPlanNodeId(), taskSource.getSplits()); } for (PlanNodeId planNodeId : schedulingOrder) { DriverSplitRunnerFactory driverSplitRunnerFactory = driverRunnerFactoriesWithSplitLifeCycle.get(planNodeId); List<ScheduledSplit> planNodeSplits = splits.get(planNodeId); scheduleTableScanSource(driverSplitRunnerFactory, planNodeSplits); } }
Source:
<code>public ServerInfo getServer(UUID uuid) { if(playerServerCache.containsKey(uuid)){ return playerServerCache.get(uuid); } if (!db.isConnected()) db.connect(); PreparedStatement getServer = db.prepareStatement(this.getServer); try { getServer.setString(1, uuid.toString()); ResultSet set = getServer.executeQuery(); if (!set.next()) return null; <START> return ProxyServer.getInstance().getServerInfo(set.getString(1)); <END> } catch (SQLException e) { e.printStackTrace(); } return null; }</code><technical_language>reason drop cache returning it? this method is "cache-optimized" re-entry -- cache miss leads lookup leads cache save</technical_language>

Target:
public ServerInfo getServer(UUID uuid) { if(playerServerCache.containsKey(uuid)){ return playerServerCache.get(uuid); } if (!db.isConnected()) db.connect(); PreparedStatement getServer = db.prepareStatement(this.getServer); try { getServer.setString(1, uuid.toString()); ResultSet set = getServer.executeQuery(); if (!set.next()) return null; ServerInfo server = ProxyServer.getInstance().getServerInfo(set.getString(1)); playerServerCache.put(uuid, server); return server; } catch (SQLException e) { e.printStackTrace(); } return null; }
Source:
<code>private void readBounds(BufferedReader reader, MD5 md5) throws IOException { md5.bounds = new AABB[md5.numFrames]; for (int i = 0; i < md5.numFrames; ++i) { String line = MD5ParserCommon.readNextLine(reader); Matcher matcher = doubleVectorPattern.matcher(line); if (!matcher.find()) { throw new IOException("Invalid bounds line: \"" + line + "\""); } Vector3f a = MD5ParserCommon.readVector3fAndCorrect(matcher.group(1), matcher.group(2), matcher.group(3)); Vector3f b = MD5ParserCommon.readVector3fAndCorrect(matcher.group(4), matcher.group(5), matcher.group(6)); Vector3f min = new Vector3f(); min.x = Math.min(a.x, b.x); min.y = Math.min(a.y, b.y); min.z = Math.min(a.z, b.z); Vector3f max = new Vector3f(); max.x = Math.max(a.x, b.x); max.y = Math.max(a.y, b.y); max.z = Math.max(a.z, b.z); <START> md5.bounds[i] = AABB.createMinMax(JomlUtil.from(min), JomlUtil.from(max)); <END> } }</code><technical_language>lines simplified joml methods: Vector3f min = new Vector3f(a).min(b); Vector3f max = new Vector3f(a).max(b);</technical_language>

Target:
private void readBounds(BufferedReader reader, MD5 md5) throws IOException { md5.bounds = new AABB[md5.numFrames]; for (int i = 0; i < md5.numFrames; ++i) { String line = MD5ParserCommon.readNextLine(reader); Matcher matcher = doubleVectorPattern.matcher(line); if (!matcher.find()) { throw new IOException("Invalid bounds line: \"" + line + "\""); } Vector3f a = MD5ParserCommon.readVector3fAndCorrect(matcher.group(1), matcher.group(2), matcher.group(3)); Vector3f b = MD5ParserCommon.readVector3fAndCorrect(matcher.group(4), matcher.group(5), matcher.group(6)); Vector3f min = new Vector3f(a).min(b); Vector3f max = new Vector3f(a).max(b); md5.bounds[i] = AABB.createMinMax(JomlUtil.from(min), JomlUtil.from(max)); } }
Source:
<code>public void test_isFocusControl() throws InterruptedException { assertFalse(control.isFocusControl()); shell.open(); processEvents(5000, () -> shell.getDisplay().getActiveShell() == shell); <START> assertEquals("Unexpected focus", control.forceFocus(), control.isFocusControl()); <END> }</code><technical_language>shell.getDisplay().getActiveShell() yields null. a check assertEquals(shell.getDisplay(), Display.getCurrent()); assertEquals(shell, shell.getDisplay().getActiveShell()); sense test succeeds test class is executed alone, fails wheen is executed AllWidgetsTests suite</technical_language>

Target:
public void test_isFocusControl() { assertFalse(control.isFocusControl()); shell.open(); if (SwtTestUtil.isGTK) { shell.forceActive(); } assertEquals(shell, shell.getDisplay().getActiveShell()); assertEquals("Unexpected focus", control.forceFocus(), control.isFocusControl()); }
Source:
<code>public void onReceive(Context context, Intent intent) { int command = PeriodicReplicationService.COMMAND_NONE; <START> if (ALARM_ACTION.equals(intent.getAction())) { <END> command = PeriodicReplicationService.COMMAND_START_REPLICATION; } else if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_DEVICE_REBOOTED; } if (command != PeriodicReplicationService.COMMAND_NONE) { Intent serviceIntent = new Intent(context.getApplicationContext(), clazz); serviceIntent.putExtra(PeriodicReplicationService.EXTRA_COMMAND, command); startWakefulService(context, serviceIntent); } }</code><technical_language>Do is worth intent != null check here? unclear framework filters protect receiving a null intent</technical_language>

Target:
public void onReceive(Context context, Intent intent) { if (intent != null) { int command = PeriodicReplicationService.COMMAND_NONE; if (ALARM_ACTION.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_START_REPLICATION; } else if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_DEVICE_REBOOTED; } if (command != PeriodicReplicationService.COMMAND_NONE) { Intent serviceIntent = new Intent(context.getApplicationContext(), clazz); serviceIntent.putExtra(PeriodicReplicationService.EXTRA_COMMAND, command); startWakefulService(context, serviceIntent); } } }
Source:
<code>public Maven(String targets,String name, String pom, String properties, String jvmOptions, boolean usePrivateRepository, SettingsProvider settings, GlobalSettingsProvider globalSettings) { <START> this(targets, name, pom, properties, jvmOptions, usePrivateRepository, settings, globalSettings, true); <END> }</code><technical_language>@deprecated a DataBoundSetter suggested @KostyaSha</technical_language>

Target:
public Maven(String targets,String name, String pom, String properties, String jvmOptions, boolean usePrivateRepository, SettingsProvider settings, GlobalSettingsProvider globalSettings) { this(targets, name, pom, properties, jvmOptions, usePrivateRepository, settings, globalSettings, false); }
Source:
<code>public List<String> doSearchAutocomplete(String searchString) { String url = "<LINK_0>"; String requestJson = "{ \"query\": { \"match\": { \"name\": { \"query\": \""+searchString+"\", \"analyzer\": \"standard\" } } } };"; try { log.info("Creating autocomplete search url with url:", url); HttpURLConnection conn = IOHelper.getConnection(url); <START> String userpass = "asdiuser:3sto9AHT"; <END> String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes()); conn.setRequestProperty ("Authorization", basicAuth); IOHelper.writeToConnection(conn, requestJson); String result = IOHelper.readString(conn); JSONObject jsonObject = new JSONObject(result); JSONArray jsonHitsArray = jsonObject.getJSONObject("hits").getJSONArray("hits"); List<String> resultList = new ArrayList<>(); for (int i = 0; i < jsonHitsArray.length(); ++i ) { String resultName = jsonHitsArray.getJSONObject(i).getJSONObject("_source").getString("name"); resultList.add(resultName); } return resultList; } catch (Exception ex) { log.error("Couldn't open or read from connection for search channel!"); throw new RuntimeException("Couldn't open or read from connection!", ex); } }</code><technical_language>FYI, credentials disabled. In future DO commit credentials TODO properties. git history fix this</technical_language>

Target:
public List<String> doSearchAutocomplete(String searchString) { if(PROPERTY_AUTOCOMPLETE_URL == null || PROPERTY_AUTOCOMPLETE_URL.isEmpty()) { return Collections.emptyList(); } String requestJson = "{ \"query\": { \"match\": { \"name\": { \"query\": \""+searchString+"\", \"analyzer\": \"standard\" } } } };"; try { log.info("Creating autocomplete search url with url:", PROPERTY_AUTOCOMPLETE_URL); HttpURLConnection conn = IOHelper.getConnection(PROPERTY_AUTOCOMPLETE_URL, PROPERTY_AUTOCOMPLETE_USERNAME, PROPERTY_AUTOCOMPLETE_PASSWORD); IOHelper.writeToConnection(conn, requestJson); String result = IOHelper.readString(conn); JSONObject jsonObject = new JSONObject(result); JSONArray jsonHitsArray = jsonObject.getJSONObject("hits").getJSONArray("hits"); List<String> resultList = new ArrayList<>(); for (int i = 0; i < jsonHitsArray.length(); ++i ) { String resultName = jsonHitsArray.getJSONObject(i).getJSONObject("_source").getString("name"); resultList.add(resultName); } return resultList; } catch (Exception ex) { log.error("Couldn't open or read from connection for search channel!"); throw new RuntimeException("Couldn't open or read from connection!", ex); } }
Source:
<code>public static List<TableColumnState> backupTableColumns(ITable table) { ArrayList<TableColumnState> allColumns = new ArrayList<TableColumnState>(); ColumnSet columnSet = table.getColumnSet(); for (IColumn<?> c : columnSet.getAllColumnsInUserOrder()) { TableColumnState colState = new TableColumnState(); colState.setColumnClassName(c.getColumnId()); colState.setDisplayable(c.isDisplayable()); colState.setVisible(c.isDisplayable() && c.isVisible()); colState.setWidth(c.getWidth()); if (c instanceof INumberColumn) { colState.setAggregationFunction(((INumberColumn) c).getAggregationFunction()); <START> colState.setBackgroundEffect(((INumberColumn) c).getAggregationFunction()); <END> } if (columnSet.isUserSortColumn(c)) { int sortOrder = columnSet.getSortColumnIndex(c); if (sortOrder >= 0) { colState.setSortOrder(sortOrder); colState.setSortAscending(c.isSortAscending()); colState.setGroupingActive(c.isGroupingActive()); } else { colState.setSortOrder(-1); } } allColumns.add(colState); } return allColumns; }</code><technical_language>Background Effect, oder</technical_language>

Target:
public static List<TableColumnState> backupTableColumns(ITable table) { ArrayList<TableColumnState> allColumns = new ArrayList<TableColumnState>(); ColumnSet columnSet = table.getColumnSet(); for (IColumn<?> c : columnSet.getAllColumnsInUserOrder()) { TableColumnState colState = new TableColumnState(); colState.setColumnClassName(c.getColumnId()); colState.setDisplayable(c.isDisplayable()); colState.setVisible(c.isDisplayable() && c.isVisible()); colState.setWidth(c.getWidth()); if (c instanceof INumberColumn) { colState.setAggregationFunction(((INumberColumn) c).getAggregationFunction()); colState.setBackgroundEffect(((INumberColumn) c).getBackgroundEffect()); } if (columnSet.isUserSortColumn(c)) { int sortOrder = columnSet.getSortColumnIndex(c); if (sortOrder >= 0) { colState.setSortOrder(sortOrder); colState.setSortAscending(c.isSortAscending()); colState.setGroupingActive(c.isGroupingActive()); } else { colState.setSortOrder(-1); } } allColumns.add(colState); } return allColumns; }
Source:
<code>protected <T> void sendOrPub(OutboundDeliveryContext<T> sendContext) { if (((ClusteredMessage) sendContext.message).getRepliedTo() != null) { clusteredSendReply(((ClusteredMessage) sendContext.message).getRepliedTo(), sendContext); } else if (sendContext.options.isLocalOnly()) { super.sendOrPub(sendContext); } else { sendContext.ctx.succeededFuture(sendContext.message) .flatMap(deliveryStrategy::chooseNodes) <START> .onFailure(t -> { <END> if (log.isDebugEnabled()) { log.error("Failed to send message", t); } sendContext.written(t); }) .onSuccess(nodeList -> sendToNodes(nodeList, sendContext)); } }</code><technical_language>avoid usage of onFailure/onSuccess for efficiency purpose</technical_language>

Target:
protected <T> void sendOrPub(OutboundDeliveryContext<T> sendContext) { if (((ClusteredMessage) sendContext.message).getRepliedTo() != null) { clusteredSendReply(((ClusteredMessage) sendContext.message).getRepliedTo(), sendContext); } else if (sendContext.options.isLocalOnly()) { super.sendOrPub(sendContext); } else { Serializer serializer = Serializer.get(sendContext.ctx); if (sendContext.message.isSend()) { serializer.queue(sendContext, nodeSelector::selectForSend, this::sendToNode, this::sendOrPublishFailed); } else { serializer.queue(sendContext, nodeSelector::selectForPublish, this::sendToNodes, this::sendOrPublishFailed); } } }
Source:
<code>public void auditResponseMessage(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, Boolean isRequesting, Properties webContextProperties, String serviceName) { LOG.trace("--- Before auditing of response message ---"); <START> if (getAuditLogger() != null && isAuditLoggingOn(serviceName)) { <END> getAuditLogger().auditResponseMessage(request, response, assertion, target, direction, _interface, isRequesting, webContextProperties, serviceName, getAuditTransforms()); } LOG.trace("--- After auditing of response message ---"); }</code><technical_language>cases reverse? (i.e., instantiate logger audit logging is on)</technical_language>

Target:
public void auditResponseMessage(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, Boolean isRequesting, Properties webContextProperties, String serviceName) { LOG.trace("--- Before auditing of response message ---"); if (isAuditLoggingOn(serviceName) && getAuditLogger() != null) { getAuditLogger().auditResponseMessage(request, response, assertion, target, direction, _interface, isRequesting, webContextProperties, serviceName, getAuditTransforms()); } LOG.trace("--- After auditing of response message ---"); }
Source:
<code>public OrganizationEntity create(SchoolDataSource dataSource, String identifier, String name) { <START> OrganizationEntity roleSchoolDataIdentifier = new OrganizationEntity(); <END> roleSchoolDataIdentifier.setDataSource(dataSource); roleSchoolDataIdentifier.setIdentifier(identifier); roleSchoolDataIdentifier.setName(name); return persist(roleSchoolDataIdentifier); }</code><technical_language>Variable organizationEntity</technical_language>

Target:
public OrganizationEntity create(SchoolDataSource dataSource, String identifier, String name) { OrganizationEntity organizationEntity = new OrganizationEntity(); organizationEntity.setDataSource(dataSource); organizationEntity.setIdentifier(identifier); organizationEntity.setName(name); return persist(organizationEntity); }
Source:
<code>protected void executeCommand() { ConnectStorageServerVDSCommandParameters newConnectionParametersForVdsm = new ConnectStorageServerVDSCommandParameters(getParameters().getVdsId(), getParameters() .getStoragePoolId(), getParameters().getStorageServerConnection().getstorage_type(), new ArrayList<StorageServerConnections>(Arrays <START> .asList(getParameters().getStorageServerConnection()))); <END> VDSReturnValue returnValueConnect = runVdsCommand(VDSCommandType.ConnectStorageServer,newConnectionParametersForVdsm); if (returnValueConnect.getSucceeded()) { getDbFacade().getStorageServerConnectionDao().update(getParameters().getStorageServerConnection()); ConnectStorageServerVDSCommandParameters oldConnectionParametersForVdsm = new ConnectStorageServerVDSCommandParameters(getParameters().getVdsId(), getParameters() .getStoragePoolId(), oldConnection.getstorage_type(), new ArrayList<StorageServerConnections>(Arrays .asList(oldConnection))); runVdsCommand(VDSCommandType.DisconnectStorageServer,oldConnectionParametersForVdsm); setSucceeded(true); } }</code><technical_language>parhaps Collections.singletonList</technical_language>

Target:
protected void executeCommand() { boolean hasConnectStorageSucceeded = connectToStorage(); VDSReturnValue returnValueUpdatedStorageDomain = updateStatsForDomain(); if (hasConnectStorageSucceeded && returnValueUpdatedStorageDomain.getSucceeded()) { final StorageDomain updatedStorageDomain = (StorageDomain) returnValueUpdatedStorageDomain.getReturnValue(); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getStorageConnDao().update(getParameters().getStorageServerConnection()); getStorageDomainDynamicDao().update(updatedStorageDomain.getStorageDynamicData()); return null; } }); setSucceeded(true); } }
Source:
<code>private static CliOptions convertCliToPojo(CommandLine cmdLine, List<File> filesToProcess) { final CliOptions conf = new CliOptions(); conf.format = cmdLine.getOptionValue(OPTION_F_NAME); if (conf.format == null) { conf.format = PLAIN_FORMAT_NAME; } conf.outputLocation = cmdLine.getOptionValue(OPTION_O_NAME); conf.configLocation = cmdLine.getOptionValue(OPTION_C_NAME); conf.propertiesLocation = cmdLine.getOptionValue(OPTION_P_NAME); conf.files = filesToProcess; conf.executeIgnoredModules = cmdLine.hasOption(OPTION_EXECUTE_IGNORED_MODULES_NAME); <START> final String checkerThreadsNumber = cmdLine.getOptionValue(OPTION_CAPITAL_C_NAME); <END> if (checkerThreadsNumber == null) { conf.checkerThreadsNumber = 1; } else { conf.checkerThreadsNumber = Integer.parseInt(checkerThreadsNumber); } final String treeWalkerThreadsNumber = cmdLine.getOptionValue(OPTION_CAPITAL_W_NAME); if (treeWalkerThreadsNumber == null) { conf.treeWalkerThreadsNumber = 1; } else { conf.treeWalkerThreadsNumber = Integer.parseInt(treeWalkerThreadsNumber); } return conf; }</code><technical_language>This allows a default value. assign "1"</technical_language>

Target:
private static CliOptions convertCliToPojo(CommandLine cmdLine, List<File> filesToProcess) { final CliOptions conf = new CliOptions(); conf.format = cmdLine.getOptionValue(OPTION_F_NAME); if (conf.format == null) { conf.format = PLAIN_FORMAT_NAME; } conf.outputLocation = cmdLine.getOptionValue(OPTION_O_NAME); conf.configLocation = cmdLine.getOptionValue(OPTION_C_NAME); conf.propertiesLocation = cmdLine.getOptionValue(OPTION_P_NAME); conf.files = filesToProcess; conf.executeIgnoredModules = cmdLine.hasOption(OPTION_EXECUTE_IGNORED_MODULES_NAME); final String checkerThreadsNumber = cmdLine.getOptionValue( OPTION_CAPITAL_C_NAME, ONE_STRING_VALUE); conf.checkerThreadsNumber = Integer.parseInt(checkerThreadsNumber); final String treeWalkerThreadsNumber = cmdLine.getOptionValue( OPTION_CAPITAL_W_NAME, ONE_STRING_VALUE); conf.treeWalkerThreadsNumber = Integer.parseInt(treeWalkerThreadsNumber); return conf; }
Source:
<code>protected void updateExecCredsIfRequired() { if (this.needToRefreshCreds) { this.needToRefreshCreds = false; <START> LOG.info("The credentials are being updated {}.", executorId); <END> Credentials creds = this.workerData.getCredentials(); idToTask.stream().map(Task::getTaskObject).filter(taskObject -> taskObject instanceof ICredentialsListener) .forEach(taskObject -> { ((ICredentialsListener) taskObject).setCredentials(creds == null ? null : creds.get_creds()); }); } }</code><technical_language>change DEBUG this is a critical path (even this method called frequently)</technical_language>

Target:
protected void updateExecCredsIfRequired() { if (this.needToRefreshCreds.get()) { this.needToRefreshCreds.set(false); LOG.info("The credentials are being updated {}.", executorId); Credentials creds = this.workerData.getCredentials(); idToTask.stream().map(Task::getTaskObject).filter(taskObject -> taskObject instanceof ICredentialsListener) .forEach(taskObject -> { ((ICredentialsListener) taskObject).setCredentials(creds == null ? null : creds.get_creds()); }); } }
Source:
<code>public void storageAndPoolExists() { StorageDomain sd = new StorageDomain(); Guid storagePoolId = Guid.newGuid(); sd.setStoragePoolId(storagePoolId); <START> when(storageDomainDao.getAllForStorageDomain(any(Guid.class))).thenReturn(Collections.singletonList(sd)); <END> when(storagePoolDao.get(storagePoolId)).thenReturn(new StoragePool()); assertTrue(cmd.validate()); }</code><technical_language>This is redundant in Mockito 2</technical_language>

Target:
public void storageAndPoolExists() { StorageDomain sd = new StorageDomain(); Guid storagePoolId = Guid.newGuid(); sd.setStoragePoolId(storagePoolId); when(storageDomainDao.getAllForStorageDomain(any())).thenReturn(Collections.singletonList(sd)); when(storagePoolDao.get(storagePoolId)).thenReturn(new StoragePool()); assertTrue(cmd.validate()); }
Source:
<code>public AbstractListDataView<T> addItems(Collection<T> items) { final ListDataProvider<T> dataProvider = getDataProvider(); Collection<T> backendItems = dataProvider.getItems(); if (items != null && !items.isEmpty()) { items.stream() .filter(item -> <START> !contains(item, dataProvider)) <END> .forEach(backendItems::add); dataProvider.refreshAll(); } return this; }</code><technical_language>This relocate items order in collection. e.g. collect existing, removeAll(existing), addAll(items)</technical_language>

Target:
public AbstractListDataView<T> addItems(Collection<T> items) { Objects.requireNonNull(items, NULL_COLLECTION_ERROR_MESSAGE); if (!items.isEmpty()) { final ListDataProvider<T> dataProvider = getDataProvider(); Collection<T> backendItems = dataProvider.getItems(); items.stream() .filter(item -> contains(item, dataProvider)) .forEach(item -> removeItemIfPresent(item, dataProvider)); backendItems.addAll(items); dataProvider.refreshAll(); } return this; }
Source:
<code>private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } <START> if (chunk == firstChunk) { <END> if (operationCallbackInvoked.compareAndSet(false, true)) { ReadableStreamChannel result = getOperationException() == null ? this : null; operationCompleteCallback .completeOperation(operationFuture, operationCallback, result, getOperationException()); } } chunk.postCompletionCleanup(); maybeWriteToChannel(); }</code><technical_language>do need proceed is some exception</technical_language>

Target:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { getBlobResult = getOperationException() == null ? new GetBlobResult() : null; operationCompleteCallback .completeOperation(operationFuture, operationCallback, getBlobResult, getOperationException()); } } chunk.postCompletionCleanup(); if (getBlobResult != null) { getBlobResult.maybeWriteToChannel(); } }
Source:
<code>private void updateBrickStatusDown() { List<GlusterBrickEntity> brickEntities = getDbFacade().getGlusterBrickDao().getGlusterVolumeBricksByServerId(getVdsId()); for (GlusterBrickEntity brick : brickEntities) { brick.setStatus(GlusterStatus.DOWN); } <START> getDbFacade().getGlusterBrickDao().updateAll(brickEntities); <END> }</code><technical_language>do this spring jdbc</technical_language>

Target:
private void updateBrickStatusDown() { List<GlusterBrickEntity> brickEntities = getDbFacade().getGlusterBrickDao().getGlusterVolumeBricksByServerId(getVdsId()); for (GlusterBrickEntity brick : brickEntities) { brick.setStatus(GlusterStatus.DOWN); } getDbFacade().getGlusterBrickDao().updateBrickStatuses(brickEntities); }
Source:
<code>private void updateWatchdogModels(Integer osType) { VDSGroup cluster = getSelectedCluster(); <START> if (osType != null && cluster != null) { <END> AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<String> watchDogModels = (ArrayList<String>) ((VdcQueryReturnValue) returnValue) .getReturnValue(); watchDogModels.add(0, null); getWatchdogModel().setItems( (ArrayList<String>) watchDogModels); } }; AsyncDataProvider.getWatchDogModels(osType, cluster.getcompatibility_version(), asyncQuery); } }</code><technical_language>cluster is null dialog init (looks a bug). this method is invoked changing OS</technical_language>

Target:
private void updateWatchdogModels(Integer osType) { VDSGroup cluster = getSelectedCluster(); if (osType != null && cluster != null && getWatchdogModel() != null) { AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { updateWatchdogItems((ArrayList<String>) ((VdcQueryReturnValue) returnValue) .getReturnValue()); } }; AsyncDataProvider.getWatchDogModels(osType, cluster.getcompatibility_version(), asyncQuery); } }
Source:
<code>private void setSync(double defaultDisplayRefreshRate) { <START> if (useDefaultDisplayVsync) { <END> vsyncDurationNs = (long) (C.NANOS_PER_SECOND / defaultDisplayRefreshRate); vsyncOffsetNs = (vsyncDurationNs * VSYNC_OFFSET_PERCENTAGE) / 100; } }</code><technical_language>this true here</technical_language>

Target:
private void setSync(double defaultDisplayRefreshRate) { vsyncDurationNs = (long) (C.NANOS_PER_SECOND / defaultDisplayRefreshRate); vsyncOffsetNs = (vsyncDurationNs * VSYNC_OFFSET_PERCENTAGE) / 100; }
Source:
<code>public ExitStatus afterStep(StepExecution stepExecution) { logger.info("Items read = " + stepExecution .getReadCount() + ", items written = " + stepExecution <START> .getWriteCount() + " items skipped = " + stepExecution.getSkipCount()); <END> return null; }</code><technical_language>Please format this appropriately, fit "part" of message in a line</technical_language>

Target:
public ExitStatus afterStep(StepExecution stepExecution) { logger.info("Items read = " + stepExecution.getReadCount() + ", items written = " + stepExecution.getWriteCount() + ", items skipped = " + stepExecution.getSkipCount()); return null; }
Source:
<code>public PalantirContent deletePlayerPosition() { waitForElementVisibleByElement(mapFrame); <START> driver.switchTo().activeElement(); <END> JavascriptExecutor jsexec = (JavascriptExecutor) driver; driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS); Object res = jsexec.executeAsyncScript(PalantirContent.PONTO_REMOVEPLAYER); PalantirContent handle = new PalantirContent(); try { JSONObject json = new JSONObject(res.toString()); handle.success = json.getString(PalantirContent.PONTO_MSG_SUCCESS); handle.responseCode = json.getString(PalantirContent.PONTO_MSG_RESPONSECODE); handle.message = json.getString(PalantirContent.PONTO_MSG_MESSAGE); PageObjectLogging.log( "deletePlayerPosition", handle.message, true, driver ); }catch (JSONException e) { PageObjectLogging.log( "deletePlayerPosition", "Player position was not deleted", false, driver ); } return handle; }</code><technical_language>is this switch mapFrame? If so, consider changing explicit states driver.switchTo().frame(mapFrame);</technical_language>

Target:
public PalantirContent deletePlayerPosition() { waitForElementVisibleByElement(mapFrame); JavascriptExecutor jsexec = (JavascriptExecutor) driver; driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS); Object res = jsexec.executeAsyncScript(PalantirContent.PONTO_REMOVEPLAYER); return getResponse(res, "deletePlayerPosition"); }
Source:
<code>private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } <START> if (getVm().isDown()) { <END> if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())){ return false; } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); } else { if (oldVm.getLeaseStorageDomainId() != null) { runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())); removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); } else { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } } return true; }</code><technical_language>isDownOrSuspended isNotRunning</technical_language>

Target:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())) { return false; } } else { if (oldVm.getLeaseStorageDomainId() == null) { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())); } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }
Source:
<code>public List<PatientIdentifier> getPatientIdentifiers(String identifier, List<PatientIdentifierType> patientIdentifierTypes, List<Location> locations, List<Patient> patients, Boolean isPreferred) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientIdentifier.class); criteria.createAlias("patient", "patient"); criteria.add(Restrictions.eq("patient.voided", false)); criteria.add(Restrictions.eq("voided", false)); if (identifier != null) { criteria.add(Restrictions.eq("identifier", identifier)); } if (!patientIdentifierTypes.isEmpty()) { criteria.add(Restrictions.in("identifierType", patientIdentifierTypes)); } <START> if (!locations.isEmpty()) { <END> criteria.add(Restrictions.in("location", locations)); } if (!patients.isEmpty()) { criteria.add(Restrictions.in("patient", patients)); } if (isPreferred != null) { criteria.add(Restrictions.eq("preferred", isPreferred)); } return criteria.list(); }</code><technical_language>CollectionUtils.isNotEmpty()</technical_language>

Target:
public List<PatientIdentifier> getPatientIdentifiers(String identifier, List<PatientIdentifierType> patientIdentifierTypes, List<Location> locations, List<Patient> patients, Boolean isPreferred) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientIdentifier.class); criteria.createAlias("patient", "patient"); criteria.add(Restrictions.eq("patient.voided", false)); criteria.add(Restrictions.eq("voided", false)); if (identifier != null) { criteria.add(Restrictions.eq("identifier", identifier)); } if (CollectionUtils.isNotEmpty(patientIdentifierTypes)) { criteria.add(Restrictions.in("identifierType", patientIdentifierTypes)); } if (CollectionUtils.isNotEmpty(locations)) { criteria.add(Restrictions.in("location", locations)); } if (CollectionUtils.isNotEmpty(patients)) { criteria.add(Restrictions.in("patient", patients)); } if (isPreferred != null) { criteria.add(Restrictions.eq("preferred", isPreferred)); } return criteria.list(); }
Source:
<code>private void releaseHolder(SearcherHolder holder) { <START> synchronized (holder) { <END> decrementSearcherUsageCount(holder.searcher); } }</code><technical_language>synchronize closeReaders(), releaseHolder(..)</technical_language>

Target:
private void releaseHolder(SearcherHolder holder) { if (holder.releasedHolder.compareAndSet(false, true)) { decrementSearcherUsageCount(holder.searcher); } }
Source:
<code>private int logPartition(String e, AtomicInteger counter) { <START> final int log4jMaxBufSize = 64507; <END> return counter.getAndAdd(e.length() + securityAuditDelimiter.length()) / log4jMaxBufSize; }</code><technical_language>this a const instead</technical_language>

Target:
private int logPartition(String e, AtomicInteger counter) { return counter.getAndAdd(e.length() + SECURITY_AUDIT_DELIMITER.length()) / LOG4J_MAX_BUF_SIZE; }
Source:
<code>public List<QuotaTariffVO> listQuotaTariffPlans(final QuotaTariffListCmd cmd) { List<QuotaTariffVO> result = new ArrayList<QuotaTariffVO>(); Date effectiveDate = cmd.getEffectiveDate() == null ? new Date() : cmd.getEffectiveDate(); Date adjustedEffectiveDate = _quotaService.computeAdjustedTime(effectiveDate); <START> s_logger.info("Effective datec=" + effectiveDate + " quotatype=" + cmd.getUsageType() + " Adjusted date=" + adjustedEffectiveDate); <END> if (cmd.getUsageType() != null) { QuotaTariffVO tariffPlan = _quotaTariffDao.findTariffPlanByUsageType(cmd.getUsageType(), adjustedEffectiveDate); if (tariffPlan != null) { result.add(tariffPlan); } } else { result = _quotaTariffDao.listAllTariffPlans(adjustedEffectiveDate); } return result; }</code><technical_language>Logging INFO provide contextual information useable system administrators. This message more DEBUG needs more context useful a system administrator</technical_language>

Target:
public List<QuotaTariffVO> listQuotaTariffPlans(final QuotaTariffListCmd cmd) { List<QuotaTariffVO> result = new ArrayList<QuotaTariffVO>(); Date effectiveDate = cmd.getEffectiveDate() == null ? new Date() : cmd.getEffectiveDate(); Date adjustedEffectiveDate = _quotaService.computeAdjustedTime(effectiveDate); if (s_logger.isDebugEnabled()){ s_logger.debug("Effective datec=" + effectiveDate + " quotatype=" + cmd.getUsageType() + " Adjusted date=" + adjustedEffectiveDate); } if (cmd.getUsageType() != null) { QuotaTariffVO tariffPlan = _quotaTariffDao.findTariffPlanByUsageType(cmd.getUsageType(), adjustedEffectiveDate); if (tariffPlan != null) { result.add(tariffPlan); } } else { result = _quotaTariffDao.listAllTariffPlans(adjustedEffectiveDate); } return result; }
Source:
<code>public void publicationForValidDoi() { Optional<Publication> result = subject.getPublicationByDoi("10.1126/sciimmunol.aan8664"); assertThat(result.isPresent(), is(true)); assertThat(result.get().getDoi(), is("10.1126/sciimmunol.aan8664")); assertThat(result.get().getAuthors(), not(isEmptyString())); <START> assertThat(result.get().getTitle(), not(isEmptyString())); <END> }</code><technical_language>sort of tests I AssertJ shines, e.g.: assertThat(result.orElseThrow(RuntimeException::new)) .extracting("doi", "authors", "title") .contains("10.1126/sciimmunol.aan8664", "Patil VS, Madrigal A, Schmiedel BJ, Clarke J, O'Rourke P al.", "Precursors of human CD4+ cytotoxic T lymphocytes identified single-cell transcriptome analysis.");</technical_language>

Target:
public void publicationForValidDoi() { Optional<Publication> result = subject.getPublicationByIdentifier("10.1126/sciimmunol.aan8664"); assertThat(result.isPresent()).isTrue(); assertThat(result.orElseThrow(RuntimeException::new)) .extracting("doi", "authors", "title") .isNotEmpty(); assertThat(result.orElseThrow(RuntimeException::new).getDoi()).isEqualToIgnoringCase("10.1126/sciimmunol.aan8664"); }