auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<SelectableData> getRating() { return asList( <START> new SelectableData("5 Stars", "5", cms.getOrEmpty("ratingFiveStarText"), "", false), <END> new SelectableData("4 Stars", "4", cms.getOrEmpty("ratingFourStarText"), "", false), new SelectableData("3 Stars", "3", cms.getOrEmpty("ratingThreeStarText"), "", false), new SelectableData("2 Stars", "2", cms.getOrEmpty("ratingTwoStarText"), "", false), new SelectableData("1 Stars", "1", cms.getOrEmpty("ratingOneStarText"), "", false)); }</code><technical_language>@lauraluiz I translations _not_ CMS messages</technical_language>

Target:
public List<SelectableData> getRating() { return rating; }
Source:
<code>protected Mono<BulkResponse> checkForBulkOperationFailure(BulkResponse bulkResponse) { if (bulkResponse.hasFailures()) { Map<String, String> failedDocuments = new HashMap<>(); for (BulkItemResponse item : bulkResponse.getItems()) { <START> if (item.isFailed()) failedDocuments.put(item.getId(), item.getFailureMessage()); } <END> ElasticsearchException exception = new ElasticsearchException( "Bulk operation has failures. Use ElasticsearchException.getFailedDocuments() for detailed messages [" + failedDocuments + ']', failedDocuments); return Mono.error(exception); } else { return Mono.just(bulkResponse); } }</code><technical_language>please put if branch in {}</technical_language>

Target:
protected Mono<BulkResponse> checkForBulkOperationFailure(BulkResponse bulkResponse) { if (bulkResponse.hasFailures()) { Map<String, String> failedDocuments = new HashMap<>(); for (BulkItemResponse item : bulkResponse.getItems()) { if (item.isFailed()) { failedDocuments.put(item.getId(), item.getFailureMessage()); } } ElasticsearchException exception = new ElasticsearchException( "Bulk operation has failures. Use ElasticsearchException.getFailedDocuments() for detailed messages [" + failedDocuments + ']', failedDocuments); return Mono.error(exception); } else { return Mono.just(bulkResponse); } }
Source:
<code>private static void addBootProtocol(Map<String, Object> cfg, VdsNetworkInterface iface) { NetworkBootProtocol bootproto = NetworkBootProtocol.None; if (cfg != null) { String bootProtocol = (String) cfg.get("BOOTPROTO"); if (bootProtocol != null) { if (bootProtocol.toLowerCase().equals("dhcp")) { <START> bootproto = NetworkBootProtocol.Dhcp; <END> } else if (bootProtocol.toLowerCase().equals("static")) { bootproto = NetworkBootProtocol.StaticIp; } else if (bootProtocol.toLowerCase().equals("none")) { if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } } } else if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } if (bootproto == NetworkBootProtocol.StaticIp) { String gateway = (String) cfg.get(VdsProperties.gateway); if (StringUtils.isNotEmpty(gateway)) { setGatewayIfManagementNetwork(iface, gateway.toString()); } } } iface.setBootProtocol(bootproto); }</code><technical_language>please unified static</technical_language>

Target:
private static void addBootProtocol(Map<String, Object> cfg, VdsNetworkInterface iface) { NetworkBootProtocol bootproto = NetworkBootProtocol.None; if (cfg != null) { String bootProtocol = (String) cfg.get("BOOTPROTO"); if (bootProtocol != null) { if (bootProtocol.toLowerCase().equals("dhcp")) { bootproto = NetworkBootProtocol.Dhcp; } else if (bootProtocol.toLowerCase().equals("none") || bootProtocol.toLowerCase().equals("static")) { if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } } } else if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } if (bootproto == NetworkBootProtocol.StaticIp) { String gateway = (String) cfg.get(VdsProperties.gateway); if (StringUtils.isNotEmpty(gateway)) { setGatewayIfManagementNetwork(iface, gateway.toString()); } } } iface.setBootProtocol(bootproto); }
Source:
<code>public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.collector = collector; if (this.config == null) { config.configure(conf); <START> } <END> zkState = new ZkState(conf, config); coordinator = new PartitionCoordinator(conf, config, context, zkState); lastUpdateMs = System.currentTimeMillis(); }</code><technical_language>throw NPE</technical_language>

Target:
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.collector = collector; if (this.config == null) { config = new KafkaSpoutConfig(); config.configure(conf); } zkState = new ZkState(conf, config); coordinator = new PartitionCoordinator(conf, config, context, zkState); lastUpdateMs = System.currentTimeMillis(); }
Source:
<code><START> public abstract void runMergeStrategy() throws MergeException; <END> public void verifyMergeability(Change change) { try { openRepository(); final Ref destBranchRef = db.getRef(destBranch.get()); submitted = new ArrayList<Change>(); submitted.add(change); if ((destBranchRef == null && change.getLastSha1MergeTested() == null) || change.getLastSha1MergeTested() == null || (destBranchRef != null && !destBranchRef.getObjectId().getName() .equals(change.getLastSha1MergeTested().get()))) { schema = mArguments.schemaFactory.open(); preMerge(); if (destBranchRef != null) { change.setLastSha1MergeTested(new RevId(destBranchRef .getObjectId().getName())); } else { change.setLastSha1MergeTested(new RevId("")); } change.setMergeable(isMergeable(change)); schema.changes().update(Collections.singleton(change)); } } catch (MergeException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } catch (OrmException e) { log.error("Test merge attempt for change: " + change.getId() + " failed: Not able to query the database", e); } catch (IOException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } finally { if (schema != null) { schema.close(); } schema = null; } }</code><technical_language>Is this method meant public? protected</technical_language>

