auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String stripWorkDir(File workDir, File file) { final String filePath = file.getPath(); final String workDirPath = workDir.getPath(); if (filePath.length() <= workDirPath.length() <START> || filePath.charAt(workDirPath.length()) != File.separatorChar <END> || !filePath.startsWith(workDirPath)) { File absWd = workDir.isAbsolute() ? workDir : workDir.getAbsoluteFile(); File absFile = file.isAbsolute() ? file : file.getAbsoluteFile(); if (absWd.equals(workDir) && absFile.equals(file)) { return ""; } return stripWorkDir(absWd, absFile); } String relName = filePath.substring(workDirPath.length() + 1); if (File.separatorChar != '/') { relName = relName.replace(File.separatorChar, '/'); } return relName; }</code><technical_language>Unrelated formatting changes</technical_language>

Target:
public static String stripWorkDir(File workDir, File file) { final String filePath = file.getPath(); final String workDirPath = workDir.getPath(); if (filePath.length() <= workDirPath.length() || filePath.charAt(workDirPath.length()) != File.separatorChar || !filePath.startsWith(workDirPath)) { File absWd = workDir.isAbsolute() ? workDir : workDir.getAbsoluteFile(); File absFile = file.isAbsolute() ? file : file.getAbsoluteFile(); if (absWd.equals(workDir) && absFile.equals(file)) { return ""; } return stripWorkDir(absWd, absFile); } String relName = filePath.substring(workDirPath.length() + 1); if (File.separatorChar != '/') relName = relName.replace(File.separatorChar, '/'); return relName; }
Source:
<code>public List<ERepositoryObjectType> getTypes() { return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.PROCESS_STORM); <START> } <END></code><technical_language>contains process type contains CDP DISTRIBUTION. e.g SPARK_JOBLET,SPARK_STREAMING_JOBLET,TEST_CONTAINER(only spark process related) Please ref to: public List<ERepositoryObjectType> getTypes() { if (ERepositoryObjectType.PROCESS_STORM != null) { // test if spark streaming is (not case TBD license) return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.PROCESS_STORM,ERepositoryObjectType.SPARK_JOBLET,ERepositoryObjectType.SPARK_STREAMING_JOBLET,ERepositoryObjectType.TEST_CONTAINER); } else { return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ,ERepositoryObjectType.SPARK_JOBLET, ERepositoryObjectType.TEST_CONTAINER); } }</technical_language>

Target:
public List<ERepositoryObjectType> getTypes() { List<ERepositoryObjectType> types = Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.SPARK_JOBLET, ERepositoryObjectType.TEST_CONTAINER); if (ERepositoryObjectType.PROCESS_STORM != null) { types.addAll( Arrays.asList(ERepositoryObjectType.PROCESS_STORM, ERepositoryObjectType.SPARK_STREAMING_JOBLET)); } return types; }
Source:
<code>protected Type visitSymbolReference(SymbolReference node, StackableAstVisitorContext<Context> context) { if (context.getContext().isInLambda()) { LambdaArgumentDeclaration lambdaArgumentDeclaration = context.getContext().getNameToLambdaArgumentDeclarationMap().get(node.getName()); if (lambdaArgumentDeclaration != null) { Type result = getExpressionType(lambdaArgumentDeclaration); return setExpressionType(node, result); } } Type type = symbolTypes.get(Symbol.from(node)); if (type == null) { <START> throw new SemanticException(UNKNOWN_IDENTIFIER, node, "Unknown identifier: %s", node); <END> } return setExpressionType(node, type); }</code><technical_language>I MISSING_ATTRIBUTE</technical_language>

Target:
protected Type visitSymbolReference(SymbolReference node, StackableAstVisitorContext<Context> context) { if (context.getContext().isInLambda()) { LambdaArgumentDeclaration lambdaArgumentDeclaration = context.getContext().getNameToLambdaArgumentDeclarationMap().get(node.getName()); if (lambdaArgumentDeclaration != null) { Type result = getExpressionType(lambdaArgumentDeclaration); return setExpressionType(node, result); } } Type type = symbolTypes.get(Symbol.from(node)); if (type == null) { throw new SemanticException(MISSING_ATTRIBUTE, node, "Unknown identifier: %s", node); } return setExpressionType(node, type); }
Source:
<code>public AccessControlAccessPlugin(SubjectIdentity subjectIdentity) { <START> this.subjectIdentity = subjectIdentity; <END> this.subjectSupplier = () -> subjectIdentity.getUniqueIdentifier(SecurityUtils.getSubject()); }</code><technical_language>Do this constructor</technical_language>

Target:
public AccessControlAccessPlugin(SubjectIdentity subjectIdentity) { this.subjectSupplier = () -> subjectIdentity.getUniqueIdentifier(SecurityUtils.getSubject()); }
Source:
<code>public void setEnvironment() throws Exception { super.init(userMode); String gatewayUrl; <START> if (gatewayContextWrk.getContextTenant().getDomain().equals("carbon.super")) { <END> gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; apiProvider = publisherContext.getContextTenant().getContextUser().getUserName(); }</code><technical_language>constant - MultitenantConstants.SUPER_TENANT_DOMAIN_NAME here</technical_language>

Target:
public void setEnvironment() throws Exception { super.init(userMode); String gatewayUrl; if (gatewayContextWrk.getContextTenant().getDomain().equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; apiProvider = publisherContext.getContextTenant().getContextUser().getUserName(); }
Source:
<code><START> public MutableLiveData<RecoverPasswordProgressState> getProgressLiveData() { <END> return mProgressLiveData; }</code><technical_language>This method return LiveData MutableLiveData consumers mutate it</technical_language>

Target:
public LiveData<Resource<String>> getProgressLiveData() { return mProgressLiveData; }
Source:
<code>public void testGetMediaBytesWithNullByteArray() { when(urlService.fetchUrlConnection(any(String.class))).thenReturn(urlConnection); when(urlService.fetchInputStreamFromConnection(urlConnection)).thenReturn(inputStream); <START> when(urlService.inputStreamToByteArray(any(InputStream.class))).thenReturn(null); <END> Response response = resource.getMediaBytes(key, "Test"); assertEquals(response.getStatusInfo(), Response.Status.INTERNAL_SERVER_ERROR); }</code><technical_language>Do want this when(urlService.inputStreamToByteArray(inputStream)).thenReturn(null); line method return inputStream</technical_language>

Target:
public void testGetMediaBytesWithNullByteArray() { when(urlService.fetchUrlConnection(any(String.class))).thenReturn(urlConnection); when(urlService.fetchInputStreamFromConnection(urlConnection)).thenReturn(inputStream); when(urlService.inputStreamToByteArray(inputStream)).thenReturn(null); Response response = resource.getMediaBytes(key, "Test"); assertEquals(response.getStatusInfo(), Response.Status.INTERNAL_SERVER_ERROR); }
Source:
<code>public FileSystemWriter<E> load(StorageKey key) throws Exception { Preconditions.checkState(view.getDataset() instanceof FileSystemDataset, "FileSystemWriters cannot create writer for " + view.getDataset()); FileSystemDataset dataset = (FileSystemDataset) view.getDataset(); Path partition = convert.fromKey(key); FileSystemWriter<E> writer = FileSystemWriter.newWriter( dataset.getFileSystem(), new Path(dataset.getDirectory(), partition), conf.getRollIntervalMillis(), conf.getTargetFileSize(), <START> dataset.getDescriptor(), view.getSchema()); <END> PartitionListener listener = dataset.getPartitionListener(); if (listener != null) { listener.partitionAdded( dataset.getNamespace(), dataset.getName(), partition.toString()); } writer.initialize(); return writer; }</code><technical_language>accessor's write schema</technical_language>

Target:
public FileSystemWriter<E> load(StorageKey key) throws Exception { Preconditions.checkState(view.getDataset() instanceof FileSystemDataset, "FileSystemWriters cannot create writer for " + view.getDataset()); FileSystemDataset dataset = (FileSystemDataset) view.getDataset(); Path partition = convert.fromKey(key); FileSystemWriter<E> writer = FileSystemWriter.newWriter( dataset.getFileSystem(), new Path(dataset.getDirectory(), partition), conf.getRollIntervalMillis(), conf.getTargetFileSize(), dataset.getDescriptor(), view.getAccessor().getWriteSchema()); PartitionListener listener = dataset.getPartitionListener(); if (listener != null) { listener.partitionAdded( dataset.getNamespace(), dataset.getName(), partition.toString()); } writer.initialize(); return writer; }
Source:
<code>public static int getCdDeviceIndex(String cdInterface) { switch (cdInterface) { case "scsi": <START> return 2; <END> case "ide": return 2; case "sata": return 2; default: return -1; } }</code><technical_language>is 2, 2, 2, rewritten to: case "scsi": case "ide": case "sata": return 2; default: return -1;</technical_language>

Target:
public static int getCdDeviceIndex(String cdInterface) { switch (cdInterface) { case "scsi": case "ide": case "sata": return 2; default: return -1; } }
Source:
<code>public TokenRequest setScopes(List<String> scopes) { <START> this.scopes.clear(); <END> this.scopes.addAll(scopes); return this; }</code><technical_language>error handling? (ie. scopes == null)</technical_language>

Target:
public TokenRequest setScopes(List<String> scopes) { Objects.requireNonNull(scopes); this.scopes.clear(); this.scopes.addAll(scopes); return this; }
Source:
<code>public static void skipContent(@Nonnull JayceInternalReaderImpl in) <START> throws IOException { <END> }</code><technical_language>Remove</technical_language>

Target:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) { }
Source:
<code>private void updateClusterMigrationRelatedFields() { Cluster cluster = getSelectedCluster(); Boolean <START> autoCoverge = <END> cluster == null ? null : cluster.getAutoConverge(); if (autoCoverge == null) { autoCoverge = AsyncDataProvider.getInstance().getAutoConverge(); } getAutoConverge().setClusterValue(autoCoverge); Boolean compressed = cluster == null ? null : cluster.getMigrateCompressed(); if (compressed == null) { compressed = AsyncDataProvider.getInstance().getMigrateCompressed(); } getMigrateCompressed().setClusterValue(compressed); Boolean encrypted = cluster == null ? null : cluster.getMigrateEncrypted(); if (encrypted == null) { encrypted = AsyncDataProvider.getInstance().getMigrateEncrypted(); } getMigrateEncrypted().setClusterValue(encrypted); }</code><technical_language>typo :) be: autoConverge (e.g. missing "n")</technical_language>

Target:
private void updateClusterMigrationRelatedFields() { Cluster cluster = getSelectedCluster(); Boolean autoConverge = cluster == null ? null : cluster.getAutoConverge(); if (autoConverge == null) { autoConverge = AsyncDataProvider.getInstance().getAutoConverge(); } getAutoConverge().setClusterValue(autoConverge); Boolean compressed = cluster == null ? null : cluster.getMigrateCompressed(); if (compressed == null) { compressed = AsyncDataProvider.getInstance().getMigrateCompressed(); } getMigrateCompressed().setClusterValue(compressed); Boolean encrypted = cluster == null ? null : cluster.getMigrateEncrypted(); if (encrypted == null) { encrypted = AsyncDataProvider.getInstance().getMigrateEncrypted(); } getMigrateEncrypted().setClusterValue(encrypted); }
Source:
<code>private void initializeGeoRepActionConfirmation(String title, HelpTag helpTag, String hashName, String forceHelp, String forceLabelText, String commandName, String masterVolumeName, String slaveVolumeName, String slaveHostName, String message) { GlusterVolumeGeoRepActionConfirmationModel cModel; if(getWindow() != null) { if((getWindow() instanceof GlusterVolumeGeoRepActionConfirmationModel)) { cModel = (GlusterVolumeGeoRepActionConfirmationModel) getWindow(); } else { return; } } else { cModel = new GlusterVolumeGeoRepActionConfirmationModel(); cModel.setTitle(title); } cModel.setHelpTag(helpTag); cModel.setHashName(hashName); setWindow(cModel); cModel.initWindow(masterVolumeName, slaveVolumeName, slaveHostName); <START> cModel.setMessage(message); <END> cModel.setForceHelp(forceHelp); cModel.setForceLabel(forceLabelText); List<UICommand> geoRepActionCommands = Arrays.asList(UICommand.createDefaultOkUiCommand(commandName, this), UICommand.createCancelUiCommand("closeWindow", this)); if(cModel.getCommands().size() > 0) { cModel.setCommands(geoRepActionCommands); } else { cModel.getCommands().addAll(geoRepActionCommands); } }</code><technical_language>setActionConfirmationText/setActionConfirmationMessage</technical_language>

Target:
private void initializeGeoRepActionConfirmation(String title, HelpTag helpTag, String hashName, String forceHelp, String forceLabelText, String commandName, String masterVolumeName, String slaveVolumeName, String slaveHostName, String message) { GlusterVolumeGeoRepActionConfirmationModel cModel; if(getWindow() != null) { if((getWindow() instanceof GlusterVolumeGeoRepActionConfirmationModel)) { cModel = (GlusterVolumeGeoRepActionConfirmationModel) getWindow(); } else { return; } } else { cModel = new GlusterVolumeGeoRepActionConfirmationModel(); cModel.setTitle(title); } cModel.setHelpTag(helpTag); cModel.setHashName(hashName); setWindow(cModel); cModel.initWindow(masterVolumeName, slaveVolumeName, slaveHostName); cModel.setActionConfirmationMessage(message); cModel.setForceHelp(forceHelp); cModel.setForceLabel(forceLabelText); List<UICommand> geoRepActionCommands = Arrays.asList(UICommand.createDefaultOkUiCommand(commandName, this), UICommand.createCancelUiCommand("closeWindow", this)); if(cModel.getCommands().size() > 0) { cModel.setCommands(geoRepActionCommands); } else { cModel.getCommands().addAll(geoRepActionCommands); } }
Source:
<code><START> public void clearInput() { <END> Display.getDefault().asyncExec(new Runnable() { @Override public void run() { chkNumberFrom.setSelection(false); chkNumberTo.setSelection(false); chkTimeFrom.setSelection(false); chkTimeTo.setSelection(false); txtSearchRBNumber.setText(""); txtSearchTitle.setText(""); txtSearchUsers.setText(""); spinnerFromNumber.setSelection(0); spinnerToNumber.setSelection(0); spinnerFromNumber.setEnabled(false); spinnerToNumber.setEnabled(false); Calendar cal = Calendar.getInstance(); dtFromDate.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); dtToDate.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); dtFromTime.setTime(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); dtToTime.setTime(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); dtFromDate.setEnabled(false); dtToDate.setEnabled(false); dtFromTime.setEnabled(false); dtToTime.setEnabled(false); } }); }</code><technical_language>This logic belong in UI layer. want do is: - Databind of UI items a viewmodel - clear operation is implemented in viewmodel, updates defaults - databinding takes care of updating UI</technical_language>

