auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean exec() { try { if (!isSkipDecorate()) { for (String tag: getNameAndTag()) { build.setDisplayName(build.getDisplayName() + " " + tag); } } return isSkipBuild() ? maybeTagOnly() : buildAndTag() && <START> isSkipPush() ? true : dockerPushCommand(); <END> } catch (IOException e) { return recordException(e); } catch (InterruptedException e) { return recordException(e); } catch (MacroEvaluationException e) { return recordException(e); } }</code><technical_language>deletion of this call is safe. Probably, a replacement call base docker-commons is required</technical_language>

Target:
private boolean exec() { try { if (!isSkipDecorate()) { for (String tag: getNameAndTag()) { build.setDisplayName(build.getDisplayName() + " " + tag); } } return (isSkipBuild() ? maybeTagOnly() : buildAndTag()) && (isSkipPush() ? true : dockerPushCommand()); } catch (IOException e) { return recordException(e); } catch (InterruptedException e) { return recordException(e); } catch (MacroEvaluationException e) { return recordException(e); } }
Source:
<code>public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { <START> View root = inflater.inflate(R.layout.fragment_for_leads, null); <END> return root; }</code><technical_language>View root = inflater.inflate(R.layout.fragment_for_leads, container, false); instead</technical_language>

Target:
public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_for_leads, container, false); return root; }
Source:
<code>void startClose() { <START> if (pullRetryTimeoutMs == 0L) { <END> return; } stateMachine.setState(STATE_CLOSING); }</code><technical_language>Defining 0L TIMEOUT_NO_RETRY clear</technical_language>

Target:
void startClose() { if (pullRetryTimeoutMs == TIMEOUT_NO_RETRY) { return; } stateMachine.setState(STATE_CLOSING); }
Source:
<code>public static void main(String[] args) throws Exception { if (args.length != 1 || MasterGoalState.valueOf(args[0]) == null) { System.err.println( "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]"); System.exit(-1); } SecurityUtil.serverLogin(SiteConfiguration.getInstance()); <START> ServerInfo info = ServerInfo.getInstance(); <END> Accumulo.waitForZookeeperAndHdfs(info.getVolumeManager()); ZooReaderWriter.getInstance().putPersistentData( info.getZooKeeperRoot() + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }</code><technical_language>Need a follow issue passing more in avoiding calls getInstance()</technical_language>

Target:
public static void main(String[] args) throws Exception { if (args.length != 1 || MasterGoalState.valueOf(args[0]) == null) { System.err.println( "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]"); System.exit(-1); } SecurityUtil.serverLogin(SiteConfiguration.getInstance()); ServerContext context = ServerContext.getInstance(); Accumulo.waitForZookeeperAndHdfs(context.getVolumeManager()); ZooReaderWriter.getInstance().putPersistentData( context.getZooKeeperRoot() + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }
Source:
<code>public void visitNode(Tree tree) { MethodTree methodTree = (MethodTree) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); <START> if (methodSymbol != null <END> && isClassController(methodSymbol) && isRequestMappingAnnotated(methodSymbol) && !isPublicMethod(methodSymbol)) { reportIssue(methodTree.simpleName(), "Make this method \"public\"."); } }</code><technical_language>This null check in fact avoided. case a method symbol a method tree null is semantic is available. In ruling for package java.lang of JDK. If is available, sense run this check so, in fact beginning of visitNode a : if(!hasSemantic()) { return; } test this JavaCheckVerifier.verifyNoIssueWithoutSemantic (which use)</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (isClassController(methodSymbol) && isRequestMappingAnnotated(methodSymbol) && !isPublicMethod(methodSymbol)) { reportIssue(methodTree.simpleName(), "Make this method \"public\"."); } }
Source:
<code>static final ImmutableSortedSet<Integer> getApiLevels(Dirents platformsDirectories) { ImmutableSortedSet.Builder<Integer> apiLevels = ImmutableSortedSet.reverseOrder(); for (Dirent platformDirectory : platformsDirectories) { <START> if (platformDirectory.getType() != Dirent.Type.DIRECTORY && platformDirectory.getType() != Dirent.Type.SYMLINK) { <END> continue; } Matcher matcher = PLATFORMS_API_LEVEL_PATTERN.matcher(platformDirectory.getName()); if (matcher.matches()) { apiLevels.add(Integer.parseInt(matcher.group(1))); } } return apiLevels.build(); }</code><technical_language>if platform-* directories symlinks some os's, this skip of API levels return nothing? I android_sdk_repository throw error API levels installed</technical_language>

Target:
static final ImmutableSortedSet<Integer> getApiLevels(Dirents platformsDirectories) { ImmutableSortedSet.Builder<Integer> apiLevels = ImmutableSortedSet.reverseOrder(); for (Dirent platformDirectory : platformsDirectories) { if (platformDirectory.getType() == Dirent.Type.DIRECTORY || platformDirectory.getType() == Dirent.Type.SYMLINK) { Matcher matcher = PLATFORMS_API_LEVEL_PATTERN.matcher(platformDirectory.getName()); if (matcher.matches()) { apiLevels.add(Integer.parseInt(matcher.group(1))); } } } return apiLevels.build(); }
Source:
<code>public static EphemeralType get(long ephemeralOwner) { if (ephemeralOwner == CONTAINER_EPHEMERAL_OWNER) { return CONTAINER; } <START> if ((ephemeralOwner & TTL_MASK) == TTL_MASK) { <END> return TTL; } return (ephemeralOwner == 0) ? VOID : NORMAL; }</code><technical_language>I this is broken. If, for example, org.apache.zookeeper.server.DataTree#deleteNode calls this method TTL turned off, a server id of 255 end calling this code } else if (ephemeralType == EphemeralType.TTL) { ttls.remove(path); node removed properly in deleteNode</technical_language>

