auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void updateSharedScope(Scope sharedScope, String tenantDomain) throws APIManagementException { int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerEntry.getValue().getKeyManager(); if (keyManager != null) { try{ keyManager.updateScope(sharedScope); <START> }catch (APIManagementException e){ <END> log.error("Error while Updating Shared Scope " + sharedScope.getKey() + " from KeyManager " + keyManagerEntry.getKey(), e); } } } scopesDAO.updateScope(sharedScope, tenantId); }</code><technical_language>here. formatting issues. Shouldnt throw exception</technical_language>

Target:
public void updateSharedScope(Scope sharedScope, String tenantDomain) throws APIManagementException { int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerEntry.getValue().getKeyManager(); if (keyManager != null) { try { keyManager.updateScope(sharedScope); } catch (APIManagementException e) { log.error("Error while Updating Shared Scope " + sharedScope.getKey() + " from Key Manager " + keyManagerEntry.getKey(), e); } } } updateScope(sharedScope, tenantId); }
Source:
<code>public String configureConnector(String connName, Map<String, String> connConfig) { String url = endpointForResource(String.format("connectors/%s/config", connName)); <START> ObjectMapper mapper = new ObjectMapper(); <END> String content; try { content = mapper.writeValueAsString(connConfig); } catch (IOException e) { throw new ConnectException("Could not serialize connector configuration and execute PUT request"); } Response response = executePut(url, content); if (response.getStatus() < Response.Status.BAD_REQUEST.getStatusCode()) { return responseToString(response); } throw new ConnectRestException(response.getStatus(), "Could not execute PUT request"); }</code><technical_language>return is used</technical_language>

Target:
public String configureConnector(String connName, Map<String, String> connConfig) { String url = endpointForResource(String.format("connectors/%s/config", connName)); ObjectMapper mapper = new ObjectMapper(); String content; try { content = mapper.writeValueAsString(connConfig); } catch (IOException e) { throw new ConnectException("Could not serialize connector configuration and execute PUT request"); } Response response = requestPut(url, content); if (response.getStatus() < Response.Status.BAD_REQUEST.getStatusCode()) { return responseToString(response); } throw new ConnectRestException(response.getStatus(), "Could not execute PUT request"); }
Source:
<code>private int decodeFlags(Map<String, String> applicationAttributes) { int applicationFlags = 0; <START> for (Pair<String, Integer> pair : asList( <END> Pair.create("android:allowBackup", FLAG_ALLOW_BACKUP), Pair.create("android:allowClearUserData", FLAG_ALLOW_CLEAR_USER_DATA), Pair.create("android:allowTaskReparenting", FLAG_ALLOW_TASK_REPARENTING), Pair.create("android:debuggable", FLAG_DEBUGGABLE), Pair.create("android:hasCode", FLAG_HAS_CODE), Pair.create("android:killAfterRestore", FLAG_KILL_AFTER_RESTORE), Pair.create("android:persistent", FLAG_PERSISTENT), Pair.create("android:resizeable", FLAG_RESIZEABLE_FOR_SCREENS), Pair.create("android:restoreAnyVersion", FLAG_RESTORE_ANY_VERSION), Pair.create("android:largeScreens", FLAG_SUPPORTS_LARGE_SCREENS), Pair.create("android:normalScreens", FLAG_SUPPORTS_NORMAL_SCREENS), Pair.create("android:anyDensity", FLAG_SUPPORTS_SCREEN_DENSITIES), Pair.create("android:smallScreens", FLAG_SUPPORTS_SMALL_SCREENS), Pair.create("android:testOnly", FLAG_TEST_ONLY), Pair.create("android:vmSafeMode", FLAG_VM_SAFE_MODE) )) { if ("true".equals(applicationAttributes.get(pair.first))) { applicationFlags |= pair.second; } } return applicationFlags; }</code><technical_language>final static immutable list constant</technical_language>

Target:
private int decodeFlags(Map<String, String> applicationAttributes) { int applicationFlags = 0; for (Pair<String, Integer> pair : APPLICATION_FLAGS) { if ("true".equals(applicationAttributes.get(pair.first))) { applicationFlags |= pair.second; } } return applicationFlags; }
Source:
<code>ByteBuf duplicate() { <START> return (slice == srcBuf ? srcBuf : srcBuf.slice()).duplicate(); <END> }</code><technical_language>do need slice duplicate</technical_language>

Target:
ByteBuf duplicate() { return srcBuf.duplicate(); }
Source:
<code>public SAMFileSpan removeContentsBefore(final SAMFileSpan fileSpan) { if(fileSpan == null) return clone(); if(!(fileSpan instanceof BAMFileSpan)) throw new SAMException("Unable to compare "); final BAMFileSpan bamFileSpan = (BAMFileSpan)fileSpan; if(bamFileSpan.isEmpty()) return clone(); validateSorted(); final BAMFileSpan trimmedChunkList = new BAMFileSpan(); <START> long chunkStart = bamFileSpan.chunks.get(0).getChunkStart(); <END> for(final Chunk chunkToTrim: chunks) { if(chunkToTrim.getChunkEnd() > chunkStart) { if(chunkToTrim.getChunkStart() >= chunkStart) { trimmedChunkList.add(chunkToTrim.clone()); } else { trimmedChunkList.add(new Chunk(chunkStart,chunkToTrim.getChunkEnd())); } } } return trimmedChunkList; }</code><technical_language>this final I</technical_language>