Target:
protected abstract void runMergeStrategy() throws MergeException; public final void verifyMergeability(Change change) { try { openRepository(); final Ref destBranchRef = db.getRef(destBranch.get()); submitted = new ArrayList<Change>(); submitted.add(change); if ((destBranchRef == null && change.getLastSha1MergeTested() == null) || change.getLastSha1MergeTested() == null || (destBranchRef != null && !destBranchRef.getObjectId().getName() .equals(change.getLastSha1MergeTested().get()))) { schema = mArguments.schemaFactory.open(); preMerge(); if (destBranchRef != null) { change.setLastSha1MergeTested(new RevId(destBranchRef .getObjectId().getName())); } else { change.setLastSha1MergeTested(new RevId("")); } change.setMergeable(isMergeable(change)); schema.changes().update(Collections.singleton(change)); } } catch (MergeException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } catch (OrmException e) { log.error("Test merge attempt for change: " + change.getId() + " failed: Not able to query the database", e); } catch (IOException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } finally { if (schema != null) { schema.close(); } schema = null; } }
Source:
<code>protected String enumValueToSchemaString(Enum<?> value) { <START> String enumValue = value.name(); <END> String enumName; String[] aliases = null; if(value instanceof HasName) { enumName = ((HasName)value).getName(); } else { enumName = String.valueOf(value); } if(value instanceof HasAliases) { aliases = ((HasAliases)value).getAliases(); } return Serializator.enumValueToSchemaString(enumValue, enumName, aliases); }</code><technical_language>This final</technical_language>

Target:
protected String enumValueToSchemaString(Enum<?> value) { final String enumValue = value.name(); String enumName; String[] aliases = null; if(value instanceof HasName) { enumName = ((HasName)value).getName(); } else { enumName = String.valueOf(value); } if(value instanceof HasAliases) { aliases = ((HasAliases)value).getAliases(); } return Serializator.enumValueToSchemaString(enumValue, enumName, aliases); }
Source:
<code>public boolean getBroadcastEnabled(SystemStream systemStream) { <START> return java.lang.Boolean.parseBoolean(getSamzaProperty(systemStream, BROADCAST)); <END> }</code><technical_language>Minor: java.lang. unnecessary</technical_language>

Target:
public boolean getBroadcastEnabled(SystemStream systemStream) { return Boolean.parseBoolean(getSamzaProperty(systemStream, BROADCAST)); }
Source:
<code>public static <P extends VdcActionParametersBase> CommandBase<P> CreateCommand(VdcActionType action, P parameters) { injector.bindBeanManager(); <START> <END> try { Constructor<CommandBase<? extends VdcActionParametersBase>> constructor = findCommandConstructor(getCommandClass(action.name(), CommandSuffix), parameters.getClass()); CommandBase<P> cmd = (CommandBase<P>) constructor.newInstance(new Object[] { parameters }); injector.inject(cmd); return cmd; } catch (Exception e) { log.error( "CommandsFactory [parameter: VdcActionParametersBase]: Failed to get type information using " + "reflection for Action: " + action, e); return null; } }</code><technical_language>need perform lookup time create a command</technical_language>

Target:
public static <P extends VdcActionParametersBase> CommandBase<P> CreateCommand(VdcActionType action, P parameters) { try { Constructor<CommandBase<? extends VdcActionParametersBase>> constructor = findCommandConstructor(getCommandClass(action.name(), CommandSuffix), parameters.getClass()); CommandBase<P> cmd = (CommandBase<P>) constructor.newInstance(new Object[] { parameters }); injector.inject(cmd); return cmd; } catch (Exception e) { log.error( "CommandsFactory [parameter: VdcActionParametersBase]: Failed to get type information using " + "reflection for Action: " + action, e); return null; } }
Source:
<code>public void obtain_date_in_past_before_specified_number_of_years() { final Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.YEAR, -1); final LocalDate today = LocalDates.now(); final LocalDate yearAgo = LocalDates.minusYears(today, 1); <START> assertEquals(calendar.get(Calendar.YEAR), yearAgo.getYear()); <END> assertEquals(calendar.get(Calendar.MONTH) + 1, yearAgo.getMonthValue()); assertEquals(calendar.get(Calendar.DAY_OF_MONTH), yearAgo.getDay()); }</code><technical_language>Please extract static method getYear() assertion arguments shorter</technical_language>

Target:
public void obtain_date_in_past_before_specified_number_of_years() { final int yearsToSubstract = 2; final LocalDate localDate = LocalDates.of(year, month, day); final LocalDate fewYearsAgo = LocalDates.minusYears(localDate, yearsToSubstract); assertTrue(year - yearsToSubstract == fewYearsAgo.getYear()); assertTrue(month == fewYearsAgo.getMonth()); assertTrue(day == fewYearsAgo.getDay()); }
Source:
<code>public void test() { <START> JavaCheckVerifier.verify("src/test/files/checks/security/CookieHttpOnlyCheck.java", new CookieHttpOnlyCheck()); <END> }</code><technical_language>duplicate this line "JavaCheckVerifier.verifyNoIssueWithoutSemantic"</technical_language>

Target:
public void test() { JavaCheckVerifier.verify("src/test/files/checks/security/CookieHttpOnlyCheck.java", new CookieHttpOnlyCheck()); JavaCheckVerifier.verifyNoIssueWithoutSemantic("src/test/files/checks/security/CookieHttpOnlyCheck.java", new CookieHttpOnlyCheck()); }
Source:
<code><START> public ScoreWithSource() { <END> this(null, null); }</code><technical_language>Package protected instead of public</technical_language>

Target:
ScoreWithSource() { this(null, null); }
Source:
<code>public Operator createOperator(DriverContext driverContext) { checkState(!closed, "Factory is already closed"); OperatorContext operatorContext = driverContext.addOperatorContext(operatorId, planNodeId, HashBuilderOperator.class.getSimpleName()); <START> return new SpatialJoinOperator(operatorContext, getTypes(), probeTypes, probeOutputChannels, probeGeometryChannel, pagesSpatialIndexFactory.createPagesSpatialIndex(), spatialRelationshipTest); <END> }</code><technical_language>split lines</technical_language>

Target:
public Operator createOperator(DriverContext driverContext) { checkState(!closed, "Factory is already closed"); OperatorContext operatorContext = driverContext.addOperatorContext( operatorId, planNodeId, SpatialJoinOperator.class.getSimpleName()); return new SpatialJoinOperator( operatorContext, getTypes(), probeTypes, probeOutputChannels, probeGeometryChannel, pagesSpatialIndexFactory); }
Source:
<code>int getChildCount() { <START> return getChildren().size(); <END> }</code><technical_language>above...again get size model creating another list. If PR apply this principle, great. "@" changes I another look. Thanks for PR a good API change for application developers</technical_language>