Target:
public static EphemeralType get(long ephemeralOwner) { if (extendedEphemeralTypesEnabled()) { if (Boolean.getBoolean(TTL_3_5_3_EMULATION_PROPERTY)) { if (OldEphemeralType.get(ephemeralOwner) == OldEphemeralType.TTL) { return TTL; } } if ((ephemeralOwner & EXTENDED_MASK) == EXTENDED_MASK) { long extendedFeatureBit = getExtendedFeatureBit(ephemeralOwner); EphemeralType ephemeralType = extendedFeatureMap.get(extendedFeatureBit); if (ephemeralType == null) { throw new IllegalArgumentException(String.format("Invalid ephemeralOwner. [%s]", Long.toHexString(ephemeralOwner))); } return ephemeralType; } } if (ephemeralOwner == CONTAINER_EPHEMERAL_OWNER) { return CONTAINER; } return (ephemeralOwner == 0) ? VOID : NORMAL; }
Source:
<code>public void testNasdaq() { <START> assert(faker.stock().nsdqSymbol() != ""); <END> }</code><technical_language>@noelo matchers other unit tests. Thanks</technical_language>

Target:
public void testNasdaq() { assertThat(faker.stock().nsdqSymbol(), not(isEmptyOrNullString())); }
Source:
<code>private void checkLoadable(DeltaWindowEntry ent, long need) { if (maxMemory == 0) return; DeltaWindowEntry n = res.next; <START> while (maxMemory < loaded + need) { <END> clear(n); if (n == ent) throw new LargeObjectException.ExceedsLimit( maxMemory, loaded + need); n = n.next; } }</code><technical_language>nit: this a for loop (or vice versa)</technical_language>

Target:
private void checkLoadable(DeltaWindowEntry ent, long need) { if (maxMemory == 0) return; DeltaWindowEntry n = res.next; for (; maxMemory < loaded + need; n = n.next) { clear(n); if (n == ent) throw new LargeObjectException.ExceedsLimit( maxMemory, loaded + need); } }
Source:
<code>private static File getUniqueFilename(File dbDir) { <START> String uniqueSuffix = "_" + (Math.random() * 5); <END> String timeAsString = DateTime.now().toString(DateTimeFormat.forPattern("MM_dd_yyyy_HH_mm_ss")); String filename = timeAsString + uniqueSuffix; File newFile = new File(dbDir, filename); while (newFile.exists()) { newFile = getUniqueFilename(dbDir); } return newFile; }</code><technical_language>GUID's for these? more reliable/consistent making a structure</technical_language>

Target:
private static File getUniqueFilename(File dbDir) { String filename = PropertyUtils.genUUID(); File newFile = new File(dbDir, filename); while (newFile.exists()) { newFile = getUniqueFilename(dbDir); } return newFile; }
Source:
<code>private void handlePreparedStatementClusterError(long sesGeneration, Throwable e) { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } <START> synchronized (generation) { <END> if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } log.warning("Prepared statement cluster error detected, refreshing Cassandra session", e); refresh(); log.warning("Cassandra session refreshed"); } }</code><technical_language>synchornized a Long - this is JDK cache instance for -127 128 call Long.valueOf</technical_language>

Target:
private void handlePreparedStatementClusterError(long sesGeneration, Throwable e) { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } refreshLock.lock(); try { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } log.warning("Prepared statement cluster error detected, refreshing Cassandra session", e); refresh(); log.warning("Cassandra session refreshed"); } finally { refreshLock.unlock(); } }
Source:
<code>public final ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler) { final AbstractChannelHandlerContext ctx; checkMultiplicity(handler); if (name == null) { name = generateName(handler); } final AbstractChannelHandlerContext newCtx = newContext(name, handler); synchronized (handlers) { <START> int i = findCtxIdx((context) -> context.name().equals(baseName)); <END> if (i == -1) { throw new NoSuchElementException(baseName); } if (context(name) != null) { throw new IllegalArgumentException("Duplicate handler name: " + name); } ctx = handlers.get(i); handlers.add(i, newCtx); } EventExecutor executor = executor(); if (executor.inEventLoop()) { addBefore0(ctx, newCtx); } else { try { executor.execute(() -> addBefore0(ctx, newCtx)); } catch (Throwable cause) { synchronized (handlers) { handlers.remove(newCtx); } throw cause; } } return this; }</code><technical_language>single-arg lambda need parentheses, i.e. context -> ... (same in other places)</technical_language>

Target:
public final ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler) { final AbstractChannelHandlerContext ctx; checkMultiplicity(handler); if (name == null) { name = generateName(handler); } AbstractChannelHandlerContext newCtx = newContext(name, handler); EventExecutor executor = executor(); boolean inEventLoop = executor.inEventLoop(); synchronized (handlers) { int i = findCtxIdx(context -> context.name().equals(baseName)); if (i == -1) { throw new NoSuchElementException(baseName); } if (context(name) != null) { throw new IllegalArgumentException("Duplicate handler name: " + name); } ctx = handlers.get(i); handlers.add(i, newCtx); if (!inEventLoop) { try { executor.execute(() -> addBefore0(ctx, newCtx)); return this; } catch (Throwable cause) { handlers.remove(i); throw cause; } } } addBefore0(ctx, newCtx); return this; }
Source:
<code>public void hideAll() { Collection<List<Marker>> listMarkers = fMarkerRegistry.values(); List<Marker> markers = Lists.newArrayList(Iterables.concat(listMarkers)); <START> Iterator<Marker> visibleMarkers = Iterators.filter(markers.iterator(), new Predicate<Marker>() { <END> public boolean apply(Marker marker) { return marker.getFigure().getParent() != null; } }); while (visibleMarkers.hasNext()) { Marker marker = (Marker)visibleMarkers.next(); handleDecorator(marker, false, true); } }</code><technical_language>iterator ? ability do a foreach visibleMarkers</technical_language>