Target:
public void clearInput() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { chkNumberFrom.setSelection(false); chkNumberTo.setSelection(false); chkTimeFrom.setSelection(false); chkTimeTo.setSelection(false); textSearchBox.setText(""); spinnerFromNumber.setSelection(0); spinnerToNumber.setSelection(0); spinnerFromNumber.setEnabled(false); spinnerToNumber.setEnabled(false); Calendar cal = Calendar.getInstance(); dtFromDate.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); dtToDate.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); dtFromTime.setTime(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); dtToTime.setTime(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); dtFromDate.setEnabled(false); dtToDate.setEnabled(false); dtFromTime.setEnabled(false); dtToTime.setEnabled(false); } }); }
Source:
<code><START> public BooleanWrapper defineNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, <END> String policyType, Object[] policyParams, boolean nodesRecoverable) { if (nodeSourceName == null) { throw new IllegalArgumentException("Node Source name cannot be null"); } logger.info("Define a node source : " + nodeSourceName); nodeSourceName = nodeSourceName.trim(); NodeSourceData persistedNodeSource = new NodeSourceData(nodeSourceName, infrastructureType, infraParams, policyType, policyParams, caller, nodesRecoverable, NodeSourceStatus.NODES_UNDEPLOYED); boolean added = dbManager.addNodeSource(persistedNodeSource); try { validateNodeSourceNameOrFail(nodeSourceName); createNotActiveNodeSource(persistedNodeSource); return new BooleanWrapper(true); } catch (NodeSourceNameAlreadyExistException e) { logger.error(e.getMessage(), e); throw e; } catch (RuntimeException ex) { logger.error(ex.getMessage(), ex); if (added) { dbManager.removeNodeSource(nodeSourceName); } throw ex; } }</code><technical_language>If opportunity great if refactor methods parameters</technical_language>