Target:
int getChildCount() { ComponentModel model = getComponentModel(); return (model.getChildren() == null ? 0 : model.getChildren().size()); }
Source:
<code>public void deleteRoles(List<Role> roles) { EKBCommit commit = getEKBCommit(); preparePersistenceAccess(); for (Role role : roles) { <START> List<Role> result = queryService.queryByString(Role.class, "name:\"" + role.getName() + "\""); <END> if (result.size() == 0) { LOGGER.warn("User {1} does not exist.", role.getName()); } else { commit.addDelete(role); } } persistService.commit(commit); revokePersistenceAccess(); }</code><technical_language>query(QueryRequest) method</technical_language>

Target:
public void deleteRoles(List<Role> roles) { EKBCommit commit = getEKBCommit(); preparePersistenceAccess(); for (Role role : roles) { List<Role> result = queryService.query(Role.class, QueryRequest.query("name", role.getName())); if (result.size() == 0) { LOGGER.warn("User {1} does not exist.", role.getName()); } else { commit.addDelete(role); } } persistService.commit(commit); revokePersistenceAccess(); }
Source:
<code><START> public UserDetailsService userDetailsService() { <END> return new InMemoryUserDetailsManager( User.builder() .passwordEncoder(it-> PasswordEncoderFactories.createDelegatingPasswordEncoder().encode(it)) .username("user") .password("password") .roles("USER") .build() ); }</code><technical_language>Is this change necessary? User.withDefaultPasswordEncoder is deprecated, is acceptable in tests</technical_language>

Target:
public UserDetailsService userDetailsService() { return new InMemoryUserDetailsManager( User.withDefaultPasswordEncoder() .username("user") .password("password") .roles("USER") .build() ); }
Source:
<code>void doOnProcessorChange(List<String> processors) { List<String> currentProcessorIds = getActualProcessorIds(processors); Set<String> uniqueProcessorIds = new HashSet<String>(currentProcessorIds); if (currentProcessorIds.size() != uniqueProcessorIds.size()) { LOG.info("Processors: has duplicates. Not generating job model.", currentProcessorIds); return; } JobModel jobModel = generateNewJobModel(currentProcessorIds); JobModelManager.createChangeLogStreams(new StorageConfig(config), jobModel.maxChangeLogStreamPartitions); <START> String currentJMVersion = zkUtils.getJobModelVersion(); <END> String nextJMVersion; if (currentJMVersion == null) { nextJMVersion = "1"; } else { nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); } LOG.info("pid=" + processorId + "Generated new Job Model. Version = " + nextJMVersion); zkUtils.publishJobModel(nextJMVersion, jobModel); barrier.create(nextJMVersion, currentProcessorIds); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); LOG.info("pid=" + processorId + "Published new Job Model. Version = " + nextJMVersion); debounceTimer.scheduleAfterDebounceTime(ON_ZK_CLEANUP, 0, () -> zkUtils.cleanupZK(NUM_VERSIONS_TO_LEAVE)); }</code><technical_language>is maxChangeLogStreamPartitions set JobModel</technical_language>