Target:
public SAMFileSpan removeContentsBefore(final SAMFileSpan fileSpan) { if(fileSpan == null) return clone(); if(!(fileSpan instanceof BAMFileSpan)) throw new SAMException("Unable to compare "); final BAMFileSpan bamFileSpan = (BAMFileSpan)fileSpan; if(bamFileSpan.isEmpty()) return clone(); validateSorted(); final BAMFileSpan trimmedChunkList = new BAMFileSpan(); final long chunkStart = bamFileSpan.chunks.get(0).getChunkStart(); for(final Chunk chunkToTrim: chunks) { if(chunkToTrim.getChunkEnd() > chunkStart) { if(chunkToTrim.getChunkStart() >= chunkStart) { trimmedChunkList.add(chunkToTrim.clone()); } else { trimmedChunkList.add(new Chunk(chunkStart,chunkToTrim.getChunkEnd())); } } } return trimmedChunkList; }
Source:
<code>private Promise<ImageStreamTag> setActiveImageTag(final ImageStream stream) { return osService.getImageStreamTag("openshift", stream.getMetadata().getName(), "latest").thenPromise( new Function<ImageStreamTag, Promise<ImageStreamTag>>() { @Override public Promise<ImageStreamTag> apply(ImageStreamTag streamTag) throws FunctionException { osActiveStreamTag = streamTag; List<String> envs = streamTag.getDockerImageMetadata().getContainerConfig().getEnv(); List<Pair<String, String>> variables = new ArrayList<Pair<String, String>>(); for (String env : envs) { <START> String[] pair = env.split("="); <END> if (pair.length != 2) { continue; } variables.add(new Pair<String, String>(pair[0], pair[1])); } view.setEnvironmentVariables(variables); return Promises.resolve(streamTag); } }); }</code><technical_language>please rename keyValuePair</technical_language>

Target:
private Promise<ImageStreamTag> setActiveImageTag(final ImageStream stream) { return osService.getImageStreamTag("openshift", stream.getMetadata().getName(), "latest").thenPromise( new Function<ImageStreamTag, Promise<ImageStreamTag>>() { @Override public Promise<ImageStreamTag> apply(ImageStreamTag streamTag) throws FunctionException { osActiveStreamTag = streamTag; List<String> envs = streamTag.getDockerImageMetadata().getContainerConfig().getEnv(); List<Pair<String, String>> variables = new ArrayList<>(); for (String env : envs) { String[] keyValuePair = env.split("="); if (keyValuePair.length != 2) { continue; } variables.add(new Pair<>(keyValuePair[0], keyValuePair[1])); } view.setEnvironmentVariables(variables); return Promises.resolve(streamTag); } }); }
Source:
<code>public void testPositiveImportVmFromConfiguration() { initCommand(getOvfEntityData()); doReturn(createStorageDomain()).when(cmd).getStorageDomain(); doReturn(Boolean.TRUE).when(cmd).canDoActionAfterCloneVm(anyMap()); doReturn(Boolean.TRUE).when(cmd).canDoActionBeforeCloneVm(anyMap()); boolean canDoReturn = cmd.canDoAction(); assertTrue("The CDA assertion is false, Those are the following messages " <START> + cmd.getReturnValue().getCanDoActionMessages(), canDoReturn); <END> }</code><technical_language>Please CanDoActionAssertUtils</technical_language>

Target:
public void testPositiveImportVmFromConfiguration() { initCommand(getOvfEntityData()); doReturn(createStorageDomain()).when(cmd).getStorageDomain(); doReturn(Boolean.TRUE).when(cmd).canDoActionAfterCloneVm(anyMap()); doReturn(Boolean.TRUE).when(cmd).canDoActionBeforeCloneVm(anyMap()); CanDoActionTestUtils.runAndAssertCanDoActionSuccess(cmd); }
Source:
<code>boolean getHl7PrefixProperty() { try { return PropertyAccessor.getInstance().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.HL7_PREFIX_FOR_ATTR_PROPERTY); } catch (final PropertyAccessException ex) { <START> LOG.warn(ex.getLocalizedMessage()); <END> LOG.trace("Get HL7 Prefix Property exception: {}", ex.getLocalizedMessage(), ex); } return false; }</code><technical_language>Remove log.warn cover in log.trace</technical_language>

Target:
boolean getHl7PrefixProperty() { try { return PropertyAccessor.getInstance().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.HL7_PREFIX_FOR_ATTR_PROPERTY); } catch (final PropertyAccessException ex) { LOG.trace("Get HL7 Prefix Property exception: {}", ex.getLocalizedMessage(), ex); } return false; }
Source:
<code>private QueryIterator variableSubject(Binding binding, Node s, Node score, Node literal, StrMatch match, ExecutionContext execCxt) { if (log.isTraceEnabled()) <START> log.trace("variableSubject: {}", match) ; <END> ListMultimap<String,TextHit> results = query(match.getProperty(), match.getQueryString(), match.getLang(), match.getLimit(), execCxt) ; Collection<TextHit> r = results.values(); return resultsToQueryIterator(binding, s, score, literal, r, execCxt); }</code><technical_language>need guard isTraceEnabled() if this form of Logger.trace</technical_language>

Target:
private QueryIterator variableSubject(Binding binding, Node s, Node score, Node literal, StrMatch match, ExecutionContext execCxt) { log.trace("variableSubject: {}", match) ; ListMultimap<String,TextHit> results = query(match.getProperty(), match.getQueryString(), match.getLang(), match.getLimit(), execCxt) ; Collection<TextHit> r = results.values(); return resultsToQueryIterator(binding, s, score, literal, r, execCxt); }
Source:
<code>private List<String> readIdsList(JSONArray jsonArray, @NonNull String idScheme) { List<String> list = new ArrayList<>(); if (jsonArray != null) { for (int i = 0; i < jsonArray.length(); i++) { String id = jsonArray.optString(i); <START> if (id.startsWith(AIDL_LAYERS_PREFIX)) { <END> list.add(id); } else { list.add(idScheme + id); } } } return list; }</code><technical_language>clear AIDL_LAYERS_PREFIX</technical_language>