Target:
public BooleanWrapper defineNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams, boolean nodesRecoverable) { if (nodeSourceName == null) { throw new IllegalArgumentException("Node Source name cannot be null"); } List<Serializable> serializableInfraParams = getSerializableParamsOrFail(nodeSourceName, infraParams); List<Serializable> serializablePolicyParams = getSerializableParamsOrFail(nodeSourceName, policyParams); logger.info("Define a node source : " + nodeSourceName); nodeSourceName = nodeSourceName.trim(); NodeSourceData persistedNodeSource = new NodeSourceData(nodeSourceName, infrastructureType, serializableInfraParams, policyType, serializablePolicyParams, caller, nodesRecoverable, NodeSourceStatus.NODES_UNDEPLOYED); boolean added = dbManager.addNodeSource(persistedNodeSource); if (!added) { return new BooleanWrapper(false); } else { return validateAndPrepareNodeSource(nodeSourceName, persistedNodeSource, added); } }
Source:
<code>private void loadConfig(Map<String, String> config) { KieServerConfig kieConfig = new KieServerConfig(); kieConfig.setHost(config.get(HOST)); kieConfig.setPort(Integer.valueOf(config.get(PORT))); kieConfig.setContextRoot(config.get(CONTEXT_ROOT)); kieConfig.setProtocol(config.get(PROTOCOL)); kieConfig.setPath(config.get(PATH)); CredentialsProvider credentialsProvider = new EnteredCredentialsProvider(config.get(USERNAME), config.get(PASSWORD)); kieConfig.setCredentialsProvider(credentialsProvider); KieServicesClient kieServicesClient = createKieServicesClient(kieConfig); kieConfig.setId(kieServicesClient.getServerInfo().getResult().getServerId()); <START> configs.put(kieConfig.getId(), kieConfig); <END> kieServices.put(kieConfig.getId(), kieServicesClient); logger.info("Loaded kie server configuration: {}", kieConfig.getId()); }</code><technical_language>this need start application static/predefined list of kie servers users able work with</technical_language>