Target:
public void hideAll() { Collection<Marker> listMarkers = fMarkerRegistry.values(); Iterable<Marker> visibleMarkers = Iterables.filter(listMarkers, new Predicate<Marker>() { public boolean apply(Marker marker) { return marker.getFigure().getParent() != null; } }); for (Marker marker : visibleMarkers) { handleDecorator(marker, false, true); } }
Source:
<code>protected void checkNotification(ClientNotificationClusterNotification notificationToCheck) { <START> Assert.assertTrue(notificationToCheck.getQueueElement().getNotification() instanceof ResetAccessControlChangedNotification); <END> Assert.assertTrue(notificationToCheck.getQueueElement().getFilter() instanceof SingleUserFilter); Assert.assertNull(((SingleUserFilter) notificationToCheck.getQueueElement().getFilter()).getUserId()); }</code><technical_language>static import for asserts</technical_language>

Target:
protected void checkNotification(ClientNotificationClusterNotification notificationToCheck) { assertTrue(notificationToCheck.getQueueElement().getNotification() instanceof ResetAccessControlChangedNotification); assertTrue(notificationToCheck.getQueueElement().getFilter() instanceof SingleUserFilter); assertNull(((SingleUserFilter) notificationToCheck.getQueueElement().getFilter()).getUserId()); }
Source:
<code>protected Calendar getRetainUntilDateFrom(LocalDateTime datetime) { LocalDateTime localDateTime = datetime.plusYears(getDurationYears()) .plusMonths(getDurationMonths()) .plusDays(getDurationDays()) <START> .plusNanos(getDurationMillis() * 1000000); <END> return GregorianCalendar.from(localDateTime.atZone(ZoneId.systemDefault())); }</code><technical_language>1000000 -> 1_000_000, i replace plusNanos(getDurationMillis() * 1000000) .plus(getDurationMillis(), ChronoUnit.MILLIS); wdyt</technical_language>

Target:
protected Calendar getRetainUntilDateFrom(LocalDateTime datetime) { LocalDateTime localDateTime = datetime.plusYears(getDurationYears()) .plusMonths(getDurationMonths()) .plusDays(getDurationDays()) .plus(getDurationMillis(), ChronoUnit.MILLIS); return GregorianCalendar.from(localDateTime.atZone(ZoneId.systemDefault())); }
Source:
<code>public AABB transform(Transform transform) { <START> return transform(transform, 0.01f); <END> }</code><technical_language>General rule: magic numbers. want turn 0.01f a static final class variable. This concept applies 0.5f factors below, if easier figure out halving coefficients</technical_language>

Target:
public AABB transform(Transform transform) { return transform(transform, DEFAULT_MARGIN); }
Source:
<code>List<TopicChanges> sample(final Collection<Document> documents) { final CountDownLatch latch = new CountDownLatch(numTrainerThreads); final BlockingQueue<Document> instances = new ArrayBlockingQueue<>(miniBatchSize); <START> instances.addAll(documents); <END> final List<Future<TopicChanges>> futures = new ArrayList<>(numTrainerThreads); try { for (int threadIdx = 0; threadIdx < numTrainerThreads; threadIdx++) { final Future<TopicChanges> future = executor.submit(() -> { final LDAModel model = modelAccessor.getModel() .orElseThrow(() -> new RuntimeException(MSG_GET_MODEL_FAILED)); int count = 0; while (true) { final int numInstancesPerThread = Math.min(miniBatchSize, documents.size()) / numTrainerThreads + 1; final List<Document> instancesPerThread = new ArrayList<>(numInstancesPerThread); final int numDrained = instances.drainTo(instancesPerThread, numInstancesPerThread); if (numDrained == 0) { break; } instancesPerThread.forEach(instance -> updateModel(instance, model)); count += numDrained; } latch.countDown(); LOG.log(Level.INFO, "{0} has computed {1} instances", new Object[]{Thread.currentThread().getName(), count}); return model.getTopicChanges(); }); futures.add(future); } latch.await(); } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Exception occurred.", e); throw new RuntimeException(e); } return ThreadUtils.retrieveResults(futures); }</code><technical_language>concluded ConcurrentLinkedQueue in a previous PR</technical_language>

Target:
List<TopicChanges> sample(final Collection<Document> documents) { final CountDownLatch latch = new CountDownLatch(numTrainerThreads); final BlockingQueue<Document> instances = new ArrayBlockingQueue<>(documents.size()); instances.addAll(documents); final List<Future<TopicChanges>> futures = new ArrayList<>(numTrainerThreads); try { for (int threadIdx = 0; threadIdx < numTrainerThreads; threadIdx++) { final Future<TopicChanges> future = executor.submit(() -> { final LDAModel model = modelAccessor.getModel() .orElseThrow(() -> new RuntimeException(MSG_GET_MODEL_FAILED)); final int drainSize = Math.min(documents.size() / numTrainerThreads / numTrainerThreads, 1); final List<Document> drainedInstances = new ArrayList<>(drainSize); int count = 0; while (true) { final int numDrained = instances.drainTo(drainedInstances, drainSize); if (numDrained == 0) { break; } drainedInstances.forEach(instance -> updateModel(instance, model)); drainedInstances.clear(); count += numDrained; } latch.countDown(); LOG.log(Level.INFO, "{0} has computed {1} instances", new Object[]{Thread.currentThread().getName(), count}); return model.getTopicChanges(); }); futures.add(future); } latch.await(); } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Exception occurred.", e); throw new RuntimeException(e); } return ThreadUtils.retrieveResults(futures); }
Source:
<code>private void updatePose() { if (vrSystem == null || vrCompositor == null) { return; } vrCompositor.WaitGetPoses.apply(hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount, null, 0); for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice) { hmdTrackedDevicePoses[nDevice].read(); } if (hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0) { for (int nEye = 0; nEye < 2; nEye++) { HmdMatrix34_t matPose = vrSystem.GetEyeToHeadTransform.apply(nEye); vrState.setEyePoseWRTHead(matPose, nEye); HmdMatrix44_t matProjection = vrSystem.GetProjectionMatrix.apply(nEye, nearClip, farClip, JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL); vrState.setProjectionMatrix(matProjection, nEye); } vrState.setHeadPose(hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].mDeviceToAbsoluteTracking); headIsTracking = true; } else { headIsTracking = false; } findControllerDevices(); <START> for (int c = 0; c < 2; c++) { <END> if (controllerDeviceIndex[c] != -1) { controllerTracking[c] = true; vrState.setControllerPose(hmdTrackedDevicePoses[controllerDeviceIndex[c]].mDeviceToAbsoluteTracking, c); } else { controllerTracking[c] = false; } } }</code><technical_language>speed of light cropping in this corner of galaxy</technical_language>