Target:
protected List<String> readIdsList(JSONArray jsonArray, @NonNull String idScheme) { List<String> list = new ArrayList<>(); if (jsonArray != null) { for (int i = 0; i < jsonArray.length(); i++) { String id = jsonArray.optString(i); list.add(idScheme + id); } } return list; }
Source:
<code>public void enqueue(Lifespan lifespan, List<SerializedPage> pages) { checkState(!Thread.holdsLock(this), "Can not enqueue pages while holding a lock on this"); requireNonNull(lifespan, "lifespan is null"); requireNonNull(pages, "page is null"); checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback must be set before enqueueing data"); if (!state.get().canAddPages() || noMorePagesForLifespan.contains(lifespan)) { return; } long bytesAdded = pages.stream().mapToLong(SerializedPage::getRetainedSizeInBytes).sum(); memoryManager.updateMemoryUsage(bytesAdded); long rowCount = pages.stream().mapToLong(SerializedPage::getPositionCount).sum(); totalRowsAdded.addAndGet(rowCount); totalPagesAdded.addAndGet(pages.size()); outstandingPageCountPerLifespan.computeIfAbsent(lifespan, ignored -> new AtomicLong()).addAndGet(pages.size()); List<SerializedPageReference> serializedPageReferences = pages.stream() .map(pageSplit -> new SerializedPageReference( pageSplit, 1, () -> dereferencePage(pageSplit, lifespan))) .collect(toImmutableList()); masterBuffer.addPages(serializedPageReferences); List<ClientBuffer> buffers = safeGetBuffersSnapshot(); if (buffers.isEmpty()) { return; } int index = nextClientBufferIndex.get() % buffers.size(); for (int i = 0; i < buffers.size(); i++) { buffers.get(index).loadPagesIfNecessary(masterBuffer); index = (index + 1) % buffers.size(); <START> if (masterBuffer.isEmpty()) { <END> nextClientBufferIndex.set(index); break; } } }</code><technical_language>Is enqueue called multiple threads? IOW do multiple threads enter this loop fetch nextClientBufferIndex</technical_language>

Target:
public void enqueue(Lifespan lifespan, List<SerializedPage> pages) { checkState(!Thread.holdsLock(this), "Can not enqueue pages while holding a lock on this"); requireNonNull(lifespan, "lifespan is null"); requireNonNull(pages, "page is null"); checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback must be set before enqueueing data"); if (!state.get().canAddPages() || noMorePagesForLifespan.contains(lifespan)) { return; } long bytesAdded = pages.stream().mapToLong(SerializedPage::getRetainedSizeInBytes).sum(); memoryManager.updateMemoryUsage(bytesAdded); long rowCount = pages.stream().mapToLong(SerializedPage::getPositionCount).sum(); totalRowsAdded.addAndGet(rowCount); totalPagesAdded.addAndGet(pages.size()); outstandingPageCountPerLifespan.computeIfAbsent(lifespan, ignored -> new AtomicLong()).addAndGet(pages.size()); List<SerializedPageReference> serializedPageReferences = pages.stream() .map(pageSplit -> new SerializedPageReference( pageSplit, 1, () -> dereferencePage(pageSplit, lifespan))) .collect(toImmutableList()); masterBuffer.addPages(serializedPageReferences); List<ClientBuffer> buffers = safeGetBuffersSnapshot(); if (buffers.isEmpty()) { return; } int index = nextClientBufferIndex.get() % buffers.size(); for (int i = 0; i < buffers.size(); i++) { if (masterBuffer.isEmpty()) { nextClientBufferIndex.set(index); break; } buffers.get(index).loadPagesIfNecessary(masterBuffer); index = (index + 1) % buffers.size(); } }
Source:
<code>public static Reaction GetReaction(ConfigRuntimeException e, Environment env) { if(env.getEnv(GlobalEnv.class).GetExceptionHandler() != null) { CClosure c = env.getEnv(GlobalEnv.class).GetExceptionHandler(); CArray ex = ObjectGenerator.GetGenerator().exception(e, env, Target.UNKNOWN); if(e.getEnv() != null) { MCCommandSender sender = e.getEnv().getEnv(CommandHelperEnvironment.class).GetCommandSender(); c.getEnv().getEnv(CommandHelperEnvironment.class).SetCommandSender(sender); } try { c.execute(new Construct[]{ex}); return Reaction.REPORT; } catch (FunctionReturnException retException) { Construct ret = retException.getReturn(); if(ret instanceof CNull || Prefs.ScreamErrors() || !Static.getBoolean(ret, Target.UNKNOWN)) { return Reaction.REPORT; } else { <START> return Reaction.IGNORE; END> } } catch (ConfigRuntimeException cre) { HandleUncaughtException(cre, env, Reaction.REPORT); return Reaction.REPORT; } } else { return Reaction.REPORT; } }</code><technical_language>Hmm, no, set this FATAL, is handle it, behavior</technical_language>

Target:
public static Reaction GetReaction(ConfigRuntimeException e, Environment env) { if(env.getEnv(GlobalEnv.class).GetExceptionHandler() != null) { CClosure c = env.getEnv(GlobalEnv.class).GetExceptionHandler(); CArray ex = ObjectGenerator.GetGenerator().exception(e, env, Target.UNKNOWN); if(e.getEnv() != null) { MCCommandSender sender = e.getEnv().getEnv(CommandHelperEnvironment.class).GetCommandSender(); c.getEnv().getEnv(CommandHelperEnvironment.class).SetCommandSender(sender); } try { c.execute(new Construct[]{ex}); return Reaction.REPORT; } catch (FunctionReturnException retException) { Construct ret = retException.getReturn(); if(ret instanceof CNull || Prefs.ScreamErrors()) { return Reaction.REPORT; } else { return (Static.getBoolean(ret, Target.UNKNOWN) ? Reaction.IGNORE : Reaction.FATAL); } } catch (ConfigRuntimeException cre) { HandleUncaughtException(cre, env, Reaction.REPORT); return Reaction.REPORT; } } else { return Reaction.REPORT; } }
Source:
<code>public void shouldResolveHistoricTaskAuthorization_HistoricProcessInstance() { processEngineConfiguration.setEnableHistoricInstancePermissions(true); testRule.deploy(CALLING_PROCESS); testRule.deploy(CALLED_PROCESS); ClockUtil.setCurrentTime(START_DATE); String processInstanceId = runtimeService.startProcessInstanceByKey(CALLING_PROCESS_KEY) .getProcessInstanceId(); Authorization authorization = authorizationService.createNewAuthorization(Authorization.AUTH_TYPE_GRANT); authorization.setUserId("myUserId"); authorization.setResource(Resources.HISTORIC_PROCESS_INSTANCE); authorization.setResourceId(processInstanceId); authorizationService.saveAuthorization(authorization); authorization = authorizationService.createAuthorizationQuery() .resourceType(Resources.HISTORIC_PROCESS_INSTANCE) .singleResult(); assertThat(authorization.getRemovalTime(), nullValue()); String taskId = taskService.createTaskQuery().singleResult().getId(); ClockUtil.setCurrentTime(END_DATE); taskService.complete(taskId); Date removalTime = addDays(END_DATE, 5); authorization = authorizationService.createAuthorizationQuery() .resourceType(Resources.HISTORIC_PROCESS_INSTANCE) .singleResult(); assertThat(authorization.getRemovalTime(), is(removalTime)); <START> clearAuthorization(); <END> }</code><technical_language>@ method clears authorizations if assert statement fails</technical_language>

Target:
public void shouldResolveHistoricTaskAuthorization_HistoricProcessInstance() { processEngineConfiguration.setEnableHistoricInstancePermissions(true); testRule.deploy(CALLING_PROCESS); testRule.deploy(CALLED_PROCESS); ClockUtil.setCurrentTime(START_DATE); String processInstanceId = runtimeService.startProcessInstanceByKey(CALLING_PROCESS_KEY) .getProcessInstanceId(); Authorization authorization = authorizationService.createNewAuthorization(Authorization.AUTH_TYPE_GRANT); authorization.setUserId("myUserId"); authorization.setResource(Resources.HISTORIC_PROCESS_INSTANCE); authorization.setResourceId(processInstanceId); authorizationService.saveAuthorization(authorization); authorization = authorizationService.createAuthorizationQuery() .resourceType(Resources.HISTORIC_PROCESS_INSTANCE) .singleResult(); assertThat(authorization.getRemovalTime(), nullValue()); String taskId = taskService.createTaskQuery().singleResult().getId(); ClockUtil.setCurrentTime(END_DATE); taskService.complete(taskId); Date removalTime = addDays(END_DATE, 5); authorization = authorizationService.createAuthorizationQuery() .resourceType(Resources.HISTORIC_PROCESS_INSTANCE) .singleResult(); assertThat(authorization.getRemovalTime(), is(removalTime)); }
Source:
<code>private boolean tableExists(TableName tableName) { <START> Connection connection = queryExecutor.getConnection(); <END> try { DatabaseMetaData metadata = connection.getMetaData(); String escape = metadata.getSearchStringEscape(); try (ResultSet resultSet = metadata.getTables( connection.getCatalog(), escapeNamePattern(tableName.getSchema().orElse(null), escape), escapeNamePattern(tableName.getName(), escape), new String[] {"TABLE"}) ) { while (resultSet.next()) { if (tableNameMatches(tableName, resultSet) && tableSchemaMatches(tableName, resultSet)) { LOGGER.info("Table already exists", tableName.getNameInDatabase()); return true; } } } } catch (SQLException e) { throw new QueryExecutionException(e); } return false; }</code><technical_language>try-with-resources for connection</technical_language>

Target:
private boolean tableExists(TableName tableName) { Connection connection = queryExecutor.getConnection(); try { DatabaseMetaData metadata = connection.getMetaData(); String escape = metadata.getSearchStringEscape(); try (ResultSet resultSet = metadata.getTables( connection.getCatalog(), escapeNamePattern(tableName.getSchema().orElse(null), escape), escapeNamePattern(tableName.getName(), escape), new String[] {"TABLE"}) ) { return QueryResult.forResultSet(resultSet).getRowsCount() > 0; } } catch (SQLException e) { throw new QueryExecutionException(e); } }
Source:
<code>public void setTreeViewGroupMetricsToNodeRuleProvider(TreeViewGroupMetricsToNodeRuleProvider treeViewGroupMetricsToNodeRuleProvider) { this.treeViewGroupMetricsToNodeRuleProvider = treeViewGroupMetricsToNodeRuleProvider; <START> setDefaultMonitoringParams(this.treeViewGroupMetricsToNodeRuleProvider.getMonitoringPlotGroups()); <END> }</code><technical_language>Please avoid another setter in setter</technical_language>

Target:
public void setTreeViewGroupMetricsToNodeRuleProvider(TreeViewGroupMetricsToNodeRuleProvider treeViewGroupMetricsToNodeRuleProvider) { this.treeViewGroupMetricsToNodeRuleProvider = treeViewGroupMetricsToNodeRuleProvider; }
Source:
<code>public void tearDown() throws Exception { if (newApp != null) Entities.destroyAll(newApp.getManagementContext()); <START> if (origApp != null && origManagementContext.isRunning()) Entities.destroyAll(origManagementContext); <END> if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir); }</code><technical_language>Do Entities.destroyAllCatching(...) prevent errors causing test skipped</technical_language>

Target:
public void tearDown() throws Exception { if (newApp != null) Entities.destroyAllCatching(newApp.getManagementContext()); if (origApp != null && origManagementContext.isRunning()) Entities.destroyAll(origManagementContext); if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir); }
Source:
<code>public void write(Enriched<EntityType> enrichable, JsonGenerator jg) { <START> try (Writer writer = new StringWriter()) { <END> try (TokenBuffer tb = new TokenBuffer(MAPPER, false)) { tb.writeStartObject(); write(tb, enrichable.getEntity()); tb.flush(); try (JsonParser parser = tb.asParser()) { parser.nextToken(); while (parser.nextToken() == JsonToken.FIELD_NAME) { jg.copyCurrentStructure(parser); } } } } catch (Exception e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } else { log.info("enrichment failed", e); } } }</code><technical_language>writer is removed, I guess this is code a previous attempt</technical_language>