Target:
private void loadConfig(Map<String, String> config) { KieServerConfig kieConfig = new KieServerConfig(); kieConfig.setHost(config.get(HOST)); CredentialsProvider credentialsProvider = new EnteredCredentialsProvider(config.get(USERNAME), config.get(PASSWORD)); kieConfig.setCredentialsProvider(credentialsProvider); try { KieServicesClient kieServicesClient = createKieServicesClient(kieConfig); kieConfig.setId(kieServicesClient.getServerInfo().getResult().getServerId()); configs.put(kieConfig.getId(), kieConfig); kieServices.put(kieConfig.getId(), kieServicesClient); logger.info("Loaded kie server configuration: {}", kieConfig.getId()); } catch (Exception e) { logger.warn("Unable to add KieServer: " + config.toString(), e); } }
Source:
<code><START> private static Set<Object> getSelectionContents( <END> @NonNull IStructuredSelection selection) { Set<Object> result = new HashSet<>(); for (Object o : selection.toList()) { IResource resource = AdapterUtils.adapt(o, IResource.class); if (resource != null) { result.add(resource); continue; } ResourceMapping mapping = AdapterUtils.adapt(o, ResourceMapping.class); if (mapping != null) { result.addAll(extractResourcesFromMapping(mapping)); } else { IPath location = AdapterUtils.adapt(o, IPath.class); if (location != null) { result.add(location); } } } return result; }</code><technical_language>ResourceMapping preferred IResource here, too? If not, not</technical_language>

Target:
private static Set<Object> getSelectionContents( @NonNull IStructuredSelection selection) { Set<Object> result = new HashSet<>(); for (Object o : selection.toList()) { ResourceMapping mapping = AdapterUtils.adapt(o, ResourceMapping.class); if (mapping != null) { result.addAll(extractResourcesFromMapping(mapping)); } else { IResource resource = AdapterUtils.adapt(o, IResource.class); if (resource != null) { result.add(resource); } else { IPath location = AdapterUtils.adapt(o, IPath.class); if (location != null) { result.add(location); } } } } return result; }
Source:
<code>public IpTypeCatalog getCatalog() { <START> return new InMemoryIpTypeCatalog(new HashMap<String, Integer>() {{ <END> put(NOT_AVAILABLE.name(), 0); put(PUBLIC.name(), 1); put(PORT_RESTRICTED.name(), 2); put(SINGLE_NAT_PRIVATE.name(), 3); put(UNKNOWN.name(), 7); }}); }</code><technical_language>LinkedHashMap</technical_language>

Target:
public IpTypeCatalog getCatalog() { return new InMemoryIpTypeCatalog(new LinkedHashMap<String, Integer>() {{ put(NOT_AVAILABLE.name(), 0); put(PUBLIC.name(), 1); put(PORT_RESTRICTED.name(), 2); put(SINGLE_NAT_PRIVATE.name(), 3); put(UNKNOWN.name(), 7); }}); }
Source:
<code>public EventHubClientBuilder connectionString(String connectionString, String eventHubName) { if (ImplUtils.isNullOrEmpty(eventHubName)) { throw new IllegalArgumentException("'eventHubName' cannot be null or empty"); } final ConnectionStringProperties properties = new ConnectionStringProperties(connectionString); final TokenCredential tokenCredential; try { tokenCredential = new EventHubSharedAccessKeyCredential(properties.sharedAccessKeyName(), properties.sharedAccessKey(), ClientConstants.TOKEN_VALIDITY); } catch (InvalidKeyException | NoSuchAlgorithmException e) { throw new AzureException("Could not create the EventHubSharedAccessKeyCredential.", e); } if (!ImplUtils.isNullOrEmpty(properties.eventHubName())) { throw new IllegalArgumentException(String.format(Locale.US, <START> "'connectionString' contains an Event Hub path [%s]. Please use the" <END> + " credentials(String connectionString) overload. Or supply a 'connectionString' without" + " 'EntityPath' in it.", properties.eventHubName())); } return credential(properties.endpoint().getHost(), eventHubName, tokenCredential); }</code><technical_language>suggestion "'connectionString' contains Event Hub name [%s]. Please the"</technical_language>

Target:
public EventHubClientBuilder connectionString(String connectionString, String eventHubName) { if (ImplUtils.isNullOrEmpty(eventHubName)) { throw new IllegalArgumentException("'eventHubName' cannot be null or empty"); } final ConnectionStringProperties properties = new ConnectionStringProperties(connectionString); final TokenCredential tokenCredential; try { tokenCredential = new EventHubSharedAccessKeyCredential(properties.sharedAccessKeyName(), properties.sharedAccessKey(), ClientConstants.TOKEN_VALIDITY); } catch (InvalidKeyException | NoSuchAlgorithmException e) { throw new AzureException("Could not create the EventHubSharedAccessKeyCredential.", e); } if (!ImplUtils.isNullOrEmpty(properties.eventHubName())) { throw new IllegalArgumentException(String.format(Locale.US, "'connectionString' contains an Event Hub name [%s]. Please use the" + " credentials(String connectionString) overload. Or supply a 'connectionString' without" + " 'EntityPath' in it.", properties.eventHubName())); } return credential(properties.endpoint().getHost(), eventHubName, tokenCredential); }
Source:
<code>PropertyCascadable(Property property, CascadingMetaData cascadingMetaData) { this.property = property; this.cascadableType = property.getType(); this.cascadingMetaData = cascadingMetaData; <START> this.elementType = property.getKind() == Property.Kind.FIELD ? ElementType.FIELD : ElementType.METHOD; <END> }</code><technical_language>This is type of issue</technical_language>