Target:
private void updatePose() { vrCompositor.WaitGetPoses.apply(hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount, null, 0); for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice) { hmdTrackedDevicePoses[nDevice].read(); } if (hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0) { for (int nEye = 0; nEye < 2; nEye++) { HmdMatrix34_t matPose = vrSystem.GetEyeToHeadTransform.apply(nEye); vrState.setEyePoseWRTHead(matPose, nEye); HmdMatrix44_t matProjection = vrSystem.GetProjectionMatrix.apply(nEye, nearClip, farClip, JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL); vrState.setProjectionMatrix(matProjection, nEye); } vrState.setHeadPose(hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].mDeviceToAbsoluteTracking); headIsTracking = true; } else { headIsTracking = false; } findControllerDevices(); for (int handIndex = 0; handIndex < 2; handIndex++) { if (controllerDeviceIndex[handIndex] != -1) { controllerTracking[handIndex] = true; vrState.setControllerPose(hmdTrackedDevicePoses[controllerDeviceIndex[handIndex]].mDeviceToAbsoluteTracking, handIndex); } else { controllerTracking[handIndex] = false; } } }
Source:
<code>public void testAddRomDriveToServerPayload() { AddRomDriveToServerRequestBinder binder = new AddRomDriveToServerRequestBinder(); Drive.Request.AddRomDriveToServerPayload payload = Drive.Request.AddRomDriveToServerPayload.builder() .serverId("server-id") .storageId("image-id") .deviceNumber("device-number") .build(); String actual = binder.createPayload(payload); <START> assertNotNull(actual, "Binder returned null payload"); <END> assertEquals(expectedPayload, actual); }</code><technical_language>nit: This is redundant, next check fail expected payload is null</technical_language>

Target:
public void testAddRomDriveToServerPayload() { AddRomDriveToServerRequestBinder binder = new AddRomDriveToServerRequestBinder(); Drive.Request.AddRomDriveToServerPayload payload = Drive.Request.AddRomDriveToServerPayload.builder() .serverId("server-id") .storageId("image-id") .deviceNumber("device-number") .build(); String actual = binder.createPayload(payload); assertEquals(expectedPayload, actual); }
Source:
<code>public void createEntityConstraints(GraphDatabaseService neo4jDb, Configuration configuration) { UniqueConstraintSchemaUpdateStrategy constraintMethod = UniqueConstraintSchemaUpdateStrategy.interpret( configuration.getProperties().get( Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY ) ); <START> if ( constraintMethod == UniqueConstraintSchemaUpdateStrategy.SKIP ) { <END> log.tracef( "%1$s property set to %2$s: Skipping generation of unique constraints", Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY, UniqueConstraintSchemaUpdateStrategy.SKIP ); } else { Transaction tx = null; try { tx = neo4jDb.beginTx(); addUniqueConstraints( neo4jDb, configuration ); tx.success(); } finally { tx.close(); } } }</code><technical_language>more modes other SKIP. Do support of them</technical_language>

Target:
public void createEntityConstraints(GraphDatabaseService neo4jDb, Configuration configuration) { UniqueConstraintSchemaUpdateStrategy constraintMethod = UniqueConstraintSchemaUpdateStrategy.interpret( configuration.getProperties().get( Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY ) ); log.debugf( "%1$s property set to %2$s" , Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY ); if ( constraintMethod == UniqueConstraintSchemaUpdateStrategy.SKIP ) { log.tracef( "%1$s property set to %2$s: Skipping generation of unique constraints", Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY, UniqueConstraintSchemaUpdateStrategy.SKIP ); } else { log.debug( "Creating missing constraints" ); Transaction tx = null; try { tx = neo4jDb.beginTx(); addUniqueConstraints( neo4jDb, configuration ); tx.success(); } finally { tx.close(); } } }
Source:
<code>public void setPollSleep(long time, TimeUnit unit) { <START> if(unit.toMillis(time)<MIN_POLL_INTERVAL_MS){ <END> pollMs.set(MIN_POLL_INTERVAL_MS); } else{ pollMs.set(unit.toMillis(time)); } }</code><technical_language>Need add spaces if, < ). Please follow existing code style</technical_language>