Target:
public void write(Enriched<EntityType> enrichable, JsonGenerator jg) { try (TokenBuffer tb = new TokenBuffer(MAPPER, false)) { tb.writeStartObject(); write(tb, enrichable.getEntity()); tb.flush(); try (JsonParser parser = tb.asParser()) { parser.nextToken(); while (parser.nextToken() == JsonToken.FIELD_NAME) { jg.copyCurrentStructure(parser); } if (parser.currentToken() != null) { log.error("Enricher returned invalid output {}", name, tb.toString()); } } } catch (Exception e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } else { log.info("Enricher failed", name, e); } } }
Source:
<code>public void prepare() throws Exception { String resourceRoot; <START> URL root = j.getURL(); END> resourceRoot = root.toString().replace("localhost", RESOURCE_DOMAIN); ResourceDomainConfiguration configuration = ExtensionList.lookupSingleton(ResourceDomainConfiguration.class); configuration.setUrl(resourceRoot); }</code><technical_language>Assert safe</technical_language>

Target:
public void prepare() throws Exception { String resourceRoot; URL root = j.getURL(); Assert.assertTrue(root.toString().contains("localhost")); resourceRoot = root.toString().replace("localhost", RESOURCE_DOMAIN); ResourceDomainConfiguration configuration = ExtensionList.lookupSingleton(ResourceDomainConfiguration.class); configuration.setUrl(resourceRoot); }
Source:
<code>public void assignRandomAttributes(EntityRef oreon) { OreonAttributeComponent oreonAttributes = new OreonAttributeComponent(); MersenneRandom random = new MersenneRandom(); <START> if(prefabToSpawn.getName().equals("Oreons:OreonBuilder")) { <END> oreonAttributes.intelligence = random.nextInt(oreonAttributes.maxIntelligence); } else { oreonAttributes.intelligence = 0; } oreonAttributes.strength = random.nextInt(oreonAttributes.maxStrength); oreon.addComponent(oreonAttributes); }</code><technical_language>getName() is non-null? a case constant left-hand-side is a good idea avoid explicit null check. Second, "Oreons:OreonBuilder" declared a constant easily changed later</technical_language>