Target:
PropertyCascadable(Property property, CascadingMetaData cascadingMetaData) { this.property = property; this.cascadableType = property.getType(); this.cascadingMetaData = cascadingMetaData; this.elementType = property instanceof JavaBeanField ? ElementType.FIELD : ElementType.METHOD; }
Source:
<code>public List<String> getAliasesForCluster(final String clusterName) throws AliasServiceException { <START> return remoteClient == null ? new ArrayList<>() : remoteClient.listChildEntries(buildClusterEntryName(clusterName)); <END> }</code><technical_language>So, this method check local alias service all</technical_language>

Target:
public List<String> getAliasesForCluster(final String clusterName) throws AliasServiceException { final List<String> localAliases = localAliasService.getAliasesForCluster(clusterName); if (localAliases == null || localAliases.isEmpty()) { return remoteClient == null ? new ArrayList<>() : remoteClient.listChildEntries(buildClusterEntryName(clusterName)); } else { return localAliases; } }
Source:
<code>public SpoutEntity(Engine engine, Transform transform, UUID uid, boolean load, byte[] dataMap, Class<? extends Component>... components) { if (transform == null) { throw new IllegalArgumentException("Entities must always have a valid transform"); } id.set(NOTSPAWNEDID); this.engine = engine; observer.set(NOT_OBSERVING); physics = (SpoutPhysicsComponent) add(PhysicsComponent.class); if (!(this instanceof Player)) { network = add(NetworkComponent.class); } else { <START> network = null; <END> } if (uid != null) { this.uid = uid; } else { this.uid = UUID.randomUUID(); } physics.setTransform(transform, false); if (components != null && components.length > 0) { initialComponents = components; } if (dataMap != null) { try { this.getData().deserialize(dataMap); } catch (IOException e) { engine.getLogger().log(Level.SEVERE, "Unable to deserialize entity data", e); } } setupInitialChunk(load == true ? LoadOption.LOAD_GEN : LoadOption.NO_LOAD); }</code><technical_language>This needs rethought. initializeSession needs able set network. comparable</technical_language>

Target:
public SpoutEntity(Engine engine, Transform transform, UUID uid, boolean load, byte[] dataMap, Class<? extends Component>... components) { if (transform == null) { throw new IllegalArgumentException("Entities must always have a valid transform"); } id.set(NOTSPAWNEDID); this.engine = engine; observer.set(NOT_OBSERVING); physics = (SpoutPhysicsComponent) add(PhysicsComponent.class); network = add(NetworkComponent.class); if (uid != null) { this.uid = uid; } else { this.uid = UUID.randomUUID(); } physics.setTransform(transform, false); if (components != null && components.length > 0) { initialComponents = components; } if (dataMap != null) { try { this.getData().deserialize(dataMap); } catch (IOException e) { engine.getLogger().log(Level.SEVERE, "Unable to deserialize entity data", e); } } setupInitialChunk(load == true ? LoadOption.LOAD_GEN : LoadOption.NO_LOAD); }
Source:
<code><START> public void testConvertAdHocSubprocessNode_autostart() throws Exception { <END> final AdHocSubprocess definition = new AdHocSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true)); final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); assertTrue(CustomElement.autoStart.of(writer.getFlowElement()).get()); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testConvertAdHocSubprocessNode_autostart() { final AdHocSubprocess definition = new AdHocSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true)); final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); assertTrue(CustomElement.autoStart.of(writer.getFlowElement()).get()); }
Source:
<code>public static String md5string(String s) { StringBuffer hexStr = new StringBuffer(); try { MessageDigest digest = java.security.MessageDigest .getInstance("MD5"); <START> digest.update(s.getBytes()); <END> byte[] messageDigest = digest.digest(); for (int i=0; i<messageDigest.length; i++) hexStr.append(Integer.toHexString(0xFF & messageDigest[i])); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return hexStr.toString(); }</code><technical_language>getBytes("utf-8") here, above</technical_language>

Target:
public static String md5string(String s) { StringBuilder hexStr = new StringBuilder(); try { MessageDigest digest = java.security.MessageDigest .getInstance("MD5"); digest.update(s.getBytes("utf-8")); byte[] messageDigest = digest.digest(); for (byte b : messageDigest) { hexStr.append(Integer.toHexString(0xFF & b)); } } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return hexStr.toString(); }
Source:
<code>public String toString() <START> { <END> return "ImmutableDruidDataSource{" + "name='" + name + "', segments='" + idToSegments.values() + "', properties='" + properties + "'}"; }</code><technical_language>need ignore it?) If for a good reason</technical_language>

Target:
public String toString() { return "ImmutableDruidDataSource{" + "name='" + name + "', # of segments='" + idToSegments.size() + "', properties='" + properties + "'}"; }
Source:
<code>private int backoffSleep(int failedCount) { try { Thread.sleep(1000 * failedCount++); if (failedCount > 10) failedCount = 1; } catch (InterruptedException e) { <START> rateLimitedLog(Level.ERROR, e, "Interrupted sleep when checkpointing."); <END> } return failedCount; }</code><technical_language>ignore InterruptedException? talk @akhanzode</technical_language>

Target:
private void backoffSleep(int failedCount) { try { Thread.sleep(200 * failedCount); } catch (InterruptedException e) { rateLimitedLog(Level.WARN, e, "Interrupted sleep when checkpointing."); } }
Source:
<code><START> boolean isExpandAllowed() { <END> StagingViewContentProvider contentProvider = getContentProvider( stagedViewer); if (contentProvider.getCount() > getMaxLimitForListMode()) { return false; } contentProvider = getContentProvider(unstagedViewer); if (contentProvider.getCount() > getMaxLimitForListMode()) { return false; } return true; }</code><technical_language>this method declared private</technical_language>