Target:
public void setPollSleep(long time, TimeUnit unit) { if ( unit.toMillis(time) < MIN_POLL_INTERVAL_MS ) { log.warning(String.format("Poll interval cannot be less than %d seconds. Setting it to %d seconds.", TimeUnit.MILLISECONDS.toSeconds(MIN_POLL_INTERVAL_MS), TimeUnit.MILLISECONDS.toSeconds(MIN_POLL_INTERVAL_MS))); pollMs.set(MIN_POLL_INTERVAL_MS); } else { pollMs.set(unit.toMillis(time)); } }
Source:
<code>protected String getBrokerName() { if (brokerName == null) { <START> EntityLocal parent = (EntityLocal)getParent(); <END> brokerName = parent != null ? parent.getAttribute(ActiveMQBroker.BROKER_NAME) : null; } return brokerName; }</code><technical_language>need cast EntityLocal call getAttribute() parent</technical_language>

Target:
protected String getBrokerName() { Preconditions.checkNotNull(getParent(), "JMS Destination must have a broker parent"); return getParent().getAttribute(ActiveMQBroker.BROKER_NAME); }
Source:
<code>public void updateKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.getKey("keyName") .subscribe(keyResponse -> { keyResponse.getProperties().setNotBefore(OffsetDateTime.now().plusDays(50)); keyAsyncClient.updateKeyPropertiesWithResponse(keyResponse.getProperties(), KeyOperation.ENCRYPT, KeyOperation.DECRYPT) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(updatedKeyResponse -> System.out.printf("Key's getUpdated not before time %s %n", updatedKeyResponse.getValue().getProperties().getNotBefore().toString())); }); END: com.azure.security.keyvault.keys.async.keyclient.updateKeyPropertiesWithResponse#KeyProperties-keyOperations keyAsyncClient.getKey("keyName") .subscribe(keyResponse -> { keyResponse.getProperties().setNotBefore(OffsetDateTime.now().plusDays(50)); keyAsyncClient.updateKeyPropertiesWithResponse(keyResponse.getProperties()) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(updatedKeyResponse -> <START> System.out.printf("Key's getUpdated not before time %s %n", <END> updatedKeyResponse.getValue().getProperties().getNotBefore().toString())); }); END: com.azure.security.keyvault.keys.async.keyclient.updateKeyPropertiesWithResponse#KeyProperties }</code><technical_language>typo getUpdated in file</technical_language>

Target:
public void updateKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.getKey("keyName") .subscribe(keyResponse -> { keyResponse.getProperties().setNotBefore(OffsetDateTime.now().plusDays(50)); keyAsyncClient.updateKeyPropertiesWithResponse(keyResponse.getProperties(), KeyOperation.ENCRYPT, KeyOperation.DECRYPT) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(updatedKeyResponse -> System.out.printf("Key's updated not before time %s %n", updatedKeyResponse.getValue().getProperties().getNotBefore().toString())); }); END: com.azure.security.keyvault.keys.async.keyclient.updateKeyPropertiesWithResponse#KeyProperties-keyOperations }
Source:
<code>public void valid() { BatchDeleteClientsRequest.builder() .clientIdentification(ClientIdentification.builder() <START> .clientId("client-id") <END> .build()) .build(); }</code><technical_language>This "test-client-id", is simpler I eliminate ClientIdentification</technical_language>

Target:
public void valid() { BatchDeleteClientsRequest.builder() .clientId("test-client-id") .build(); }
Source:
<code>public String getSubtitleText(long currMediaTime, boolean willDisplay) { if (external) currMediaTime += delay; String rv = ""; subtitleLock.readLock().lock(); try { boolean foundValid = false; for (int i = getSubEntryIndex(currMediaTime); i < subEntries.size(); i++) { SubtitleEntry currEntry = subEntries.get(i); SubtitleEntry nextEntry = ((i < subEntries.size() - 1) ? subEntries.get(i + 1) : null); if (currEntry.start <= currMediaTime) { if ((currEntry.duration > 0 && currEntry.start + currEntry.duration > currMediaTime) || (currEntry.duration == 0 && (nextEntry == null || nextEntry.start > currMediaTime))) { foundValid = true; if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = false; } rv = (rv.length() == 0) ? currEntry.text : (rv + "\n" + currEntry.text); } else if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = true; } } else { if (rv.length() == 0 && willDisplay && !foundValid) { subEntryPos = i; currBlank = true; } break; } } } finally { subtitleLock.readLock().unlock(); } <START> System.out.println("Got Subtitle text=" + rv + " subEntryPos=" + subEntryPos); <END> return rv; }</code><technical_language>want get rid of this debug line...I'd imagine logs a LOT do subtitle playback. want add some kind of "debug_subs" property controls logging in subtitle classes too</technical_language>

Target:
public String getSubtitleText(long currMediaTime, boolean willDisplay) { if (external) currMediaTime += delay; String rv = ""; subtitleLock.readLock().lock(); try { boolean foundValid = false; for (int i = getSubEntryIndex(currMediaTime); i < subEntries.size(); i++) { SubtitleEntry currEntry = subEntries.get(i); SubtitleEntry nextEntry = ((i < subEntries.size() - 1) ? subEntries.get(i + 1) : null); if (currEntry.start <= currMediaTime) { if ((currEntry.duration > 0 && currEntry.start + currEntry.duration > currMediaTime) || (currEntry.duration == 0 && (nextEntry == null || nextEntry.start > currMediaTime))) { foundValid = true; if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = false; } rv = (rv.length() == 0) ? currEntry.text : (rv + "\n" + currEntry.text); } else if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = true; } } else { if (rv.length() == 0 && willDisplay && !foundValid) { subEntryPos = i; currBlank = true; } break; } } } finally { subtitleLock.readLock().unlock(); } if (SUB_DEBUG) System.out.println("Got Subtitle text=" + rv + " subEntryPos=" + subEntryPos); return rv; }
Source:
<code>private static boolean testCompiler(final Context context, final File path) throws ExitException { if (Utils.isWindows()) { <START> return Utils.testCommand(context, path.getAbsolutePath(), "DSL Platform", Charset.forName("UTF-8")); <END> } else { final Either<String> mono = Mono.findMono(context); if (mono.isSuccess()) { return Utils.testCommand(context, mono.get(), "DSL Platform", Collections.singletonList(path.getAbsolutePath()), Charset.forName("UTF-8")); } else { context.error("Mono is required to run DSL compiler. Mono not detected or specified."); throw new ExitException(); } } }</code><technical_language>Test command is parsing custom output of compiler. This required</technical_language>