Target:
void doOnProcessorChange(List<String> processors) { List<String> currentProcessorIds = getActualProcessorIds(processors); Set<String> uniqueProcessorIds = new HashSet<String>(currentProcessorIds); if (currentProcessorIds.size() != uniqueProcessorIds.size()) { LOG.info("Processors: has duplicates. Not generating job model.", currentProcessorIds); return; } JobModel jobModel = generateNewJobModel(currentProcessorIds); if (!hasCreatedChangeLogStreams) { JobModelManager.createChangeLogStreams(new StorageConfig(config), jobModel.maxChangeLogStreamPartitions); hasCreatedChangeLogStreams = true; } String currentJMVersion = zkUtils.getJobModelVersion(); String nextJMVersion; if (currentJMVersion == null) { nextJMVersion = "1"; } else { nextJMVersion = Integer.toString(Integer.valueOf(currentJMVersion) + 1); } LOG.info("pid=" + processorId + "Generated new Job Model. Version = " + nextJMVersion); zkUtils.publishJobModel(nextJMVersion, jobModel); barrier.create(nextJMVersion, currentProcessorIds); zkUtils.publishJobModelVersion(currentJMVersion, nextJMVersion); LOG.info("pid=" + processorId + "Published new Job Model. Version = " + nextJMVersion); debounceTimer.scheduleAfterDebounceTime(ON_ZK_CLEANUP, 0, () -> zkUtils.cleanupZK(NUM_VERSIONS_TO_LEAVE)); }
Source:
<code>public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, Messages.LoadTargetOperation_mainTaskName, 40); try { <START> subMon.checkCanceled(); <END> if (!fTarget.isResolved()) { fTarget.resolve(subMon.split(20)); } subMon.checkCanceled(); subMon.setWorkRemaining(20); PDEPreferencesManager preferences = PDECore.getDefault().getPreferencesManager(); ((TargetPlatformService) TargetPlatformService.getDefault()).setWorkspaceTargetDefinition(fTarget); String memento = fTarget.getHandle().getMemento(); if (fNone) { memento = ICoreConstants.NO_TARGET; } if (memento.equals(preferences.getString(ICoreConstants.WORKSPACE_TARGET_HANDLE))) { preferences.setValue(ICoreConstants.WORKSPACE_TARGET_HANDLE, ""); } preferences.setValue(ICoreConstants.WORKSPACE_TARGET_HANDLE, memento); clearDeprecatedPreferences(preferences, subMon.split(3)); loadJRE(subMon.split(3)); PDECore.getDefault().getPreferencesManager().savePluginPreferences(); resetPlatform(subMon.split(14)); } catch (OperationCanceledException e) { return Status.CANCEL_STATUS; } finally { if (monitor != null) { monitor.done(); } } return Status.OK_STATUS; }</code><technical_language>picky now, more readable move SubMonitor try block do checkCanceled expression? try { SubMonitor subMon = SubMonitor.convert(monitor, Messages.LoadTargetOperation_mainTaskName, 40).checkCanceled(); ...</technical_language>

Target:
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { try { SubMonitor subMon = SubMonitor.convert(monitor, Messages.LoadTargetOperation_mainTaskName, 40) .checkCanceled(); if (!fTarget.isResolved()) { fTarget.resolve(subMon.split(20)); } subMon.checkCanceled(); subMon.setWorkRemaining(20); PDEPreferencesManager preferences = PDECore.getDefault().getPreferencesManager(); ((TargetPlatformService) TargetPlatformService.getDefault()).setWorkspaceTargetDefinition(fTarget); String memento = fTarget.getHandle().getMemento(); if (fNone) { memento = ICoreConstants.NO_TARGET; } if (memento.equals(preferences.getString(ICoreConstants.WORKSPACE_TARGET_HANDLE))) { preferences.setValue(ICoreConstants.WORKSPACE_TARGET_HANDLE, ""); } preferences.setValue(ICoreConstants.WORKSPACE_TARGET_HANDLE, memento); clearDeprecatedPreferences(preferences, subMon.split(3)); loadJRE(subMon.split(3)); PDECore.getDefault().getPreferencesManager().savePluginPreferences(); resetPlatform(subMon.split(14)); } catch (OperationCanceledException e) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; }
Source:
<code>public ByteUiColumn( final List<HeaderMetaData> headerMetaData, final double width, final boolean isResizable, final boolean isVisible, final GuidedDecisionTablePresenter.Access access, final TextBoxByteSingletonDOMElementFactory factory ) { super( headerMetaData, new CellRenderer<Byte, NumericByteTextBox, TextBoxDOMElement<Byte, NumericByteTextBox>>( factory ) { @Override protected void doRenderCellContent( final Text t, final Byte value, final GridBodyCellRenderContext context ) { <START> t.setText( value.toString() ); <END> } }, width, isResizable, isVisible, access, factory ); }</code><technical_language>Byte.toString() a bit lower, line 63, ..Factory.convert(..) - unify</technical_language>

Target:
public ByteUiColumn( final List<HeaderMetaData> headerMetaData, final double width, final boolean isResizable, final boolean isVisible, final GuidedDecisionTablePresenter.Access access, final TextBoxByteSingletonDOMElementFactory factory ) { super( headerMetaData, new CellRenderer<Byte, NumericByteTextBox, TextBoxDOMElement<Byte, NumericByteTextBox>>( factory ) { @Override protected void doRenderCellContent( final Text t, final Byte value, final GridBodyCellRenderContext context ) { t.setText( ( (TextBoxByteSingletonDOMElementFactory) factory ).convert( value ) ); } }, width, isResizable, isVisible, access, factory ); }
Source:
<code>public void run() { if (!stop.get() && !serverSockets.isEmpty()) { ExecutorService executor = Executors.newFixedThreadPool(serverSockets.size()); CountDownLatch latch = new CountDownLatch(serverSockets.size()); serverSockets.forEach(serverSocket -> executor.submit(new LearnerCnxAcceptorHandler(serverSocket, latch))); try { <START> latch.await(); <END> } catch (InterruptedException ie) { LOG.error("Interrupted while sleeping. " + "Ignoring exception", ie); } finally { closeSockets(); } } }</code><technical_language>a timeout here</technical_language>

Target:
public void run() { if (!stop.get() && !serverSockets.isEmpty()) { ExecutorService executor = Executors.newFixedThreadPool(serverSockets.size()); CountDownLatch latch = new CountDownLatch(serverSockets.size()); serverSockets.forEach(serverSocket -> executor.submit(new LearnerCnxAcceptorHandler(serverSocket, latch))); try { latch.await(); } catch (InterruptedException ie) { LOG.error("Interrupted while sleeping in LearnerCnxAcceptor.", ie); } finally { closeSockets(); executor.shutdown(); try { if (!executor.awaitTermination(1, TimeUnit.SECONDS)) { LOG.error("not all the LearnerCnxAcceptorHandler terminated properly"); } } catch (InterruptedException ie) { LOG.error("Interrupted while terminating LearnerCnxAcceptor.", ie); } } } }
Source:
<code>private BasicDBObject createDiscriminatorFilter(OgmEntityPersister entityPersister, String discriminatorColumnName) { final Object discriminatorValue = entityPersister.getDiscriminatorValue(); BasicDBObject discriminatorFilter = null; @SuppressWarnings("unchecked") Set<String> subclassEntityNames = entityPersister.getEntityMetamodel().getSubclassEntityNames(); if ( subclassEntityNames.size() == 1 ) { discriminatorFilter = new BasicDBObject( discriminatorColumnName, discriminatorValue ); } else { <START> Set<Object> discrimiantorValues = new HashSet<>(); <END> discrimiantorValues.add( discriminatorValue ); for ( String subclass : subclassEntityNames ) { OgmEntityPersister subclassPersister = (OgmEntityPersister) sessionFactory.getEntityPersister( subclass ); Object subDiscriminatorValue = subclassPersister.getDiscriminatorValue(); discrimiantorValues.add( subDiscriminatorValue ); } discriminatorFilter = new BasicDBObject( discriminatorColumnName, new BasicDBObject( "$in", discrimiantorValues ) ); } return discriminatorFilter; }</code><technical_language>s/discrimiantorValues/discriminatorValues/</technical_language>

Target:
private BasicDBObject createDiscriminatorFilter(OgmEntityPersister entityPersister, String discriminatorColumnName) { final Object discriminatorValue = entityPersister.getDiscriminatorValue(); BasicDBObject discriminatorFilter = null; @SuppressWarnings("unchecked") Set<String> subclassEntityNames = entityPersister.getEntityMetamodel().getSubclassEntityNames(); if ( subclassEntityNames.size() == 1 ) { discriminatorFilter = new BasicDBObject( discriminatorColumnName, discriminatorValue ); } else { Set<Object> discriminatorValues = new HashSet<>(); discriminatorValues.add( discriminatorValue ); for ( String subclass : subclassEntityNames ) { OgmEntityPersister subclassPersister = (OgmEntityPersister) sessionFactory.getEntityPersister( subclass ); Object subDiscriminatorValue = subclassPersister.getDiscriminatorValue(); discriminatorValues.add( subDiscriminatorValue ); } discriminatorFilter = new BasicDBObject( discriminatorColumnName, new BasicDBObject( "$in", discriminatorValues ) ); } return discriminatorFilter; }
Source:
<code>private void initAllModels(boolean fetchFromBackend) { if (fetchFromBackend) { startProgress(); queryLabels(); <START> queryVfMap(); <END> } else { initLabelModels(); initNetworkModels(); initNicModels(); } }</code><technical_language>queryLabels invokes a chain of queries final initiates class models. add query chain (it one). query parallel chain is chance chain finished query back. NPE in models initialization assumes vfMap is null</technical_language>

Target:
private void initAllModels(boolean fetchFromBackend) { if (fetchFromBackend) { startProgress(); queryLabels(); } else { initLabelModels(); initNetworkModels(); initNicModels(); } }
Source:
<code>public void deletePublishAuditStatus(final String bundleId) throws DotPublisherException { try { Logger.info(this, "Deleting the bundle: " + bundleId); new DotConnect() .setSQL(DELETE_BY_BUNDLEID) .addParam(bundleId) .loadResult(); } catch(Exception e) { <START> Logger.error(PublishAuditAPIImpl.class, e.getMessage(), e); <END> throw new DotPublisherException( "Unable to remove element in publish queue audit table:" + "with the following bundle_id "+bundleId+" "+ e.getMessage(), e); } }</code><technical_language>Please log Bundle ID data here</technical_language>

Target:
public void deletePublishAuditStatus(final String bundleId) throws DotPublisherException { try { Logger.info(this, "Deleting the bundle: " + bundleId); new DotConnect() .setSQL(DELETE_BY_BUNDLEID) .addParam(bundleId) .loadResult(); } catch(Exception e) { Logger.error(PublishAuditAPIImpl.class, "Unable to remove element in publish queue audit table:" + "with the following bundle_id "+bundleId, e); throw new DotPublisherException( "Unable to remove element in publish queue audit table:" + "with the following bundle_id "+bundleId+" "+ e.getMessage(), e); } }
Source:
<code><START> public AbstractJsonGetter(Getter parent) { <END> super(parent); }</code><technical_language>Minor: decrease visibility modifier for some methods change some methods static</technical_language>

Target:
AbstractJsonGetter(Getter parent) { super(parent); }
Source:
<code>public void update(Object objectToUpdate) { <START> PersistentEntity<?, ? extends PersistentProperty> entity = this.mappingContext.getPersistentEntity(ClassUtils <END> .getUserClass(objectToUpdate)); if (!entity.hasIdProperty()) { throw new InvalidDataAccessApiUsageException(String.format("Cannot determine id for type %s", ClassUtils.getUserClass(objectToUpdate))); } Serializable id = BeanWrapper.create(objectToUpdate, null).getProperty(entity.getIdProperty(), Serializable.class); update(id, objectToUpdate); }</code><technical_language>PersistentEntity<?, ? extends PersistentProperty<?>> remove warnings</technical_language>

Target:
public void update(Object objectToUpdate) { PersistentEntity<?, ? extends PersistentProperty> entity = this.mappingContext.getPersistentEntity(ClassUtils .getUserClass(objectToUpdate)); if (!entity.hasIdProperty()) { throw new InvalidDataAccessApiUsageException(String.format("Cannot determine id for type %s", ClassUtils.getUserClass(objectToUpdate))); } update((Serializable) entity.getIdentifierAccessor(objectToUpdate).getIdentifier(), objectToUpdate); }
Source:
<code>public void testUnauthorized() throws Exception { ContextMapper classUnderTest = new ContextMapper(CONTEXT); HttpServletRequest originalRequest = createMockRequest("/plugins/", PLUGIN_NAME + "/" + RESOURCE); HttpServletRequest result = classUnderTest.create(originalRequest, PLUGIN_NAME); assertEquals(CONTEXT + "/plugins/" + PLUGIN_NAME, result.getContextPath()); assertEquals("", result.getServletPath()); assertEquals("/" + RESOURCE, result.getPathInfo()); assertEquals(CONTEXT + "/plugins/" + <START> (PLUGIN_NAME <END> + "/" + RESOURCE), result.getRequestURI()); }</code><technical_language>unneeded parentheses</technical_language>

Target:
public void testUnauthorized() throws Exception { ContextMapper classUnderTest = new ContextMapper(CONTEXT); HttpServletRequest originalRequest = createMockRequest("/plugins/", PLUGIN_NAME + "/" + RESOURCE); HttpServletRequest result = classUnderTest.create(originalRequest, PLUGIN_NAME); assertEquals(CONTEXT + "/plugins/" + PLUGIN_NAME, result.getContextPath()); assertEquals("", result.getServletPath()); assertEquals("/" + RESOURCE, result.getPathInfo()); assertEquals(CONTEXT + "/plugins/" + PLUGIN_NAME + "/" + RESOURCE, result.getRequestURI()); }
Source:
<code>public List<Pipeline> getPipelinesSync(long timeoutMillis) throws TimeoutException { long start = System.currentTimeMillis(); while (pipelines == null) { try { long elapsed = System.currentTimeMillis() - start; if (elapsed > timeoutMillis) { throw new TimeoutException("Pipeline configs are still not available after " + elapsed + "ms"); } log.trace("Waiting for initial load of pipeline configs (elapsed={}ms)...", elapsed); <START> Thread.sleep(100); <END> } catch (InterruptedException e) { } } return pipelines; }</code><technical_language>Is this worth making configurable</technical_language>

Target:
public List<Pipeline> getPipelinesSync(long timeoutMillis) throws TimeoutException { long start = System.currentTimeMillis(); while (pipelines == null) { try { long elapsed = System.currentTimeMillis() - start; if (elapsed > timeoutMillis) { throw new TimeoutException("Pipeline configs are still not available after " + elapsed + "ms"); } log.trace("Waiting for initial load of pipeline configs (elapsed={}ms)...", elapsed); Thread.sleep(pollingSleepMs); } catch (InterruptedException e) { } } return pipelines; }
Source:
<code>public void before() { fBot = new SWTWorkbenchBot(); SWTBotUtils.openView(CALLGRAPHDENSITY_ID); SWTBotView view = fBot.viewById(CALLGRAPHDENSITY_ID); assertNotNull(view); fView = view; fFuncDensityView = UIThreadRunnable.syncExec((Result<CallGraphDensityView>) () -> { IViewPart viewRef = fView.getViewReference().getView(true); return (viewRef instanceof CallGraphDensityView) ? (CallGraphDensityView) viewRef : null; }); assertNotNull(fFuncDensityView); fTableBot = fView.bot().table(); fDensityBot = fView.bot().canvas(); <START> assertNotNull(fDensityBot); <END> fDensityViewer = fFuncDensityView.getDensityViewer(); assertNotNull(fDensityViewer); fTableViewer = fFuncDensityView.getTableViewer(); assertNotNull(fTableViewer); ActionFactory.MAXIMIZE.create(fFuncDensityView.getViewSite().getWorkbenchWindow()).run(); }</code><technical_language>assertNotNull(fTableBot)</technical_language>

Target:
public void before() { fBot = new SWTWorkbenchBot(); SWTBotUtils.openView(CALLGRAPHDENSITY_ID); SWTBotView view = fBot.viewById(CALLGRAPHDENSITY_ID); assertNotNull(view); fView = view; CallGraphDensityView funcDensityView = UIThreadRunnable.syncExec((Result<CallGraphDensityView>) () -> { IViewPart viewRef = fView.getViewReference().getView(true); return (viewRef instanceof CallGraphDensityView) ? (CallGraphDensityView) viewRef : null; }); assertNotNull(funcDensityView); fTableBot = fView.bot().table(); assertNotNull(fTableBot); fDensityBot = fView.bot().canvas(); assertNotNull(fDensityBot); fDensityViewer = funcDensityView.getDensityViewer(); fLatch = new CountDownLatch(1); fDensityViewer.removeDataListener(fSyncListener); fDensityViewer.addDataListener(fSyncListener); assertNotNull(fDensityViewer); fTableViewer = funcDensityView.getTableViewer(); assertNotNull(fTableViewer); SWTBotUtils.maximize(funcDensityView); fFuncDensityView = funcDensityView; }
Source:
<code>public boolean pathIsWritable(final Path path) throws IOException { Preconditions.checkNotNull(path, "path must not be null."); if (Platform.isWindows()) { return Files.isWritable(path); } else { final PosixFileAttributes attributes = Files.getFileAttributeView(path, PosixFileAttributeView.class).readAttributes(); final Set<PosixFilePermission> permissions = attributes.permissions(); if (permissions.contains(PosixFilePermission.OWNER_WRITE) || permissions.contains(PosixFilePermission.GROUP_WRITE) || permissions.contains(PosixFilePermission.OTHERS_WRITE)) { return true; } <START> return false; <END> } }</code><technical_language>combined if: return permissions.contains(PosixFilePermission.OWNER_WRITE) || permissions.contains(PosixFilePermission.GROUP_WRITE) || permissions.contains(PosixFilePermission.OTHERS_WRITE);</technical_language>

Target:
public boolean pathIsWritable(final Path path) throws IOException { Preconditions.checkNotNull(path, "path must not be null."); if (Platform.isWindows()) { return Files.isWritable(path); } else { final PosixFileAttributes attributes = Files.getFileAttributeView(path, PosixFileAttributeView.class).readAttributes(); final Set<PosixFilePermission> permissions = attributes.permissions(); return permissions.contains(PosixFilePermission.OWNER_WRITE) || permissions.contains(PosixFilePermission.GROUP_WRITE) || permissions.contains(PosixFilePermission.OTHERS_WRITE); } }
Source:
<code>public static void setWebViewRendererClient( final WebView webView, final Executor executor, final WebViewRendererClient webViewRendererClient) { <START> InstrumentationRegistry.getInstrumentation().runOnMainSync(new <END> Runnable() { @Override public void run() { WebViewCompat.setWebViewRendererClient(webView, executor, webViewRendererClient); } }); }</code><technical_language>WebkitUtils? follow up</technical_language>

Target:
public static void setWebViewRendererClient( final WebView webView, final Executor executor, final WebViewRendererClient webViewRendererClient) { WebkitUtils.onMainThreadSync(new Runnable() { @Override public void run() { WebViewCompat.setWebViewRendererClient(webView, executor, webViewRendererClient); } }); }
Source:
<code>public Optional<Alert> get(final UUID identifier, final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Getting alert") .addData("alertId", identifier) <START> .addData("organization.uuid", organization.getId()) <END> .log(); final models.ebean.Alert ebeanAlert = Ebean.find(models.ebean.Alert.class) .where() .eq("uuid", identifier) .eq("organization.uuid", organization.getId()) .findUnique(); if (ebeanAlert == null) { return Optional.empty(); } return Optional.of(convertFromEbeanAlert(ebeanAlert)); }</code><technical_language>add entire organization debug statement</technical_language>

Target:
public Optional<Alert> get(final UUID identifier, final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Getting alert") .addData("alertId", identifier) .addData("organization", organization) .log(); final models.ebean.Alert ebeanAlert = Ebean.find(models.ebean.Alert.class) .where() .eq("uuid", identifier) .eq("organization.uuid", organization.getId()) .findUnique(); if (ebeanAlert == null) { return Optional.empty(); } return Optional.of(convertFromEbeanAlert(ebeanAlert)); }
Source:
<code>private void testTRSConversion(final List<ToolVersion> versions, final String snapShottedVersionName, final int numImages) { assertFalse("Should have at least one version", versions.isEmpty()); boolean snapshotInList = false; for (ToolVersion trsVersion : versions) { if (trsVersion.getName().equals(snapShottedVersionName)) { assertTrue(trsVersion.isIsProduction()); assertEquals("There should be" + numImages + "image(s) in this workflow", numImages, trsVersion.getImages().size()); snapshotInList = true; for (ImageData imageData :trsVersion.getImages()) { assertNotNull(imageData.getChecksum()); assertNotNull(imageData.getRegistryHost()); } } else { <START> assertFalse(trsVersion.isIsProduction()); <END> assertEquals("Non-snapshotted versions should have 0 images ", 0, trsVersion.getImages().size()); } } assertTrue("Snapshotted version should be in the list", snapshotInList); }</code><technical_language>Assert getImages() empty</technical_language>

Target:
private void testTRSConversion(final List<ToolVersion> versions, final String snapShottedVersionName, final int numImages) { assertFalse("Should have at least one version", versions.isEmpty()); boolean snapshotInList = false; for (ToolVersion trsVersion : versions) { if (trsVersion.getName().equals(snapShottedVersionName)) { assertTrue(trsVersion.isIsProduction()); assertEquals("There should be" + numImages + "image(s) in this workflow", numImages, trsVersion.getImages().size()); snapshotInList = true; assertFalse(trsVersion.getImages().isEmpty()); for (ImageData imageData :trsVersion.getImages()) { assertNotNull(imageData.getChecksum()); assertNotNull(imageData.getRegistryHost()); } } else { assertFalse(trsVersion.isIsProduction()); assertEquals("Non-snapshotted versions should have 0 images ", 0, trsVersion.getImages().size()); } } assertTrue("Snapshotted version should be in the list", snapshotInList); }
Source:
<code>private RunResult filledFailure(ProcessResult processResult) { byte[] output = processResult.output.getBytes(StandardCharsets.UTF_8); byte[] errorOutput = processResult.errorOutput.getBytes(StandardCharsets.UTF_8); ImmutableMap.Builder<String, byte[]> logs = new ImmutableMap.Builder<>(); logs.put(SpecialLogs.STDOUT, output); <START> logs.put(SpecialLogs.STDERR, errorOutput); <END> return new RunResult( Status.COMPILE_FAILED, ImmutableList.<TestResult>of(), logs.build()); }</code><technical_language>instead: java ImmutableMap.builder() .put(SpecialLogs.STDOUT, output) .put(SpecialLogs.STDERR, errorOutput) .build();</technical_language>

Target:
private RunResult filledFailure(ProcessResult processResult) { byte[] errorOutput = processResult.errorOutput.getBytes(StandardCharsets.UTF_8); ImmutableMap<String, byte[]> logs = new ImmutableMap.Builder() .put(SpecialLogs.COMPILER_OUTPUT, errorOutput) .<String, byte[]>build(); return new RunResult( Status.COMPILE_FAILED, ImmutableList.<TestResult>of(), logs); }
Source:
<code>AnnotatedSocketException(SocketException exception, SocketAddress remoteAddress) { super(exception.getMessage() + ": " + remoteAddress); initCause(exception); <START> setStackTrace(EmptyArrays.EMPTY_STACK_TRACE); <END> }</code><technical_language>question</technical_language>

Target:
AnnotatedSocketException(SocketException exception, SocketAddress remoteAddress) { super(exception.getMessage() + ": " + remoteAddress); initCause(exception); }
Source:
<code>public long getVolume() { double area = 0; int i, j = points.size() - 1; for (i = 0; i < points.size(); ++i) { area += (points.get(j).getBlockX() + points.get(i).getBlockX()) * (points.get(j).getBlockZ() - points.get(i).getBlockZ()); j = i; } <START> return (long) Math.floor(Math.abs(area * 0.5) <END> * (maxY - minY + 1)); }</code><technical_language>This changed BigDecimal, I area computation needs promoted long ensure lose edge cases: >>> (3_000_000 * 3_000_000) > 2**32 True</technical_language>

Target:
public long getVolume() { long area = 0; int i, j = points.size() - 1; for (i = 0; i < points.size(); ++i) { long x = points.get(j).getBlockX() + points.get(i).getBlockX(); long z = points.get(j).getBlockZ() - points.get(i).getBlockZ(); area += x * z; j = i; } return BigDecimal.valueOf(area) .multiply(BigDecimal.valueOf(0.5)) .abs() .setScale(0, RoundingMode.FLOOR) .longValue() * (maxY - minY + 1); }
Source:
<code>public static SerializedGraphObject load(InputStream inputStream, String sourceDescription) { try(inputStream) { LOG.info("Reading graph from '{}'", sourceDescription); Input input = new Input(inputStream); <START> Kryo kryo = SerializedGraphObject.makeKryo(); <END> SerializedGraphObject serializedGraphObject = (SerializedGraphObject) kryo.readClassAndObject(input); Graph graph = serializedGraphObject.graph; LOG.debug("Graph read."); if (graph.graphVersionMismatch()) { throw new RuntimeException("Graph version mismatch detected."); } serializedGraphObject.reconstructEdgeLists(); LOG.info("Graph read. |V|={} |E|={}", graph.countVertices(), graph.countEdges()); return serializedGraphObject; } catch (IOException e) { LOG.error("Exception while loading graph: {}", e.getLocalizedMessage(), e); return null; } }</code><technical_language>Class name is needed calling method class</technical_language>

Target:
private static SerializedGraphObject load(InputStream inputStream, String sourceDescription) { try(inputStream) { LOG.info("Reading graph from '{}'", sourceDescription); Input input = new Input(inputStream); Kryo kryo = makeKryo(); SerializedGraphObject serObj = (SerializedGraphObject) kryo.readClassAndObject(input); Graph graph = serObj.graph; LOG.debug("Graph read."); if (graph.graphVersionMismatch()) { throw new RuntimeException("Graph version mismatch detected."); } serObj.reconstructEdgeLists(); LOG.info("Graph read. |V|={} |E|={}", graph.countVertices(), graph.countEdges()); return serObj; } catch (IOException e) { LOG.error("Exception while loading graph: {}", e.getLocalizedMessage(), e); return null; } }
Source:
<code>public ActionResponse put(String key, ActionResponse data) { try { final String serializedData = mapper.writeValueAsString(data); if(serializedData != null) { <START> if(serializedData.length() <= 256 * 1024) { <END> distributedMap.put(key, mapper.writeValueAsString(data)); } else { String responsePart = serializedData.substring(0, 1024); logger.error("Size of response is too big for cache. Skipping it. Response Part : {}", responsePart ); } } } catch (JsonProcessingException e) { logger.error("Error saving value to map: ", e); } return data; }</code><technical_language>Move constants</technical_language>

Target:
public ActionResponse put(String key, ActionResponse data) { try { final String serializedData = mapper.writeValueAsString(data); if(serializedData != null) { if(serializedData.length() <= Constants.CACHE_VALUE_SIZE_IN_KB) { distributedMap.put(key, mapper.writeValueAsString(data)); } else { String responsePart = serializedData.substring(0, 1024); logger.error("Size of response is too big for cache. Skipping it. Response Part : {}", responsePart ); } } } catch (JsonProcessingException e) { logger.error("Error saving value to map: ", e); } return data; }
Source:
<code>public static <STATE extends ScalarProvider, TARGET extends Locatable> double calculateSegmentMean( final int firstTargetIndex, final int segmentLength, final ForwardBackwardAlgorithm.Result<?, TARGET, STATE> fbResult) { <START> if (segmentLength < 0) { <END> throw new IllegalArgumentException("Segment length must be positive"); } if (segmentLength == 0) { return Double.NaN; } else { final List<STATE> hiddenStates = fbResult.model().hiddenStates(); final double[] hiddenStateValues = hiddenStates.stream() .mapToDouble(STATE::getScalar) .toArray(); return IntStream.range(firstTargetIndex, firstTargetIndex + segmentLength) .mapToDouble(targetIndex -> IntStream.range(0, hiddenStates.size()) .mapToDouble(si -> hiddenStateValues[si] * FastMath.exp(fbResult.logProbability(targetIndex, hiddenStates.get(si)))) .sum()) .sum() / segmentLength; } }</code><technical_language>Utils.validateArg</technical_language>

Target:
public static <STATE extends ScalarProducer, TARGET extends Locatable> double calculateSegmentMean( final int firstTargetIndex, final int segmentLength, final ForwardBackwardAlgorithm.Result<?, TARGET, STATE> fbResult) { Utils.validateArg(segmentLength >= 0, "Segment length must be non-negative"); if (segmentLength == 0) { return Double.NaN; } else { final List<STATE> hiddenStates = fbResult.model().hiddenStates(); final double[] hiddenStateValues = hiddenStates.stream() .mapToDouble(STATE::getScalar) .toArray(); return IntStream.range(firstTargetIndex, firstTargetIndex + segmentLength).boxed() .flatMapToDouble(targetIndex -> IntStream.range(0, hiddenStates.size()) .mapToDouble(si -> hiddenStateValues[si] * FastMath.exp(fbResult.logProbability(targetIndex, hiddenStates.get(si))))) .sum() / segmentLength; } }
Source:
<code>public Iterator<List<CandidateCellForSweeping>> getCandidateCellsForSweeping( TableReference tableRef, CandidateCellForSweepingRequest request) { Iterator<List<CellTsPairInfo>> cellTsIter = cellTsPairLoaderFactory.createPageIterator(tableRef, request); Iterator<List<CandidateCellForSweeping>> rawIter = CandidateGroupingIterator.create(cellTsIter); <START> return Iterators.filter(rawIter, page -> !page.isEmpty()); <END> }</code><technical_language>this Iterator do eager page load of kind avoid in OracleCellTsPageLoader.PageIterator</technical_language>

Target:
public Iterator<List<CandidateCellForSweeping>> getCandidateCellsForSweeping( TableReference tableRef, CandidateCellForSweepingRequest request) { Iterator<List<CellTsPairInfo>> cellTsIter = cellTsPairLoader.createPageIterator(tableRef, request); Iterator<List<CandidateCellForSweeping>> rawIter = CandidateGroupingIterator.create(cellTsIter); return Iterators.filter(rawIter, page -> !page.isEmpty()); }
Source:
<code>public void endElement(String uri, String localName, String qName) throws SAXException { StackEntry entry = pop(); if ("tr".equals(localName) || "li".equals(localName)) { if (entry.attrs.getLength() == 0 && entry.blank) { AttributesImpl newAttrs = new AttributesImpl(); newAttrs.addAttribute("", "class", "class", "", "mw-empty-elt"); entry.attrs = newAttrs; } } ByteArrayOutputStream oldStream = (ByteArrayOutputStream)m_serializer.getOutputStream(); m_serializer.setOutputStream(entry.stream); m_serializer.startElement(entry.uri, entry.localName, entry.qName, entry.attrs); m_serializer.writeStream(oldStream); if (entry.isWrapOpen) { m_serializer.write("</p>"); <START> } <END> m_serializer.endElement(uri, localName, qName); }</code><technical_language>is this done unconditionally here</technical_language>

Target:
public void endElement(String uri, String localName, String qName) throws SAXException { StackEntry entry = pop(); if ("tr".equals(localName) || "li".equals(localName)) { if (entry.attrs.getLength() == 0 && entry.blank) { AttributesImpl newAttrs = new AttributesImpl(); newAttrs.addAttribute("", "class", "class", "", "mw-empty-elt"); entry.attrs = newAttrs; } } ByteArrayOutputStream oldStream = (ByteArrayOutputStream)m_serializer.getOutputStream(); m_serializer.setOutputStream(entry.stream); m_serializer.startElement(entry.uri, entry.localName, entry.qName, entry.attrs); m_serializer.writeStream(oldStream); if (entry.hasOpenPTag) { m_serializer.write("</p>"); } m_serializer.endElement(uri, localName, qName); }
Source:
<code>private void processTitle(String[] row, JaxAtsTask taskArt, int i) { String str = row[i]; if (Strings.isValid(str)) { monitor.subTask(String.format("Title \"%s\"", str)); taskArt.setName(str); <START> } else { <END> rowErrorLog.error("On row: " + rowNum + ", title field cannot be empty."); } }</code><technical_language>consider errorf which, includes String.format call, concatenating strings. reads better. others below</technical_language>

Target:
private void processTitle(String[] row, JaxAtsTask taskArt, int i) { String str = row[i]; if (Strings.isValid(str)) { monitor.subTask(String.format("Title \"%s\"", str)); taskArt.setName(str); } else { rowErrorLog.errorf("On row: %d, title field cannot be empty.", rowNum); } }
Source:
<code>protected DynamicEndpointSnitch(IEndpointSnitch snitch, String instance) { mbeanName = "org.apache.cassandra.db:type=DynamicEndpointSnitch"; if (instance != null) mbeanName += ",instance=" + instance; subsnitch = snitch; if (DatabaseDescriptor.isDaemonInitialized()) <START> { <END> applyConfigChanges(DatabaseDescriptor.getDynamicUpdateInterval(), DatabaseDescriptor.getDynamicSampleUpdateInterval(), DatabaseDescriptor.getDynamicBadnessThreshold()); open(); } }</code><technical_language>This config option hooks rate limiter intended</technical_language>

Target:
protected DynamicEndpointSnitch(IEndpointSnitch snitch, String instance) { mbeanName = "org.apache.cassandra.db:type=DynamicEndpointSnitch"; if (instance != null) mbeanName += ",instance=" + instance; subsnitch = snitch; probeRateLimiter = RateLimiter.create(1); latencyProbeExecutor = ScheduledExecutors.getOrCreateSharedExecutor(LATENCY_PROBE_TP_NAME); latencyProbeExecutor.setMaximumPoolSize(1); if (DatabaseDescriptor.isDaemonInitialized()) { open(false); } }