Target:
private boolean isExpandAllowed() { StagingViewContentProvider contentProvider = getContentProvider( stagedViewer); if (contentProvider.getCount() > getMaxLimitForListMode()) { return false; } contentProvider = getContentProvider(unstagedViewer); if (contentProvider.getCount() > getMaxLimitForListMode()) { return false; } return true; }
Source:
<code>public void testEmptyQuery() throws ErrnoException { for (Network network : getTestableNetworks()) { CountDownLatch latch = new CountDownLatch(1); final int TIMEOUT_MS = 12_000; final String dname = ""; mDns.query(network, dname, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, mHandler, answer -> { if (answer == null) { return; } try { new DnsRawAnswer(answer); } catch (DnsPacket.ParseException e) { e.getMessage().equals("No available answer"); latch.countDown(); } } ); String msg = "Raw query " + dname + " got <START> unexpected answer <END> " + TIMEOUT_MS + "ms."; try { assertTrue(msg, latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { } } }</code><technical_language>Do expect answer this ? If do, need change this error message. If don't, need change assertTrue assertFalse</technical_language>

Target:
public void testEmptyQuery() throws ErrnoException { for (Network network : getTestableNetworks()) { CountDownLatch latch = new CountDownLatch(1); final int TIMEOUT_MS = 12_000; final String dname = ""; mDns.query(network, dname, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, mHandler, answer -> { if (answer == null) { fail("Raw Query empty dname(ROOT) no answer returned"); } try { new CheckedDnsPacket(answer); fail("Raw Query empty dname(ROOT) get valid answer"); } catch (DnsPacket.ParseException e) { e.getMessage().equals("No available answer"); latch.countDown(); } } ); String msg = "Raw query empty dname(ROOT) but no answer after " + TIMEOUT_MS + "ms."; try { assertTrue(msg, latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { } } }
Source:
<code>public CaseInsensitiveDictionaryMap(Dictionary<? extends K, ? extends V> dictionary) { this(initialCapacity(dictionary.size())); Enumeration<? extends K> keys = dictionary.keys(); while (keys.hasMoreElements()) { K key = keys.nextElement(); <START> V value = dictionary.get(key); <END> if (key != null && value != null) { if (put(key, value) != null) { throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key)); } } } }</code><technical_language>I test for non-null key calling get</technical_language>

Target:
public CaseInsensitiveDictionaryMap(Dictionary<? extends K, ? extends V> dictionary) { this(initialCapacity(dictionary.size())); Enumeration<? extends K> keys = dictionary.keys(); while (keys.hasMoreElements()) { K key = keys.nextElement(); if (key != null) { V value = dictionary.get(key); if (value != null) { if (put(key, value) != null) { throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key)); } } } } }
Source:
<code>public RawPacket transform(RawPacket pkt) { if (extensionID != -1) { RawPacket.HeaderExtension ext = pkt.getHeaderExtension((byte) extensionID); if (ext == null) { <START> ext = pkt.addExtension((byte) extensionID, 3); <END> } setTimestamp(ext.getBuffer(), ext.getOffset() + 1); } return pkt; }</code><technical_language>worth adding a constant for this number represents</technical_language>

Target:
public RawPacket transform(RawPacket pkt) { if (extensionID != -1) { RawPacket.HeaderExtension ext = pkt.getHeaderExtension((byte) extensionID); if (ext == null) { ext = pkt.addExtension((byte) extensionID, EXT_LENGTH); } setTimestamp(ext.getBuffer(), ext.getOffset() + 1); } return pkt; }
Source:
<code>public static int getLastItemPositionOnSameRow(View view, RecyclerView parent) { GridLayoutManager layoutManager = ((GridLayoutManager) parent.getLayoutManager()); GridLayoutManager.SpanSizeLookup spanSizeLookup = layoutManager.getSpanSizeLookup(); int spanCount = layoutManager.getSpanCount(); int <START> itemCount = <END> parent.getAdapter().getItemCount(); int currentChildPosition = parent.getChildAdapterPosition(view); int spanSum = getSpanIndex(view) + spanSizeLookup.getSpanSize(currentChildPosition); while (currentChildPosition < itemCount && spanSum <= spanCount) { int nextSpanSize = spanSizeLookup.getSpanSize(currentChildPosition + 1); if (spanSum + nextSpanSize > spanCount) { return currentChildPosition; } currentChildPosition++; spanSum += nextSpanSize; } return itemCount - 1; }</code><technical_language>If instead call this lastItemPositions subtract 1 here, save subtract 1 final return? I reads clearer a "- 1" return</technical_language>

Target:
public static int getLastItemPositionOnSameRow(View view, RecyclerView parent) { GridLayoutManager layoutManager = ((GridLayoutManager) parent.getLayoutManager()); GridLayoutManager.SpanSizeLookup spanSizeLookup = layoutManager.getSpanSizeLookup(); int spanCount = layoutManager.getSpanCount(); int lastItemPosition = parent.getAdapter().getItemCount() - 1; int currentChildPosition = parent.getChildAdapterPosition(view); int spanSum = getSpanIndex(view) + spanSizeLookup.getSpanSize(currentChildPosition); while (currentChildPosition <= lastItemPosition && spanSum <= spanCount) { spanSum += spanSizeLookup.getSpanSize(currentChildPosition + 1); if (spanSum > spanCount) { return currentChildPosition; } currentChildPosition++; } return lastItemPosition; }
Source:
<code>public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int facing, float par8, float par9, float par10) { if (!world.isRemote) { float value = 0; int blockZ; int blockY; int blockX; switch (facing) { case 0: z = z - 1; x = x - 1; break; case 1: z = z - 1; x = x - 1; break; case 2: y = y - 1; x = x + 1; break; case 3: y = y - 1; x = x - 1; break; case 4: y = y - 1; z = z - 1; break; case 5: y = y - 1; z = z + 1; break; } for (int i = 0; i < 3; i++) { if (facing == 3 || facing == 5) { blockZ = z - i; } else { blockZ = z + i; } for (int o = 0; o < 3; o++) { if (facing == 1) { blockY = y - o; } else { blockY = y + o; } for (int s = 0; s < 3; s++) { if (facing == 2 || facing == 5) { blockX = x - s; } else { blockX = x + s; } Block block = world.getBlock(blockX, blockY, blockZ); <START> LogHelper.info(block.getUnlocalizedName()); <END> if (block != Blocks.air) { List<WrappedStack> get = new ArrayList<WrappedStack>(); get.clear(); get.add(new WrappedStack(block)); value = value + EnergyValueHelper.computeEnergyValueFromList(get).getValue(); } } } } ChatComponentText T = new ChatComponentText("Value = " + String.valueOf((int) value / 27)); entityPlayer.addChatMessage(T); } return super.onItemUse(itemStack, entityPlayer, world, x, z, y, facing, par8, par9, par10); }</code><technical_language>forgot some debug code</technical_language>