Target:
private void assignRandomAttributes(EntityRef oreon) { OreonAttributeComponent oreonAttributes = new OreonAttributeComponent(); MersenneRandom random = new MersenneRandom(); if (prefabToSpawn.getName().equals(Constants.OREON_BUILDER_PREFAB)) { oreonAttributes.intelligence = random.nextInt(oreonAttributes.maxIntelligence); } else { oreonAttributes.intelligence = 0; } oreonAttributes.strength = random.nextInt(oreonAttributes.maxStrength); oreon.addComponent(oreonAttributes); }
Source:
<code><START> private void waitUntilBuilt() { <END> totalsStats.waitUntilBuilt(); typesStats.waitUntilBuilt(); }</code><technical_language>this return a boolean perhaps</technical_language>

Target:
private boolean waitUntilBuilt() { boolean check1 = totalsStats.waitUntilBuilt(); boolean check2 = typesStats.waitUntilBuilt(); return (check1 && check2); }
Source:
<code>public void onSetAsDefaultFilter(@ForEvent("click") elemental2.dom.Event e) { <START> savedFilterSelectedEvent.fire(new SavedFilterSelectedEvent(getValue())); <END> savedFilterAsDefaultEventEvent.fire(new SavedFilterAsDefaultActiveEvent(getValue())); }</code><technical_language>do want trigger a selection setting a filter default</technical_language>

Target:
public void onSetAsDefaultFilter(@ForEvent("click") elemental2.dom.Event e) { if (!getValue().isDefaultFilter()) { savedFilterAsDefaultEventEvent.fire(new SavedFilterAsDefaultActiveEvent(getValue())); } }
Source:
<code>boolean isTraceState(String key, Object value) { <START> return key.startsWith("Hawkular"); <END> }</code><technical_language>please define this constant in tracer class</technical_language>

Target:
boolean isTraceState(String key, Object value) { return key.startsWith("Hawkular-APM"); }
Source:
<code>public void init(Map<String, Serializable> args) throws Exception { if (args.containsKey(CONTAINER_NAME) && !args.get(CONTAINER_NAME).toString().isEmpty()) { containerName = args.get(CONTAINER_NAME).toString(); } else { throw new IllegalArgumentException("You have to specify a container name. Empty value is not allowed."); <START> } <END> if (args.containsKey(BLOB_NAME) && !args.get(BLOB_NAME).toString().isEmpty()) { blobName = args.get(BLOB_NAME).toString(); } if (args.containsKey(OUTPUT_PATH) && !args.get(OUTPUT_PATH).toString().isEmpty()) { outputPath = args.get(OUTPUT_PATH).toString(); } else { outputPath = getLocalSpace(); } accountName = getThirdPartyCredential("ACCOUNT_NAME"); accountKey = getThirdPartyCredential("ACCOUNT_KEY"); if (accountName == null || accountKey == null) { throw new IllegalArgumentException("You first need to add your account name and account key (ACCOUNT_NAME, ACCOUNT_KEY) to the third party credentials."); } }</code><technical_language>able replace upper code by: java containerName = Optional.ofNullable(args.get(CONTAINER_NAME)).filter(container -> ! container.toString().isEmpty()).orElseThrow( () -> new IllegalArgumentException("You a container name. Empty is allowed.");</technical_language>

Target:
public void init(Map<String, Serializable> args) throws Exception { containerName = (String) Optional.ofNullable(args.get(CONTAINER_NAME)) .filter(container -> !container.toString().isEmpty()) .orElseThrow(() -> new IllegalArgumentException("You have to specify a container name. Empty value is not allowed.")); optionalBlobName = Optional.ofNullable(args.get(BLOB_NAME).toString()).filter(name -> !name.isEmpty()); outputPath = (String) Optional.ofNullable(args.get(OUTPUT_PATH)) .filter(output -> !output.toString().isEmpty()) .orElse(getLocalSpace()); storageAccount = getThirdPartyCredential("STORAGE_ACCOUNT"); accountKey = getThirdPartyCredential("ACCOUNT_KEY"); if (storageAccount == null || accountKey == null) { throw new IllegalArgumentException("You first need to add your account name and account key (STORAGE_ACCOUNT, ACCOUNT_KEY) to the third party credentials."); } }
Source:
<code>public void home() throws Exception { Logger.debug("{}.home()", getName()); <START> for (NozzleTip attachedNozzleTip : this.getCompatibleNozzleTips()) { <END> if (attachedNozzleTip instanceof ReferenceNozzleTip) { ReferenceNozzleTip calibrationNozzleTip = (ReferenceNozzleTip)attachedNozzleTip; if (calibrationNozzleTip.getCalibration().isRecalibrateOnHomeNeeded()) { if (calibrationNozzleTip == this.nozzleTip) { Logger.debug("{}.home() nozzle tip calibration neeeded", getName(), calibrationNozzleTip.getName()); calibrationNozzleTip.getCalibration().calibrate(calibrationNozzleTip, true, false); } else { Logger.debug("{}.home() nozzle tip calibration reset", getName(), calibrationNozzleTip.getName()); calibrationNozzleTip.getCalibration().reset(); } } } } }</code><technical_language>correct additions I made</technical_language>

Target:
public void home() throws Exception { Logger.debug("{}.home()", getName()); for (NozzleTip attachedNozzleTip : this.getCompatibleNozzleTips()) { if (attachedNozzleTip instanceof ReferenceNozzleTip) { ReferenceNozzleTip calibrationNozzleTip = (ReferenceNozzleTip)attachedNozzleTip; if (calibrationNozzleTip.getCalibration().isRecalibrateOnHomeNeeded(this)) { if (calibrationNozzleTip == this.getCalibrationNozzleTip()) { Logger.debug("{}.home() nozzle tip calibration neeeded", getName(), calibrationNozzleTip.getName()); calibrationNozzleTip.getCalibration().calibrate(this, true, false); } else { Logger.debug("{}.home() nozzle tip calibration reset", getName(), calibrationNozzleTip.getName()); calibrationNozzleTip.getCalibration().reset(this); } } } } }
Source:
<code>public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { <START> if(tab == EsteemedInnovation.tab) <END> for (Entry<Integer, String[]> entry : map.entrySet()) { items.add(new ItemStack(this, 1, entry.getKey())); } }</code><technical_language>Missing braces space if</technical_language>

Target:
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (isInCreativeTab(tab)) { for (Entry<Integer, String[]> entry : map.entrySet()) { items.add(new ItemStack(this, 1, entry.getKey())); } } }
Source:
<code>private void registerShoutListeners() { listen(Message.LOADED, (sender, subject, args) -> { if (!subject.equals("sequences")) { return; } assert (args[0] instanceof Map<?, ?>); Map<String, Sequence> newSequences = (Map<String, Sequence>) args[0]; load(newSequences); }); listen(Message.FILTERED, (sender, subject, args) -> { assert args.length == 1; assert (args[0] instanceof Set<?>); updateVisible((Set<Sequence>) args[0]); }); listen(Message.RESET, (sender, subject, args) -> { updateVisible(new HashSet<Sequence>(sequences.values())); <START> shout(Message.FILTERED, "", new HashSet<>(sequences.values())); <END> }); }</code><technical_language>save</technical_language>