Target:
private static boolean testCompiler(final Context context, final File path) throws ExitException { if (Utils.isWindows()) { return Utils.testCommand(context, path.getAbsolutePath(), "DSL Platform"); } else { final Either<String> mono = Mono.findMono(context); if (mono.isSuccess()) { return Utils.testCommand(context, mono.get(), "DSL Platform", Collections.singletonList(path.getAbsolutePath())); } else { context.error("Mono is required to run DSL compiler. Mono not detected or specified."); throw new ExitException(); } } }
Source:
<code>public MachineImpl createMachineAsync(MachineConfig machineConfig, final String workspaceId, final String environmentName) throws NotFoundException, SnapshotException, ConflictException, MachineException, BadRequestException { return createMachine(normalizeMachineConfig(machineConfig), workspaceId, environmentName, (instanceProvider, machine, machineLogger) -> executor.execute(ThreadLocalPropagateContext.wrap(() -> { try { createInstance(instanceProvider, machine, machineLogger); } catch (MachineException | NotFoundException e) { if (e.getCause() instanceof InvalidRecipeException) { <START> LOG.warn(e.getLocalizedMessage()); <END> } else { LOG.error(e.getLocalizedMessage(), e); } } })), null); }</code><technical_language>log situation</technical_language>

Target:
public MachineImpl createMachineAsync(MachineConfig machineConfig, final String workspaceId, final String environmentName) throws NotFoundException, SnapshotException, ConflictException, MachineException, BadRequestException { return createMachine(normalizeMachineConfig(machineConfig), workspaceId, environmentName, (instanceProvider, machine, machineLogger) -> executor.execute(ThreadLocalPropagateContext.wrap(() -> { try { createInstance(instanceProvider, machine, machineLogger); } catch (MachineException | NotFoundException e) { if (!(e.getCause() instanceof InvalidRecipeException)) { LOG.error(e.getLocalizedMessage(), e); } } })), null); }
Source:
<code>public static void setup() throws SQLException { ServerTest.allocServer(); <START> HttpOp.setDefaultHttpClient(null); <END> connection = new RemoteEndpointConnection(ServerTest.serviceQuery, ServerTest.serviceUpdate, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT); connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH); }</code><technical_language>Hopefully, a pooling client, caching is this is unnecessary. (AbstractRemoteEndpointResultSetTests)</technical_language>

Target:
public static void setup() throws SQLException { ServerCtl.ctlBeforeClass(); connection = new RemoteEndpointConnection(ServerTest.serviceQuery, ServerTest.serviceUpdate, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT); connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH); }
Source:
<code>public CapabilityCollection getCapabilityCollection() { final List<AccessSection> allCapabilities = new ArrayList<AccessSection>(); ProjectState s = this; final Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(s.getProject().getNameKey()); do { final AccessSection capabilitiesSection = <START> s.getConfig().getAccessSection(AccessSection.GLOBAL_CAPABILITIES); <END> if (capabilitiesSection != null) { allCapabilities.add(capabilitiesSection); } if (s.isAllProjects) { break; } final Project.NameKey parent = s.getProject().getParent(); if (!seen.add(parent)) { break; } s = projectCache.get(parent); } while (s != null); return new CapabilityCollection(allCapabilities); }</code><technical_language>This is confusing, adding called GLOBAL_CAPABILITIES for project, is constant is longer appropriately named</technical_language>

Target:
public CapabilityCollection getCapabilityCollection() { final List<AccessSection> allCapabilities = new ArrayList<AccessSection>(); ProjectState s = this; final Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(s.getProject().getNameKey()); do { final AccessSection capabilitiesSection = s.getConfig().getAccessSection(AccessSection.CAPABILITIES); if (capabilitiesSection != null) { allCapabilities.add(capabilitiesSection); } if (s.isAllProjects) { break; } final Project.NameKey parent = s.getProject().getParent(); if (!seen.add(parent)) { break; } s = projectCache.get(parent); } while (s != null); return new CapabilityCollection(allCapabilities); }
Source:
<code>public static void main(String[] args) { String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .build(); String firstPartition = client.getPartitionIds().blockFirst(OPERATION_TIMEOUT); EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(firstPartition); EventHubProducer producer = client.createProducer(producerOptions); List<EventData> dataList = new ArrayList<>(); dataList.add(new EventData("EventData Sample 1".getBytes(UTF_8))); dataList.add(new EventData("EventData Sample 2 ".getBytes(UTF_8))); dataList.add(new EventData("EventData Sample 3".getBytes(UTF_8))); producer.send(dataList).subscribe( <START> (ignored) -> System.out.println("A list of Event sent."), <END> error -> { System.err.println("There was an error sending the event: " + error.toString()); if (error instanceof AmqpException) { AmqpException amqpException = (AmqpException) error; System.err.println(String.format("Is send operation retriable? %s. Error condition: %s", amqpException.isTransient(), amqpException.getErrorCondition())); } }, () -> { try { producer.close(); } catch (IOException e) { System.err.println("Error encountered while closing producer: " + e.toString()); } client.close(); }); }</code><technical_language>"Events sent."</technical_language>