Target:
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int facing, float par8, float par9, float par10) { if (!world.isRemote) { float value = 0; int blockZ; int blockY; int blockX; switch (facing) { case 0: z = z - 1; x = x - 1; break; case 1: z = z - 1; x = x - 1; y = y - 2; break; case 2: y = y - 1; x = x - 1; break; case 3: y = y - 1; x = x - 1; z = z - 2; break; case 4: y = y - 1; z = z - 1; break; case 5: y = y - 1; z = z - 1; x = x - 2; break; } for (int i = 0; i < 3; i++) { blockZ = z + i; for (int o = 0; o < 3; o++) { blockY = y + o; for (int s = 0; s < 3; s++) { blockX = x + s; Block block = world.getBlock(blockX, blockY, blockZ); if (block != Blocks.air) { List<WrappedStack> get = new ArrayList<WrappedStack>(); get.add(new WrappedStack(block)); value = value + EnergyValueHelper.computeEnergyValueFromList(get).getValue(); } } } } ChatComponentText T = new ChatComponentText("Energy Value = " + String.valueOf((int) value / 27)); entityPlayer.addChatMessage(T); } return super.onItemUse(itemStack, entityPlayer, world, x, z, y, facing, par8, par9, par10); }
Source:
<code>public void dispose() { sessionManager.removeSessionLifecycleListener(sessionLifecycleListener); ISarosSession currentSession = session; if (currentSession != null) { currentSession.removeListener(sessionListener); removeSessionNode(currentSession); } <START> sessionNodeList.clear(); <END> userNodeList.clear(); }</code><technical_language>job of a dispose method is free unmanaged resources / memory deregister stuff properly object garbage collected. Of set references null / clear datastructures etc. garbage collector this is boiler plate code benefits</technical_language>

Target:
public void dispose() { sessionManager.removeSessionLifecycleListener(sessionLifecycleListener); ISarosSession currentSession = session; if (currentSession != null) { currentSession.removeListener(sessionListener); } }
Source:
<code>public void dispose() { <START> if (!commentPopupDialog.isCommentEditorText() && !commentPopupDialog.getEditable()) { <END> cancelMarkCommentAsReadJob(); commentPopupDialog.dispose(false); commentPopupDialog = null; } }</code><technical_language>Do need check of these</technical_language>

Target:
public void dispose() { if (!commentPopupDialog.hasEdits()) { cancelMarkCommentAsReadJob(); commentPopupDialog.dispose(false); commentPopupDialog = null; } }
Source:
<code>public boolean equals(Object o) { <START> return o != null && o.getClass() != getClass(); <END> }</code><technical_language>this implementation give false for this.equals(this)</technical_language>

Target:
public boolean equals(Object o) { return o != null && o.getClass() == getClass(); }
Source:
<code>synchronized void waitForClose() { <START> while (stateMachine.getCurrentState().equals(STATE_CLOSING)) { <END> try { wait(); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "InterruptedException while waiting for close to complete", e); } } }</code><technical_language>while (!stateMachine.getCurrentState().equals(STATE_CLOSED))</technical_language>

Target:
synchronized void waitForClose() { while (!stateMachine.getCurrentState().equals(STATE_CLOSED)) { try { wait(); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "InterruptedException while waiting for close to complete", e); } } }
Source:
<code>public void shouldCreateMultipleToolsAndAggregationResultWithWarningsAggregateFalse() { FreeStyleProject project = createJobWithWorkspaceFile("checkstyle.xml", "pmd-warnings.xml"); enableWarningsAggregation(project, false, "**/checkstyle-issues.txt", new CheckStyle(), "**/pmd-warnings-issues.txt", new Pmd()); List<AnalysisResult> results = scheduleBuildAndAssertStatusForBothTools(project, Result.SUCCESS); for (AnalysisResult element : results) { if (element.getId().equals("checkstyle")) { <START> assertThat(element.getTotalSize()).isEqualTo(6); <END> } else { assertThat(element.getId()).isEqualTo("pmd"); assertThat(element.getTotalSize()).isEqualTo(4); } assertThat(element).hasOverallResult(Result.SUCCESS); } }</code><technical_language>assertThat(element).hasTotalSize(6)</technical_language>

Target:
public void shouldCreateMultipleToolsAndAggregationResultWithWarningsAggregateFalse() { FreeStyleProject project = createJobWithWorkspaceFile("checkstyle.xml", "pmd-warnings.xml"); enableWarningsAggregation(project, false, "**/checkstyle-issues.txt", new CheckStyle(), "**/pmd-warnings-issues.txt", new Pmd()); List<AnalysisResult> results = scheduleBuildAndAssertStatusForBothTools(project, Result.SUCCESS); assertThat(results).hasSize(2); for (AnalysisResult element : results) { if (element.getId().equals("checkstyle")) { assertThat(element).hasTotalSize(6); } else { assertThat(element.getId()).isEqualTo("pmd"); assertThat(element).hasTotalSize(4); } assertThat(element).hasOverallResult(Result.SUCCESS); } }
Source:
<code>private double castToDoubleOrDefault(String value, double defaultValue) { if (value.isEmpty()) { return defaultValue; } <START> if ("-".equals(value)) { <END> return defaultValue; } return Double.parseDouble(value); }</code><technical_language>||</technical_language>