Target:
private void registerShoutListeners() { listen(Message.LOADED, (sender, subject, args) -> { if (!subject.equals("sequences")) { return; } assert (args[0] instanceof Map<?, ?>); Map<String, Sequence> newSequences = (Map<String, Sequence>) args[0]; load(newSequences); }); listen(Message.FILTERED, (sender, subject, args) -> { assert args.length == 1; assert (args[0] instanceof Set<?>); updateVisible((Set<Sequence>) args[0]); }); listen(Message.RESET, (sender, subject, args) -> { Set<Sequence> visibleSet = new HashSet<>(sequences.values()); updateVisible(visibleSet); shout(Message.FILTERED, "", visibleSet); }); }
Source:
<code>public IBinding getBinding() { if (fBinding == null) { if (fParameterOwner == null) { <START> CCorePlugin.log(new NullPointerException()); <END> return null; } ICPPParameter[] parameters = fParameterOwner.getParameters(); fBinding = parameters[fParameterPosition]; } return fBinding; }</code><technical_language>log in constructor here? getBinding() called times lifetime of EvalBinding, warnings for instance of problem</technical_language>

Target:
public IBinding getBinding() { if (fBinding == null && fParameterOwner != null) { ICPPParameter[] parameters = fParameterOwner.getParameters(); fBinding = parameters[fParameterPosition]; } return fBinding; }
Source:
<code>private static Command createCustomerCmd() { final LocalDate localDate = LocalDates.today(); final CustomerId customerId = CustomerId.newBuilder() .setRegistrationDate(localDate) .setNumber(customerNumber) .build(); customerNumber++; final Message msg = CreateCustomer.newBuilder() .setCustomerId(customerId) .setCustomer(Customer.newBuilder() .setId(customerId) .setName(PersonName.newBuilder() .setGivenName("Kreat") .setFamilyName("C'Ustomer") .setHonorificSuffix("Cmd"))) .build(); final UserId userId = newUserId(Identifiers.newUuid()); <START> final Command result = Given.Command.createCommand(msg, userId, TimeUtil.getCurrentTime()); <END> return result; }</code><technical_language>Please avoid duplications. Rename this method create</technical_language>

Target:
private static Command createCustomerCmd() { final LocalDate localDate = LocalDates.today(); final CustomerId customerId = CustomerId.newBuilder() .setRegistrationDate(localDate) .setNumber(customerNumber) .build(); customerNumber++; final Message msg = CreateCustomer.newBuilder() .setCustomerId(customerId) .setCustomer(Customer.newBuilder() .setId(customerId) .setName(PersonName.newBuilder() .setGivenName("Kreat") .setFamilyName("C'Ustomer") .setHonorificSuffix("Cmd"))) .build(); final UserId userId = newUserId(Identifiers.newUuid()); final Command result = Given.Command.create(msg, userId, TimeUtil.getCurrentTime()); return result; }
Source:
<code>private void postError(final ObjectServerError error) { boolean errorHandled = false; if (callback != null) { Runnable action = new Runnable() { @Override public void run() { callback.onError(error); } }; errorHandled = handler.post(action); } if (!errorHandled) { <START> RealmLog.error(error, "An error was thrown, but could not be handled."); <END> } }</code><technical_language>posted, instead ... fallback print error stderr</technical_language>