Target:
public static void main(String[] args) { String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .buildAsyncClient(); String firstPartition = client.getPartitionIds().blockFirst(OPERATION_TIMEOUT); EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(firstPartition); EventHubProducer producer = client.createProducer(producerOptions); Flux<EventData> data = Flux.just( new EventData("EventData Sample 1".getBytes(UTF_8)), new EventData("EventData Sample 2".getBytes(UTF_8)), new EventData("EventData Sample 3".getBytes(UTF_8))); producer.send(data).subscribe( (ignored) -> System.out.println("Events sent."), error -> { System.err.println("There was an error sending the event: " + error.toString()); if (error instanceof AmqpException) { AmqpException amqpException = (AmqpException) error; System.err.println(String.format("Is send operation retriable? %s. Error condition: %s", amqpException.isTransient(), amqpException.getErrorCondition())); } }, () -> { try { producer.close(); } catch (IOException e) { System.err.println("Error encountered while closing producer: " + e.toString()); } client.close(); }); }
Source:
<code>public synchronized void refreshCache() { CacheManager manager = CacheManager.getInstance(); prefetchedCaches.loadPreFetchedBasicSearch(); <START> LOGGER.debug("Adding cache generation time to prefetched cache."); <END> CacheReplacer.replaceCache(manager.getCache(CacheNames.COLLECTIONS_LISTINGS), manager.getCache(CacheNames.COLLECTIONS_PREFETCHED_LISTINGS)); }</code><technical_language>This line happening anymore, right</technical_language>

Target:
public synchronized void refreshCache() { CacheManager manager = CacheManager.getInstance(); prefetchedCaches.loadPreFetchedBasicSearch(); LOGGER.debug("Replacing live listings collection cache with pre-fetched data."); CacheReplacer.replaceCache(manager.getCache(CacheNames.COLLECTIONS_LISTINGS), manager.getCache(CacheNames.COLLECTIONS_PREFETCHED_LISTINGS)); }
Source:
<code>public AttributeComputeTransform(String field, Class type, String cql) throws CQLException { this.field = field; this.type = type; this.cql = cql; <START> this.expression = ECQL.toExpression(cql); <END> }</code><technical_language>I setCql(...) method this is a single line assignment. This remove risk of editing behavior of setCql(...) vice versa</technical_language>

Target:
public AttributeComputeTransform(String field, Class type, String cql) throws CQLException { this.field = field; this.type = type; setCql(cql); }
Source:
<code>public ConflictGroup(Conflict conflict) { <START> this.conflict = conflict; <END> this.diffs.addAll(computeDiffs()); }</code><technical_language>Check this is null. Guava's preconditions: import static com.google.common.base.Preconditions.checkNotNull; ... this.conflict = checkNotNull(conflict);</technical_language>

Target:
public ConflictGroup(Conflict conflict) { this.conflict = checkNotNull(conflict); this.diffs.addAll(computeDiffs()); }
Source:
<code>private void endAction(CommandBase<?> commandBase, List<Guid> childCmdIds, boolean succeeded) { if (shouldExecuteEndMethod(commandBase)) { VdcReturnValueBase returnVal = commandBase.endAction(); if <START> (!commandBase.getReturnValue().getSucceeded() <END> && repeatEndMethodsOnFail(returnVal)) { if (repeatEndMethodsOnFail(returnVal)) { throw new EngineException(EngineError.ENGINE, String.format("Command %1$s id: '%2$s' endAction() " + "didn't complete successfully", commandBase.getActionType(), commandBase.getCommandId())); } else { log.info("Command '{}' id: '{}' end method execution failed, as the command isn't marked for " + "endAction() retries silently ignoring", commandBase.getActionType(), commandBase.getCommandId()); } } if (commandBase.getParameters().getParentCommand() == VdcActionType.Unknown) { CommandCoordinatorUtil.removeAllCommandsInHierarchy(commandBase.getCommandId()); } ExecutionHandler.endJob(commandBase.getExecutionContext(), succeeded); } }</code><technical_language>set 'returnVal' local variable. please</technical_language>

Target:
private void endAction(CommandBase<?> commandBase, List<Guid> childCmdIds, boolean succeeded) { if (shouldExecuteEndMethod(commandBase)) { VdcReturnValueBase returnVal = commandBase.endAction(); if (!returnVal.getSucceeded() && repeatEndMethodsOnFail(returnVal)) { if (repeatEndMethodsOnFail(returnVal)) { throw new EngineException(EngineError.ENGINE, String.format("Command %1$s id: '%2$s' endAction() " + "didn't complete successfully", commandBase.getActionType(), commandBase.getCommandId())); } else { log.warn("Command '{}' id: '{}' end method execution failed, as the command isn't marked for " + "endAction() retries silently ignoring", commandBase.getActionType(), commandBase.getCommandId()); } } if (commandBase.getParameters().getParentCommand() == VdcActionType.Unknown) { CommandCoordinatorUtil.removeAllCommandsInHierarchy(commandBase.getCommandId()); } ExecutionHandler.endJob(commandBase.getExecutionContext(), succeeded); } }
Source:
<code>private void publishTupleData(int portId, Object obj) { try { if (wsClient != null && wsClient.isConnectionOpen()) { HashMap<String, Object> map = new HashMap<>(); map.put("portId", String.valueOf(portId)); map.put("windowId", currentWindowId); map.put("tupleCount", totalTupleCount); map.put("data", obj); wsClient.publish(recordingNameTopic, map); } } catch (Exception ex) { if (shouldLog()) { <START> logger.warn("Error publishing tuple data {}", obj, ex); <END> } } }</code><technical_language>if obj.toString() throws exception, for example, obj a field set null obj.toString() expect null</technical_language>