Target:
private double castToDoubleOrDefault(String value, double defaultValue) { if (value.isEmpty() || "-".equals(value)) { return defaultValue; } return Double.parseDouble(value); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent target = null; String deepLinkId = PlusShare.getDeepLinkId(getIntent()); if (!TextUtils.isEmpty(deepLinkId)) { target = parseDeepLinkId(deepLinkId); } else { if (Intent.ACTION_VIEW.equals(getIntent().getAction())) { target = new Intent(); target.setClass(getApplicationContext(), EventActivity.class); target.putExtra(Const.EXTRA_EVENT_ID, getIntent().getData().getLastPathSegment()); target.putExtra(Const.EXTRA_SECTION, EventActivity.EventPagerAdapter.SECTION_OVERVIEW); } } if (target != null) { <START> if (target.resolveActivity(getPackageManager()) != null) { <END> startActivity(target); } } finish(); }</code><technical_language>canerge 2 if statements, right</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent target = null; String deepLinkId = PlusShare.getDeepLinkId(getIntent()); if (!TextUtils.isEmpty(deepLinkId)) { target = parseDeepLinkId(deepLinkId); } else { if (Intent.ACTION_VIEW.equals(getIntent().getAction())) { target = new Intent(); target.setClass(getApplicationContext(), EventActivity.class); target.putExtra(Const.EXTRA_EVENT_ID, getIntent().getData().getLastPathSegment()); target.putExtra(Const.EXTRA_SECTION, EventActivity.EventPagerAdapter.SECTION_OVERVIEW); } } if (target != null && target.resolveActivity(getPackageManager()) != null) { startActivity(target); } finish(); }
Source:
<code>public void start() { if(mRunning.compareAndSet(false, true)) { try { StringBuilder sb = new StringBuilder(); sb.append(mFilePrefix); sb.append("_"); sb.append(TimeStamp.getTimeStamp("_")); sb.append(".wav"); <START> String cleaned = StringUtils.replaceIllegalCharacters(sb.toString()); <END> mFile = Paths.get(cleaned); mWriter = new ReusableBufferWaveWriter(mAudioFormat, mFile); mBufferProcessor.setListener(mWriter); mBufferProcessor.start(); } catch(IOException io) { mLog.error("Error starting complex baseband recorder", io); } } }</code><technical_language>please move this clean method RecorderManager.getBasebandRecorder() method linux filepaths get corrupted: For example: StringBuilder sb = new StringBuilder(); sb.append(getRecordingBasePath()); sb.append(File.separator).append(StringUtils.replaceIllegalCharacters(channelName)).append("_baseband"); return new ComplexBufferWaveRecorder(BASEBAND_SAMPLE_RATE, sb.toString());</technical_language>

Target:
public void start() { if(mRunning.compareAndSet(false, true)) { try { StringBuilder sb = new StringBuilder(); sb.append(mFilePrefix); sb.append("_"); sb.append(TimeStamp.getTimeStamp("_")); sb.append(".wav"); mFile = Paths.get(sb.toString()); mWriter = new ReusableBufferWaveWriter(mAudioFormat, mFile); mBufferProcessor.setListener(mWriter); mBufferProcessor.start(); } catch(IOException io) { mLog.error("Error starting complex baseband recorder", io); } } }
Source:
<code>public HttpLoadQueuePeon( String baseUrl, ObjectMapper jsonMapper, HttpClient httpClient, DruidCoordinatorConfig config, ScheduledExecutorService processingExecutor, ExecutorService callBackExecutor ) { this.jsonMapper = jsonMapper; this.httpClient = httpClient; this.config = config; this.processingExecutor = processingExecutor; this.callBackExecutor = callBackExecutor; this.serverId = baseUrl; try { this.changeRequestURL = new URL( new URL(baseUrl), StringUtils.safeFormat( "druid-internal/v1/segments/changeRequests?timeout=%d", config.getHttpLoadQueuePeonHostTimeout().getMillis() ) ); } <START> catch (MalformedURLException ex) { <END> throw Throwables.propagate(ex); } }</code><technical_language>This is part of dynamic config, correct</technical_language>

Target:
public HttpLoadQueuePeon( String baseUrl, ObjectMapper jsonMapper, HttpClient httpClient, DruidCoordinatorConfig config, ScheduledExecutorService processingExecutor, ExecutorService callBackExecutor ) { this.jsonMapper = jsonMapper; this.requestBodyWriter = jsonMapper.writerWithType(REQUEST_ENTITY_TYPE_REF); this.httpClient = httpClient; this.config = config; this.processingExecutor = processingExecutor; this.callBackExecutor = callBackExecutor; this.serverId = baseUrl; try { this.changeRequestURL = new URL( new URL(baseUrl), StringUtils.safeFormat( "druid-internal/v1/segments/changeRequests?timeout=%d", config.getHttpLoadQueuePeonHostTimeout().getMillis() ) ); } catch (MalformedURLException ex) { throw Throwables.propagate(ex); } }
Source:
<code>public void afterRun() throws Exception { super.afterRun(); if (recordStore.isWanReplicationEnabled()) { <START> for (Data key : keys) { <END> CacheRecord record = recordStore.getRecord(key); wanEventPublisher.publishWanUpdate(name, CacheEntryViews.createEntryView(key, expiryPolicy, record)); } } }</code><technical_language>CacheOperation#publishWanUpdate here</technical_language>

Target:
public void afterRun() throws Exception { super.afterRun(); if (recordStore.isWanReplicationEnabled()) { for (Data key : keys) { CacheRecord record = recordStore.getRecord(key); publishWanUpdate(key, record); } } }