Target:
private void postError(final ObjectServerError error) { boolean errorHandled = false; if (callback != null) { Runnable action = new Runnable() { @Override public void run() { callback.onError(error); } }; errorHandled = handler.post(action); } if (!errorHandled) { RealmLog.error(error, "An error was thrown, but could not be posted: \n" + error.toString()); } }
Source:
<code>private TaskData doInBackgroundSearchCards(TaskData... params) { Timber.d("doInBackgroundSearchCards"); Collection col = CollectionHelper.getInstance().getCol(mContext); String query = (String) params[0].getObjArray()[0]; Boolean order = (Boolean) params[0].getObjArray()[1]; int numCardsToRender = (int) params[0].getObjArray()[2]; List<Long> searchResult_ = col.findCards(query, order); <START> List<Map<String,String>> searchResult = new ArrayList<>(searchResult_.size()); <END> for (Long cid: searchResult_) { Map<String, String> card = new HashMap<>(); card.put(CardBrowser.ID, cid.toString()); searchResult.add(card); } for (int i = 0; i < Math.min(numCardsToRender, searchResult.size()); i++) { Card c = col.getCard(Long.parseLong(searchResult.get(i).get("id"))); CardBrowser.updateSearchItemQA(mContext, searchResult.get(i), c, col); } if (isCancelled()) { Timber.d("doInBackgroundSearchCards was cancelled so return null"); return null; } else { return new TaskData(searchResult); } }</code><technical_language>nice Timber.d count</technical_language>

Target:
private TaskData doInBackgroundSearchCards(TaskData... params) { Timber.d("doInBackgroundSearchCards"); Collection col = CollectionHelper.getInstance().getCol(mContext); String query = (String) params[0].getObjArray()[0]; Boolean order = (Boolean) params[0].getObjArray()[1]; int numCardsToRender = (int) params[0].getObjArray()[2]; List<Long> searchResult_ = col.findCards(query, order); int resultSize = searchResult_.size(); List<Map<String,String>> searchResult = new ArrayList<>(resultSize); Timber.d("The search found %d cards", resultSize); for (Long cid: searchResult_) { Map<String, String> card = new HashMap<>(); card.put(CardBrowser.ID, cid.toString()); searchResult.add(card); } for (int i = 0; i < Math.min(numCardsToRender, searchResult.size()); i++) { Card c = col.getCard(Long.parseLong(searchResult.get(i).get("id"))); CardBrowser.updateSearchItemQA(mContext, searchResult.get(i), c, col); } if (isCancelled()) { Timber.d("doInBackgroundSearchCards was cancelled so return null"); return null; } else { return new TaskData(searchResult); } }
Source:
<code>protected DLNAThumbnailInputStream getGenericThumbnailInputStreamInternal(String fallback) throws IOException { String thumb = fallback; if (format != null && format.getIcon() != null) { thumb = format.getIcon(); } if (thumb != null && isCodeValid(this)) { if (new File(thumb).exists()) { try (FileInputStream fis = new FileInputStream(thumb)) { <START> return DLNAThumbnailInputStream.toThumbnailInputStream(fis); <END> } } InputStream is; if ((is = getResourceInputStream(thumb)) != null) { return DLNAThumbnailInputStream.toThumbnailInputStream(is); } try { return DLNAThumbnailInputStream.toThumbnailInputStream(downloadAndSend(thumb, true)); } catch (Exception e) } if (isFolder()) { return GenericIcons.INSTANCE.getGenericFolderIcon(); } return GenericIcons.INSTANCE.getGenericIcon(this); }</code><technical_language>I unsure this one. DLNAThumbnailInputStream.toThumbnailInputStream get wants this change</technical_language>

Target:
protected DLNAThumbnailInputStream getGenericThumbnailInputStreamInternal(String fallback) throws IOException { String thumb = fallback; if (format != null && format.getIcon() != null) { thumb = format.getIcon(); } if (thumb != null && isCodeValid(this)) { InputStream is; if (new File(thumb).exists() && ((is = new FileInputStream(thumb)) != null)) { return DLNAThumbnailInputStream.toThumbnailInputStream(is); } if ((is = getResourceInputStream(thumb)) != null) { return DLNAThumbnailInputStream.toThumbnailInputStream(is); } try { return DLNAThumbnailInputStream.toThumbnailInputStream(downloadAndSend(thumb, true)); } catch (Exception e) } if (isFolder()) { return GenericIcons.INSTANCE.getGenericFolderIcon(); } return GenericIcons.INSTANCE.getGenericIcon(this); }
Source:
<code>public BigInteger convert( final String value ) { <START> return new BigInteger( value ); <END> }</code><technical_language>This in theory throw a NumberFormatException. This is caught in similar case in ListBoxByteSingletonDOMElementFactory, good catch too</technical_language>

Target:
public BigInteger convert( final String value ) { try { return new BigInteger( value ); } catch ( NumberFormatException nfe ) { return new BigInteger( "0" ); } }
Source:
<code>private void assertTravelExpenseCorrect(DisbursementVoucherNonEmployeeExpense expectedExpense, DisbursementVoucherNonEmployeeExpense actualExpense) { assertEquals("expense code not correct", expectedExpense.getDisbVchrExpenseCode(), actualExpense.getDisbVchrExpenseCode()); <START> assertEquals("expense compnay name not correct", expectedExpense.getDisbVchrExpenseCompanyName(), actualExpense.getDisbVchrExpenseCompanyName()); <END> assertEquals("expense amount not correct", expectedExpense.getDisbVchrExpenseAmount(), actualExpense.getDisbVchrExpenseAmount()); }</code><technical_language>typo compnay => company</technical_language>