Target:
private void publishTupleData(int portId, Object obj) { try { if (wsClient != null && wsClient.isConnectionOpen()) { HashMap<String, Object> map = new HashMap<>(); map.put("portId", String.valueOf(portId)); map.put("windowId", currentWindowId); map.put("tupleCount", totalTupleCount); map.put("data", obj); wsClient.publish(recordingNameTopic, map); } } catch (Exception ex) { if (ex instanceof JsonProcessingException) { checkLogTuple(ex, "publish", obj); } else { logger.warn("Error publishing tuple", ex); } } }
Source:
<code>private boolean internalTest(Object receiver, String property) { if (!(receiver instanceof IResource)) return false; IResource res = (IResource) receiver; if ("isContainer".equals(property)) { int type = res.getType(); return type == IResource.FOLDER || type == IResource.PROJECT; } RepositoryMapping mapping = RepositoryMapping.getMapping(res .getProject()); if (mapping != null) { <START> Repository repository = mapping.getRepository(); <END> if ("isStaged".equals(property)) { IndexDiffData indexDiffData = ResourceStateFactory.getInstance() .getIndexDiffDataOrNull(res); if (indexDiffData != null) { return ResourceStateFactory.getInstance() .get(indexDiffData, res) .staged() != Staged.NOT_STAGED; } } else if ("isIgnored".equals(property)) { IndexDiffData indexDiffData = ResourceStateFactory.getInstance() .getIndexDiffDataOrNull(res); if (indexDiffData != null) { return ResourceStateFactory.getInstance() .get(indexDiffData, res).isIgnored(); } } else if ("hasUnstagedChanges".equals(property)) { IndexDiffData indexDiffData = ResourceStateFactory.getInstance() .getIndexDiffDataOrNull(res); if (indexDiffData != null) { IResourceState state = ResourceStateFactory.getInstance() .get(indexDiffData, res); return !state.isTracked() || state.isDirty(); } } else { return testRepositoryState(repository, property); } } return false; }</code><technical_language>This 3 if's nicer if write IResourceState state = ResourceStateFactory.get(res); if(state != IResourceState.UNDEFINED){ return state.isStaged(); } if ... return ResourceStateFactory.get(res).isStaged(); else if ... return ResourceStateFactory.get(res).isIgnored(); else if ... return ResourceStateFactory.get(res).hasUnstaged(); assuming get @NonNull values factory</technical_language>

Target:
private boolean internalTest(Object receiver, String property) { if (!(receiver instanceof IResource)) return false; IResource res = (IResource) receiver; if ("isContainer".equals(property)) { int type = res.getType(); return type == IResource.FOLDER || type == IResource.PROJECT; } RepositoryMapping mapping = RepositoryMapping.getMapping(res .getProject()); if (mapping != null) { Repository repository = mapping.getRepository(); if ("isStaged".equals(property)) { return ResourceStateFactory.getInstance().get(res) .staged() != Staged.NOT_STAGED; } else if ("isIgnored".equals(property)) { return ResourceStateFactory.getInstance().get(res).isIgnored(); } else if ("hasUnstagedChanges".equals(property)) { IResourceState state = ResourceStateFactory.getInstance() .get(res); return !state.isTracked() || state.isDirty(); } else { return testRepositoryState(repository, property); } } return false; }
Source:
<code>public int delete(Uri uri, String selection, String[] selectionArgs) { if (!hasReadWritePermission()) { throwSecurityException("delete", uri); } Collection col = CollectionHelper.getInstance().getCol(mContext); if (col == null) { throw new IllegalStateException(COL_NULL_ERROR_MSG); } col.log(getLogMessage("delete", uri)); switch (sUriMatcher.match(uri)) { case NOTES_ID: col.remNotes(new long[]{Long.parseLong(uri.getPathSegments().get(1))}); return 1; case MODELS_ID_CARDS: <START> JSONObject model = getModel(getModelIdFromUri(uri, col), col); <END> if (model != null) { String emptyStr = uri.getQueryParameter(FlashCardsContract.Card.EMPTY_QUERY_PARAM); if (emptyStr != null) { boolean empty = Boolean.valueOf(emptyStr); if (empty) { List<Long> cids = col.genCards(col.getModels().nids(model)); col.remCards(Utils.arrayList2array(cids)); return cids.size(); } } } throw new UnsupportedOperationException("Only ?empty=true supported"); default: throw new UnsupportedOperationException(); } }</code><technical_language>I use: JSONObject model = col.getModels().get(getModelIdFromUri(uri, col));</technical_language>

Target:
public int delete(Uri uri, String selection, String[] selectionArgs) { if (!hasReadWritePermission()) { throwSecurityException("delete", uri); } Collection col = CollectionHelper.getInstance().getCol(mContext); if (col == null) { throw new IllegalStateException(COL_NULL_ERROR_MSG); } col.log(getLogMessage("delete", uri)); switch (sUriMatcher.match(uri)) { case NOTES_ID: col.remNotes(new long[]{Long.parseLong(uri.getPathSegments().get(1))}); return 1; case MODELS_ID_EMPTY_CARDS: JSONObject model = col.getModels().get(getModelIdFromUri(uri, col)); if (model != null) { List<Long> cids = col.genCards(col.getModels().nids(model)); col.remCards(Utils.arrayList2array(cids)); return cids.size(); } throw new UnsupportedOperationException("Only ?empty=true supported"); default: throw new UnsupportedOperationException(); } }
Source:
<code>public ExtraPlugin(Settings settings) { latencyListener = new SearchLatencyListener(settings); <START> loadService = new LoadService(settings, latencyListener, OsProbe.getInstance()); <END> }</code><technical_language>instead of building loadService in constructor a create MutableSupplier (see code in ltr plugin). QueryBuilders accepts Supplier<LoadService> call set method in createComponents needed build service class. allows dependent services final in class</technical_language>

Target:
public ExtraPlugin(Settings settings) { threadPoolSupplier = new MutableSupplier<>(); latencyListener = new SearchLatencyListener(settings, threadPoolSupplier); loadStats = new LoadService(latencyListener, new OsService(settings)); }