Target:
private void assertTravelExpenseCorrect(DisbursementVoucherNonEmployeeExpense expectedExpense, DisbursementVoucherNonEmployeeExpense actualExpense) { assertEquals("expense code not correct", expectedExpense.getDisbVchrExpenseCode(), actualExpense.getDisbVchrExpenseCode()); assertEquals("expense company name not correct", expectedExpense.getDisbVchrExpenseCompanyName(), actualExpense.getDisbVchrExpenseCompanyName()); assertEquals("expense amount not correct", expectedExpense.getDisbVchrExpenseAmount(), actualExpense.getDisbVchrExpenseAmount()); }
Source:
<code>public void inputChanged(@Nullable Viewer viewer, @Nullable Object oldInput, @Nullable Object newInput) { fTableViewer = (TableViewer) viewer; <START> if (newInput instanceof Collection<?>) { <END> Collection<ISegment> segmentStore = (Collection<ISegment>) newInput; fSegmentArray = Iterables.toArray(segmentStore, ISegment.class); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else if (newInput instanceof ISegment[]) { fSegmentArray = ((ISegment[]) newInput).clone(); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else { fSegmentArray = null; } }</code><technical_language>I check for ISegmentStore</technical_language>

Target:
public void inputChanged(@Nullable Viewer viewer, @Nullable Object oldInput, @Nullable Object newInput) { fTableViewer = (TableViewer) viewer; if (newInput instanceof Collection<?> || newInput instanceof ISegmentStore) { Collection<ISegment> segmentStore = (Collection<ISegment>) newInput; fSegmentArray = Iterables.toArray(segmentStore, ISegment.class); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else if (newInput instanceof ISegment[]) { fSegmentArray = ((ISegment[]) newInput).clone(); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else { fSegmentArray = null; } }
Source:
<code>public Object execute(MessageContext context, final LongTask lt) { showExecutionInfo(); ContinuationProvider provider = (ContinuationProvider) context.get(ContinuationProvider.class.getName()); final Continuation continuation = provider.getContinuation(); TaskExecutor executor = getTaskExecutor(this.corePoolSize, this.maxPoolSize); synchronized (continuation) { if (continuation.isNew()) { FutureTask<Object> futureProcess = new FutureTask<>(new Callable<Object>() { @Override public Object call() throws Exception { Object response = lt.run(); continuation.resume(); return response; } }); executor.execute(futureProcess); continuation.setObject(futureProcess); continuation.suspend(this.timeOut); return null; } else { @SuppressWarnings("unchecked") FutureTask<Object> futureTask = (FutureTask<Object>) continuation.getObject(); if (futureTask.isDone()) { try { System.gc(); return futureTask.get(); } catch (Exception e) { <START> System.out.println("ERROR: " + e.getMessage()); <END> return null; } } return null; } } }</code><technical_language>This logger System.out</technical_language>

Target:
public Object execute(MessageContext context, final LongTask lt) { showExecutionInfo(); ContinuationProvider provider = (ContinuationProvider) context.get(ContinuationProvider.class.getName()); final Continuation continuation = provider.getContinuation(); TaskExecutor executor = getTaskExecutor(this.corePoolSize, this.maxPoolSize); synchronized (continuation) { if (continuation.isNew()) { FutureTask<Object> futureProcess = new FutureTask<>(new Callable<Object>() { @Override public Object call() throws Exception { Object response = lt.run(); continuation.resume(); return response; } }); executor.execute(futureProcess); continuation.setObject(futureProcess); continuation.suspend(this.timeOut); return null; } else { @SuppressWarnings("unchecked") FutureTask<Object> futureTask = (FutureTask<Object>) continuation.getObject(); if (futureTask.isDone()) { try { System.gc(); return futureTask.get(); } catch (Exception e) { LOG.error(e.getMessage()); return null; } } return null; } } }
Source:
<code>public void processRecord(ComputationContext context, String documentIdsStreamName, Record record) { Codec<DataBucket> codec = BulkCodecs.getDataBucketCodec(); DataBucket in = codec.decode(record.getData()); String commandId = in.getCommandId(); long documents = in.getCount(); <START> Blob blob = getBlob(in.getDataAsString(), in.getAction()); <END> TransientStore store = Framework.getService(TransientStoreService.class) .getStore(DownloadService.TRANSIENT_STORE_STORE_NAME); store.putBlobs(commandId, Collections.singletonList(blob)); store.setCompleted(commandId, true); String url = Framework.getService(DownloadService.class).getDownloadUrl(commandId); Map<String, Serializable> result = Collections.singletonMap("url", url); AbstractBulkComputation.updateStatusProcessed(context, commandId, documents, result); context.askForCheckpoint(); }</code><technical_language>hmm, storename is action name</technical_language>

Target:
public void processRecord(ComputationContext context, String documentIdsStreamName, Record record) { Codec<DataBucket> codec = BulkCodecs.getDataBucketCodec(); DataBucket in = codec.decode(record.getData()); String commandId = in.getCommandId(); long documents = in.getCount(); String storeName = Framework.getService(BulkService.class).getStatus(commandId).getAction(); Blob blob = getBlob(in.getDataAsString(), storeName); TransientStore store = Framework.getService(TransientStoreService.class) .getStore(DownloadService.TRANSIENT_STORE_STORE_NAME); store.putBlobs(commandId, Collections.singletonList(blob)); store.setCompleted(commandId, true); String url = Framework.getService(DownloadService.class).getDownloadUrl(commandId); Map<String, Serializable> result = Collections.singletonMap("url", url); AbstractBulkComputation.updateStatusProcessed(context, commandId, documents, result); context.askForCheckpoint(); }
Source:
<code>public org.codice.solr.client.solrj.SolrClient newClient(String core) { String solrUrl = StringUtils.defaultIfBlank( <START> System.getProperty("solr.http.url", getDefaultHttpsAddress()), <END> SystemBaseUrl.constructUrl("/solr")); final String coreUrl = solrUrl + "/" + core; if (System.getProperty(SOLR_DATA_DIR) != null) { ConfigurationStore.getInstance().setDataDirectoryPath(System.getProperty(SOLR_DATA_DIR)); } LOGGER.debug("Solr({}): Creating an HTTP Solr client using url [{}]", core, coreUrl); return new SolrClientAdapter( core, () -> HttpSolrClientFactory.createSolrHttpClient(solrUrl, core, null, coreUrl)); }</code><technical_language>a constant for solr.data.dir, consider for solr.http.url well</technical_language>

Target:
public org.codice.solr.client.solrj.SolrClient newClient(String core) { String solrUrl = StringUtils.defaultIfBlank( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), getDefaultHttpsAddress()); final String coreUrl = solrUrl + "/" + core; final String solrDataDir = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_DATA_DIR)); if (solrDataDir != null) { ConfigurationStore.getInstance().setDataDirectoryPath(solrDataDir); } LOGGER.debug("Solr({}): Creating an HTTP Solr client using url [{}]", core, coreUrl); return new SolrClientAdapter(core, () -> createSolrHttpClient(solrUrl, core, coreUrl)); }