auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onResetClusterEmulatedMachine() { final ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } ArrayList<VdcActionParametersBase> prms = new ArrayList<>(); for (Cluster cluster : getSelectedItems()) { ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster); currentParam.setForceResetEmulatedMachine(true); prms.add(currentParam); } model.startProgress(); Frontend.getInstance().runMultipleAction(VdcActionType.UpdateCluster, prms, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { <START> if (result.getReturnValue().get(0) != null && result.getReturnValue().get(0).getActionReturnValue() != null) { <END> ConfirmationModel confirmModel = new ConfirmationModel(); setConfirmWindow(confirmModel); confirmModel.setTitle("Update Cluster fault VMs / Templates"); confirmModel.setHelpTag(HelpTag.disable_cpu_thread_support); confirmModel.setHashName("disable_cpu_thread_support"); confirmModel.setMessage("Cannot update: " + result.getReturnValue().get(0).getActionReturnValue().toString()); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveConfirmGenericWarnings", ClusterListModel.this); getConfirmWindow().getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmation", ClusterListModel.this); getConfirmWindow().getCommands().add(tempVar2); } model.stopProgress(); cancel(); } }); }</code><technical_language>this code onSaveInternalWithModel() method. is a multipleAction, avoid .get(0). call</technical_language>

Target:
public void onResetClusterEmulatedMachine() { final ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } ArrayList<VdcActionParametersBase> prms = new ArrayList<>(); for (Cluster cluster : getSelectedItems()) { ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster); currentParam.setForceResetEmulatedMachine(true); prms.add(currentParam); } model.startProgress(); Frontend.getInstance().runMultipleAction(VdcActionType.UpdateCluster, prms, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { model.stopProgress(); cancel(); } }); }
Source:
<code>public void prepareRun(BatchSourceContext context) throws Exception { LOG.debug("pluginType = {}; pluginName = {}; connectionString = {}; importQuery = {}; " + "boundingQuery = {}", sourceConfig.jdbcPluginType, sourceConfig.jdbcPluginName, sourceConfig.connectionString, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery()); Job job = Job.getInstance(); Configuration hConf = job.getConfiguration(); hConf.clear(); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); if (sourceConfig.user == null && sourceConfig.password == null) { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString); } else { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString, sourceConfig.user, sourceConfig.password); } DataDrivenETLDBInputFormat.setInput(hConf, DBRecord.class, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery(), sourceConfig.getEnableAutoCommit()); <START> job.getConfiguration().set(DBConfiguration.INPUT_ORDER_BY_PROPERTY, sourceConfig.splitBy); <END> context.setInput(new SourceInputFormatProvider(DataDrivenETLDBInputFormat.class, hConf)); }</code><technical_language>nit: hConf.set</technical_language>

Target:
public void prepareRun(BatchSourceContext context) throws Exception { LOG.debug("pluginType = {}; pluginName = {}; connectionString = {}; importQuery = {}; " + "boundingQuery = {}", sourceConfig.jdbcPluginType, sourceConfig.jdbcPluginName, sourceConfig.connectionString, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery()); Job job = Job.getInstance(); Configuration hConf = job.getConfiguration(); hConf.clear(); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); if (sourceConfig.user == null && sourceConfig.password == null) { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString); } else { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString, sourceConfig.user, sourceConfig.password); } DataDrivenETLDBInputFormat.setInput(hConf, DBRecord.class, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery(), sourceConfig.getEnableAutoCommit()); hConf.set(DBConfiguration.INPUT_ORDER_BY_PROPERTY, sourceConfig.splitBy); context.setInput(new SourceInputFormatProvider(DataDrivenETLDBInputFormat.class, hConf)); }
Source:
<code>private void addPageToBucket(PageId pageId, int bucket) { mBucketMap.compute(bucket, (bucketKey, pageSet) -> { <START> Set<PageId> set = pageSet == null ? new LinkedHashSet<>() : pageSet; <END> set.add(pageId); return set; }); }</code><technical_language>If change LinkedHashSet LinkedHashMap access order (check LRUCacheEvictor), a LRU bucket in case? @calvinjia</technical_language>

Target:
private void addPageToBucket(PageId pageId, int bucket) { mBucketMap.compute(bucket, (bucketKey, lruMap) -> { Map<PageId, Boolean> map = lruMap == null ? new LinkedHashMap<>( BUCKET_LRU_PAGE_MAP_INIT_CAPACITY, BUCKET_LRU_PAGE_MAP_INIT_LOAD_FACTOR, true) : lruMap; map.put(pageId, UNUSED_MAP_VALUE); return map; }); LOG.debug("added page to bucket {}", pageId, bucket); }
Source:
<code>public static MassRepairPartSet performWarehouseMassRepair(List<IPartWork> selectedParts, List<MassRepairOption> mroList, MassRepairConfiguredOptions configuredOptions, CampaignGUI campaignGUI) { Campaign campaign = campaignGUI.getCampaign(); campaign.addReport("Beginning mass warehouse repair."); ArrayList<Person> techs = campaign.getTechs(true); if (techs.isEmpty()) { campaign.addReport("No available techs to repairs parts."); } else { Map<Integer, MassRepairOption> mroByTypeMap = new HashMap<Integer, MassRepairOption>(); for (int i = 0; i < mroList.size(); i++) { mroByTypeMap.put(mroList.get(i).getType(), mroList.get(i)); } MassRepairPartSet partSet = new MassRepairPartSet(); List<IPartWork> parts = filterParts(selectedParts, mroByTypeMap, techs, campaign); if (parts.isEmpty()) { return partSet; } for (IPartWork partWork : parts) { Part part = (Part) partWork; part.resetModeToNormal(); List<Person> validTechs = filterTechs(partWork, techs, mroByTypeMap, true, campaignGUI); if (validTechs.isEmpty()) { continue; } int originalQuantity = part.getQuantity(); for (int i = 0; i < originalQuantity; i++) { partSet.addPartAction( repairPart(campaignGUI, part, null, validTechs, mroByTypeMap, configuredOptions, true)); } } } <START> return null; <END> }</code><technical_language>this return null, add @Nullable annotation method</technical_language>

Target:
public static MassRepairPartSet performWarehouseMassRepair(List<IPartWork> selectedParts, List<MassRepairOption> mroList, MassRepairConfiguredOptions configuredOptions, CampaignGUI campaignGUI) { Campaign campaign = campaignGUI.getCampaign(); campaign.addReport("Beginning mass warehouse repair."); List<Person> techs = campaign.getTechs(true); MassRepairPartSet partSet = new MassRepairPartSet(); if (techs.isEmpty()) { campaign.addReport("No available techs to repairs parts."); } else { Map<Integer, MassRepairOption> mroByTypeMap = new HashMap<Integer, MassRepairOption>(); for (int i = 0; i < mroList.size(); i++) { mroByTypeMap.put(mroList.get(i).getType(), mroList.get(i)); } List<IPartWork> parts = filterParts(selectedParts, mroByTypeMap, techs, campaign); if (!parts.isEmpty()) { for (IPartWork partWork : parts) { Part part = (Part) partWork; part.resetModeToNormal(); List<Person> validTechs = filterTechs(partWork, techs, mroByTypeMap, true, campaignGUI); if (validTechs.isEmpty()) { continue; } int originalQuantity = part.getQuantity(); for (int i = 0; i < originalQuantity; i++) { partSet.addPartAction( repairPart(campaignGUI, part, null, validTechs, mroByTypeMap, configuredOptions, true)); } } } } return partSet; }
Source:
<code>public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); <START> if ("electrad".equalsIgnoreCase(walletType)) { <END> String protocol = st.nextToken(); String username = st.nextToken(); String password = st.nextToken(); String hostname = st.nextToken(); String port = st.nextToken(); String accountName =""; if (st.hasMoreTokens()) { accountName = st.nextToken(); } if (protocol != null && username != null && password != null && hostname !=null && port != null && accountName != null) { String rpcURL = protocol +"://" + username +":" + password + "@" + hostname +":" + port; return new LindaRPCWallet(rpcURL,accountName); } } } return null; }</code><technical_language>Please, proof-read code submitting PR. meant "lindad"</technical_language>

Target:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("lindad".equalsIgnoreCase(walletType)) { String protocol = st.nextToken(); String username = st.nextToken(); String password = st.nextToken(); String hostname = st.nextToken(); String port = st.nextToken(); String accountName =""; if (st.hasMoreTokens()) { accountName = st.nextToken(); } if (protocol != null && username != null && password != null && hostname !=null && port != null && accountName != null) { String rpcURL = protocol +"://" + username +":" + password + "@" + hostname +":" + port; return new LindaRPCWallet(rpcURL,accountName); } } } return null; }
Source:
<code>public Schema getSchema() { if (Strings.isNullOrEmpty(schema)) { <START> throw new IllegalArgumentException("Schema is either null or empty. It must be specified."); <END> } try { return Schema.parseJson(schema); } catch (IOException e) { throw new IllegalArgumentException(String.format("Invalid schema : %s", e.getMessage()), e); } }</code><technical_language>null empty is technical. like: Schema provided</technical_language>

Target:
public Schema getSchema() { if (Strings.isNullOrEmpty(schema)) { throw new IllegalArgumentException("Schema must be provided."); } try { return Schema.parseJson(schema); } catch (IOException e) { throw new IllegalArgumentException(String.format("Invalid schema : %s", e.getMessage()), e); } }
Source:
<code>public static InterfaceParams getByName(String name) { final NetworkInterface netif = getNetworkInterfaceByName(name); if (netif == null) return null; final MacAddress macAddr = getMacAddress(netif); try { return new InterfaceParams(name, netif.getIndex(), macAddr, netif.getMTU()); <START> } catch (IllegalArgumentException|NullPointerException|SocketException e) { <END> return null; } }</code><technical_language>Out of curiosity, this NPE from? netif is null this point</technical_language>

Target:
public static InterfaceParams getByName(String name) { final NetworkInterface netif = getNetworkInterfaceByName(name); if (netif == null) return null; final MacAddress macAddr = getMacAddress(netif); try { return new InterfaceParams(name, netif.getIndex(), macAddr, netif.getMTU()); } catch (IllegalArgumentException|SocketException e) { return null; } }
Source:
<code>private String getSentenceSeparator(Class<?> testClass) { Optional<IndicativeSentencesGeneration> indicativeSentencesGeneration = getIndicativeSentencesGeneration( testClass); <START> if (indicativeSentencesGeneration.isPresent()) { <END> if (indicativeSentencesGeneration.get().separator().equals("")) { return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; } else { return indicativeSentencesGeneration.get().separator(); } } return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; }</code><technical_language>kind of thought here, I negate this if condition get rid of else block... I guess a matter of taste ^^</technical_language>

Target:
private String getSentenceSeparator(Class<?> testClass) { Optional<IndicativeSentencesGeneration> indicativeSentencesGeneration = getIndicativeSentencesGeneration( testClass); if (indicativeSentencesGeneration.isPresent()) { if (indicativeSentencesGeneration.get().separator().equals("")) { return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; } return indicativeSentencesGeneration.get().separator(); } return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; }
Source:
<code>public void validate_shouldPassValidationIfAllFieldsAreCorrect() throws Exception { DrugOrder order = new DrugOrder(); Encounter encounter = new Encounter(); Patient patient = Context.getPatientService().getPatient(2); order.setConcept(Context.getConceptService().getConcept(88)); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDosingType(DrugOrder.DosingType.FREE_TEXT); order.setInstructions("Instructions"); order.setPatient(patient); encounter.setPatient(patient); order.setEncounter(encounter); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1); order.setStartDate(cal.getTime()); order.setDateStopped(new Date()); order.setAutoExpireDate(new Date()); order.setUrgency(Order.Urgency.ROUTINE); order.setAction(Order.Action.NEW); order.setOrderType(Context.getOrderService().getOrderTypeByName("Drug order")); order.setDrug(Context.getConceptService().getDrug(3)); <START> order.setCareSetting(new CareSetting("OPD", "Outpatient", CareSetting.CareSettingType.OUTPATIENT)); <END> double quantity = 2.00; order.setQuantity(quantity); Concept quantityUnitsConcept = new Concept(); quantityUnitsConcept.setConceptId(101); order.setQuantityUnits(quantityUnitsConcept); Assert.assertTrue(order.getQuantityUnits().getConceptId().equals(quantityUnitsConcept.getConceptId())); order.setNumRefills(10); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertFalse(errors.hasErrors()); }</code><technical_language>of existing care settings in test dataset</technical_language>

Target:
public void validate_shouldPassValidationIfAllFieldsAreCorrect() throws Exception { DrugOrder order = new DrugOrder(); Encounter encounter = new Encounter(); Patient patient = Context.getPatientService().getPatient(2); order.setConcept(Context.getConceptService().getConcept(88)); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDosingType(DrugOrder.DosingType.FREE_TEXT); order.setInstructions("Instructions"); order.setPatient(patient); encounter.setPatient(patient); order.setEncounter(encounter); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1); order.setStartDate(cal.getTime()); order.setDateStopped(new Date()); order.setAutoExpireDate(new Date()); order.setOrderType(Context.getOrderService().getOrderTypeByName("Drug order")); order.setDrug(Context.getConceptService().getDrug(3)); order.setCareSetting(Context.getOrderService().getCareSetting(1)); double quantity = 2.00; order.setQuantity(quantity); Concept quantityUnitsConcept = new Concept(); quantityUnitsConcept.setConceptId(101); order.setQuantityUnits(quantityUnitsConcept); Assert.assertTrue(order.getQuantityUnits().getConceptId().equals(quantityUnitsConcept.getConceptId())); order.setNumRefills(10); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertFalse(errors.hasErrors()); }
Source:
<code>public boolean test(String password, String encryptedPassword) { requireNonNull(password, "Required non-null password"); requireNonNull(password, "Required non-null encrypted password"); final Matcher matcher = PWD_REGEX.matcher(encryptedPassword); if (!matcher.matches()) { return false; } final Integer iterations = tryParse(firstNonNull(matcher.group("iterations"), "")); final String salt = matcher.group("saltHash"); final String pwdHash = matcher.group("pwdHash"); <START> if (salt == null || iterations == null || iterations <= 0 || pwdHash == null) { <END> return false; } final HashCode hash = computeHash(password.toCharArray(), HashCode.fromString(salt).asBytes(), iterations); return hash.toString().equals(pwdHash); }</code><technical_language>Encrypted password matches regexp regexp require 1+ symbols in group. NULL checks needed</technical_language>

Target:
public boolean test(String password, String encryptedPassword) { requireNonNull(password, "Required non-null password"); requireNonNull(password, "Required non-null encrypted password"); final Matcher matcher = PWD_REGEX.matcher(encryptedPassword); if (!matcher.matches()) { return false; } final Integer iterations = tryParse(matcher.group("iterations")); final String salt = matcher.group("saltHash"); final String pwdHash = matcher.group("pwdHash"); final HashCode hash = computeHash(password.toCharArray(), HashCode.fromString(salt).asBytes(), iterations); return hash.toString().equals(pwdHash); }
Source:
<code>protected boolean addVmImages() { if (!vmDisksSource.getDiskTemplateMap().isEmpty()) { if (getVm().getStatus() != VMStatus.Down) { log.error("Cannot add images. VM is not Down"); throw new EngineException(EngineError.IRS_IMAGE_STATUS_ILLEGAL); } VmHandler.lockVm(getVmId()); Collection<DiskImage> templateDisks = getImagesToCheckDestinationStorageDomains(); List<DiskImage> diskImages = ImagesHandler.filterImageDisks(templateDisks, true, false, true); for (DiskImage image : diskImages) { VdcReturnValueBase result = runInternalActionWithTasksContext( VdcActionType.CreateSnapshotFromTemplate, buildCreateSnapshotFromTemplateParameters(image)); if (!result.getSucceeded()) { throw new EngineException(result.getFault().getError()); } else { getTaskIdList().addAll(result.getInternalVdsmTaskIdList()); DiskImage newImage = (DiskImage) result.getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.put(image.getId(), newImage.getId()); } } List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(templateDisks); <START> if (!cinderDisks.isEmpty()) { <END> addVmCinderDisks(cinderDisks); } } return true; }</code><technical_language>consider moving if addVmCinderDisks method</technical_language>

Target:
protected boolean addVmImages() { if (!vmDisksSource.getDiskTemplateMap().isEmpty()) { if (getVm().getStatus() != VMStatus.Down) { log.error("Cannot add images. VM is not Down"); throw new EngineException(EngineError.IRS_IMAGE_STATUS_ILLEGAL); } VmHandler.lockVm(getVmId()); Collection<DiskImage> templateDisks = getImagesToCheckDestinationStorageDomains(); List<DiskImage> diskImages = ImagesHandler.filterImageDisks(templateDisks, true, false, true); for (DiskImage image : diskImages) { VdcReturnValueBase result = runInternalActionWithTasksContext( VdcActionType.CreateSnapshotFromTemplate, buildCreateSnapshotFromTemplateParameters(image)); if (!result.getSucceeded()) { throw new EngineException(result.getFault().getError()); } else { getTaskIdList().addAll(result.getInternalVdsmTaskIdList()); DiskImage newImage = (DiskImage) result.getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.put(image.getId(), newImage.getId()); } } addVmCinderDisks(templateDisks); } return true; }
Source:
<code>public JPanel getComponent() { myModel = new ResourceAssignmentsTableModel(myPerson); myTable = new JTable(myModel); UIUtil.setupTableUI(getTable()); setUpTasksComboColumn(getTable().getColumnModel().getColumn(ResourceAssignmentsTableModel.Column.NAME.ordinal()), getTable()); AbstractTableAndActionsComponent<ResourceAssignment> tableAndActions = new AbstractTableAndActionsComponent<ResourceAssignment>(getTable()) { @Override protected void onAddEvent() { getTable().editCellAt(myModel.getRowCount() - 1, 1); } @Override protected void onDeleteEvent() { if (getTable().isEditing() && getTable().getCellEditor() != null) { getTable().getCellEditor().stopCellEditing(); } myModel.delete(getTable().getSelectedRows()); } @Override protected ResourceAssignment getValue(int row) { <START> java.util.List<ResourceAssignment> values = myModel.getResourcesAssignments(); <END> return (row >= 0 && row < values.size()) ? values.get(row) : null; } }; JPanel tablePanel = AbstractTableAndActionsComponent.createDefaultTableAndActions(getTable(), tableAndActions.getActionsComponent()); return tablePanel; }</code><technical_language>remove wildcard import javax.swing.* ? I IDEA adds automatically a setting for (let is ;)</technical_language>

Target:
public JPanel getComponent() { myModel = new ResourceAssignmentsTableModel(myPerson); myTable = new JTable(myModel); UIUtil.setupTableUI(getTable()); setUpTasksComboColumn(getTable().getColumnModel().getColumn(ResourceAssignmentsTableModel.Column.NAME.ordinal()), getTable()); AbstractTableAndActionsComponent<ResourceAssignment> tableAndActions = new AbstractTableAndActionsComponent<ResourceAssignment>(getTable()) { @Override protected void onAddEvent() { getTable().editCellAt(myModel.getRowCount() - 1, 1); } @Override protected void onDeleteEvent() { if (getTable().isEditing() && getTable().getCellEditor() != null) { getTable().getCellEditor().stopCellEditing(); } myModel.delete(getTable().getSelectedRows()); } @Override protected ResourceAssignment getValue(int row) { java.util.List<ResourceAssignment> values = myModel.getResourcesAssignments(); return (row >= 0 && row < values.size()) ? values.get(row) : null; } }; return AbstractTableAndActionsComponent.createDefaultTableAndActions(getTable(), tableAndActions.getActionsComponent()); }
Source:
<code>public boolean matches(RelOptRuleCall call) { LogicalTableScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); <START> if (tableSourceTable != null && tableSourceTable.tableSource() instanceof SupportsProjectionPushDown) { <END> SupportsProjectionPushDown pushDownSource = (SupportsProjectionPushDown) tableSourceTable.tableSource(); if (pushDownSource.supportsNestedProjection()) { throw new TableException("Nested projection push down is unsupported now. \n" + "Please disable nested projection (SupportsProjectionPushDown#supportsNestedProjection returns false), " + "planner will push down the top-level columns."); } else { return true; } } else { return false; } }</code><technical_language>check false condition save level of indent</technical_language>

Target:
public boolean matches(RelOptRuleCall call) { LogicalTableScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); if (tableSourceTable == null || !(tableSourceTable.tableSource() instanceof SupportsProjectionPushDown)) { return false; } SupportsProjectionPushDown pushDownSource = (SupportsProjectionPushDown) tableSourceTable.tableSource(); if (pushDownSource.supportsNestedProjection()) { throw new TableException("Nested projection push down is unsupported now. \n" + "Please disable nested projection (SupportsProjectionPushDown#supportsNestedProjection returns false), " + "planner will push down the top-level columns."); } else { return true; } }
Source:
<code>static String getDefaulResourceAdapter(DeploymentUnit deploymentUnit) { EEModuleDescription eeDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if (eeDescription != null) { String defaultJndiName = eeDescription.getDefaultResourceJndiNames().getJmsConnectionFactory(); ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(defaultJndiName); ServiceController binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { Object pcf = binder.getService().getValue(); if (pcf != null && pcf instanceof ConnectionFactoryReferenceFactoryService) { return ((ConnectionFactoryReferenceFactoryService) pcf).getName(); } if (pcf != null && pcf instanceof ContextListAndJndiViewManagedReferenceFactory) { ManagedReference ref = ((ContextListAndJndiViewManagedReferenceFactory) pcf).getReference(); Object ra = ref.getInstance(); if (ra instanceof ActiveMQRAConnectionFactoryImpl) { bindInfo = ContextNames.bindInfoFor(((ActiveMQRAConnectionFactoryImpl) ra).getReference().getClassName()); binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { pcf = binder.getService().getValue(); if (pcf != null && pcf instanceof ConnectionFactoryReferenceFactoryService) { return ((ConnectionFactoryReferenceFactoryService) pcf).getName(); <START> } <END> } } } } } return null; }</code><technical_language>Minor point; ignore if want -- this L435-437 block duplicates L423-425 dropped if this entire new code block L426 moved L423</technical_language>

Target:
static String getDefaulResourceAdapter(DeploymentUnit deploymentUnit) { EEModuleDescription eeDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if (eeDescription != null) { String defaultJndiName = eeDescription.getDefaultResourceJndiNames().getJmsConnectionFactory(); ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(defaultJndiName); ServiceController binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { Object pcf = binder.getService().getValue(); if (pcf != null && pcf instanceof ContextListAndJndiViewManagedReferenceFactory) { ManagedReference ref = ((ContextListAndJndiViewManagedReferenceFactory) pcf).getReference(); Object ra = ref.getInstance(); if (ra instanceof ActiveMQRAConnectionFactoryImpl) { bindInfo = ContextNames.bindInfoFor(((ActiveMQRAConnectionFactoryImpl) ra).getReference().getClassName()); binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { pcf = binder.getService().getValue(); } } } if (pcf != null && pcf instanceof ConnectionFactoryReferenceFactoryService) { return ((ConnectionFactoryReferenceFactoryService) pcf).getName(); } } } return null; }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime <END> * result + ((additionalOptions == null) ? 0 : additionalOptions .hashCode()); result = prime * result + ((hardwareId == null) ? 0 : hardwareId.hashCode()); result = prime * result + ((hypervisorRegex == null) ? 0 : hypervisorRegex.hashCode()); result = prime * result + ((imageDescriptionRegex == null) ? 0 : imageDescriptionRegex .hashCode()); result = prime * result + ((imageId == null) ? 0 : imageId.hashCode()); result = prime * result + ((imageNameRegex == null) ? 0 : imageNameRegex.hashCode()); result = prime * result + ((imageVersionRegex == null) ? 0 : imageVersionRegex .hashCode()); result = prime * result + ((is64bit == null) ? 0 : is64bit.hashCode()); result = prime * result + ((locationId == null) ? 0 : locationId.hashCode()); result = prime * result + ((minCores == null) ? 0 : minCores.hashCode()); result = prime * result + ((minRam == null) ? 0 : minRam.hashCode()); result = prime * result + ((options == null) ? 0 : options.hashCode()); result = prime * result + ((os == null) ? 0 : os.hashCode()); result = prime * result + ((osArchictectureRegex == null) ? 0 : osArchictectureRegex .hashCode()); result = prime * result + ((osDescriptionRegex == null) ? 0 : osDescriptionRegex .hashCode()); result = prime * result + ((osNameRegex == null) ? 0 : osNameRegex.hashCode()); result = prime * result + ((osVersionRegex == null) ? 0 : osVersionRegex.hashCode()); return result; }</code><technical_language>Yuck auto-generated hashCode equals methods! Understand required code for write, more code maintain. I return Objects.hashCode(additionalOptions, commands, hardware, hardwareId, ...)</technical_language>

Target:
public int hashCode() { return Objects.hashCode( additionalOptions, hardwareId, hypervisorRegex, imageDescriptionRegex, imageId, imageNameRegex, imageVersionRegex, is64bit, locationId, minCores, minRam, options, os, osArchitectureRegex, osDescriptionRegex, osNameRegex, osVersionRegex, 0); }
Source:
<code>protected boolean getSuiteFilterAndStrategy(Class<?> klass) throws Exception { String strategy = System.getProperty(SUITE_FILTER_STRATEGY_OVERRIDE_VARIABLE_NAME); <START> if(StringUtils.isEmpty(strategy)){ <END> return super.getSuiteFilterAndStrategy(klass); } else if (strategy.equalsIgnoreCase("and")){ return true; } else { return false; } }</code><technical_language>space if, {</technical_language>

Target:
protected boolean getSuiteFilterAndStrategy(Class<?> klass) throws Exception { String strategy = System.getProperty(SUITE_FILTER_STRATEGY_OVERRIDE_VARIABLE_NAME); if (StringUtils.isEmpty(strategy)) { return super.getSuiteFilterAndStrategy(klass); } else { return strategy.equalsIgnoreCase("and"); } }
Source:
<code>public void init() { URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233"); <START> url = url.addParameter( "save.file",true ); <END> testUrl = URL.valueOf("<LINK_1>"); mockUrl = new URL("dubbo", "127.0.0.0", 2200); parametersConsumer.put("application", "demo-consumer"); parametersConsumer.put("category", "consumer"); parametersConsumer.put("check", "false"); parametersConsumer.put("dubbo", "2.0.2"); parametersConsumer.put("interface", "org.apache.dubbo.demo.DemoService"); parametersConsumer.put("methods", "sayHello"); parametersConsumer.put("pid", "1676"); parametersConsumer.put("qos.port", "333333"); parametersConsumer.put("side", "consumer"); parametersConsumer.put("timestamp", String.valueOf(System.currentTimeMillis())); abstractRegistry = new AbstractRegistry(url) { @Override public boolean isAvailable() { return false; } }; listener = urls -> notifySuccess = true; notifySuccess = false; }</code><technical_language>code style. ("save.file", true);</technical_language>

Target:
public void init() { URL url = URL.valueOf("dubbo://192.168.0.2:2233"); url = url.addParameter("save.file",true); testUrl = URL.valueOf("<LINK_0>"); mockUrl = new URL("dubbo", "192.168.0.1", 2200); parametersConsumer.put("application", "demo-consumer"); parametersConsumer.put("category", "consumer"); parametersConsumer.put("check", "false"); parametersConsumer.put("dubbo", "2.0.2"); parametersConsumer.put("interface", "org.apache.dubbo.demo.DemoService"); parametersConsumer.put("methods", "sayHello"); parametersConsumer.put("pid", "1676"); parametersConsumer.put("qos.port", "333333"); parametersConsumer.put("side", "consumer"); parametersConsumer.put("timestamp", String.valueOf(System.currentTimeMillis())); abstractRegistry = new AbstractRegistry(url) { @Override public boolean isAvailable() { return false; } }; listener = urls -> notifySuccess = true; notifySuccess = false; }
Source:
<code>private static ModuleOutput writeOutput(Compiler compiler, Flags flags) { ArrayList<File> outputFiles = new ArrayList<>(); ModuleOutput output = new ModuleOutput(); File file = new File(); file.path = flags.jsOutputFile; String code = compiler.toSource(); String prefix = ""; String postfix = ""; if (flags.outputWrapper != null) { String marker = null; int pos = flags.outputWrapper.indexOf(OUTPUT_MARKER_JS_STRING); if (pos != -1) { code = SourceCodeEscapers.javascriptEscaper().escape(code); marker = OUTPUT_MARKER_JS_STRING; } else { pos = flags.outputWrapper.indexOf(OUTPUT_MARKER); if (pos != -1) { marker = OUTPUT_MARKER; } } if (marker != null) { prefix = flags.outputWrapper.substring(0, pos); SourceMap sourceMap = compiler.getSourceMap(); if (sourceMap != null) { sourceMap.setWrapperPrefix(prefix); } } postfix = flags.outputWrapper.substring(pos + marker.length()); } <START> if (flags.createSourceMap) { <END> if (flags.createSourceMap) { StringBuilder b = new StringBuilder(); try { compiler.getSourceMap().appendTo(b, flags.jsOutputFile); } catch (IOException e) { } file.sourceMap = b.toString(); } } file.src = prefix + code + postfix; outputFiles.add(file); output.compiledFiles = outputFiles.toArray(new File[outputFiles.size()]); output.compiledCode = file.src; output.sourceMap = file.sourceMap; return output; }</code><technical_language>double-conditional</technical_language>

Target:
private static ModuleOutput writeOutput(Compiler compiler, Flags flags) { ArrayList<File> outputFiles = new ArrayList<>(); ModuleOutput output = new ModuleOutput(); File file = new File(); file.path = flags.jsOutputFile; String code = compiler.toSource(); String prefix = ""; String postfix = ""; if (flags.outputWrapper != null) { String marker = null; int pos = flags.outputWrapper.indexOf(OUTPUT_MARKER_JS_STRING); if (pos != -1) { code = SourceCodeEscapers.javascriptEscaper().escape(code); marker = OUTPUT_MARKER_JS_STRING; } else { pos = flags.outputWrapper.indexOf(OUTPUT_MARKER); if (pos != -1) { marker = OUTPUT_MARKER; } } if (marker != null) { prefix = flags.outputWrapper.substring(0, pos); SourceMap sourceMap = compiler.getSourceMap(); if (sourceMap != null) { sourceMap.setWrapperPrefix(prefix); } } postfix = flags.outputWrapper.substring(pos + marker.length()); } if (flags.createSourceMap) { StringBuilder b = new StringBuilder(); try { compiler.getSourceMap().appendTo(b, flags.jsOutputFile); } catch (IOException e) { } file.sourceMap = b.toString(); } file.src = prefix + code + postfix; outputFiles.add(file); output.compiledFiles = outputFiles.toArray(new File[outputFiles.size()]); output.compiledCode = file.src; output.sourceMap = file.sourceMap; return output; }
Source:
<code>protected LicenseInfoHandler(AttachmentDatabaseHandler attachmentDatabaseHandler, ComponentDatabaseHandler componentDatabaseHandler) throws MalformedURLException { this.componentDatabaseHandler = componentDatabaseHandler; <START> this.licenseInfoCache = CacheBuilder.newBuilder().expireAfterWrite(15, TimeUnit.MINUTES).maximumSize(100).build(); <END> AttachmentContentProvider contentProvider = attachment -> attachmentDatabaseHandler.getAttachmentContent(attachment.getAttachmentContentId()); parsers = Lists.newArrayList( new SPDXParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CombinedCLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider, componentDatabaseHandler) ); outputGenerators = Lists.newArrayList( new TextGenerator(), new XhtmlGenerator(), new DocxGenerator() ); }</code><technical_language>magic constants</technical_language>

Target:
protected LicenseInfoHandler(AttachmentDatabaseHandler attachmentDatabaseHandler, ComponentDatabaseHandler componentDatabaseHandler) throws MalformedURLException { this.componentDatabaseHandler = componentDatabaseHandler; this.licenseInfoCache = CacheBuilder.newBuilder().expireAfterWrite(CACHE_TIMEOUT_MINUTES, TimeUnit.MINUTES) .maximumSize(CACHE_MAX_ITEMS).build(); AttachmentContentProvider contentProvider = attachment -> attachmentDatabaseHandler.getAttachmentContent(attachment.getAttachmentContentId()); parsers = Lists.newArrayList( new SPDXParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CombinedCLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider, componentDatabaseHandler) ); outputGenerators = Lists.newArrayList( new TextGenerator(), new XhtmlGenerator(), new DocxGenerator() ); }
Source:
<code>public StudentAttributes getCopy() { <START> return builder(course, name, email) <END> .withComments(comments) .withCreatedAt(createdAt) .withUpdatedAt(updatedAt) .withGoogleId(googleId) .withKey(key) .withLastName(lastName) .withSection(section) .withTeam(team) .withUpdateStatus(updateStatus) .build(); }</code><technical_language>Similarly, this(toEntity()) work</technical_language>

Target:
public StudentAttributes getCopy() { StudentAttributes studentAttributes = valueOf(toEntity()); studentAttributes.updateStatus = updateStatus; studentAttributes.key = key; studentAttributes.createdAt = createdAt; studentAttributes.updatedAt = updatedAt; return studentAttributes; }
Source:
<code>public int compare(Viewer viewer, Object o1, Object o2) { if(o1 instanceof ImportNode && o2 instanceof ImportNode) { if(((ImportNode)o1).getItemRecord() != null && ((ImportNode)o2).getItemRecord() != null && ((ImportNode)o1).getItemRecord().getProperty() != null && ((ImportNode)o2).getItemRecord().getProperty() != null) { String label1 = ((ImportNode)o1).getItemRecord().getProperty().getLabel(); String label2 = ((ImportNode)o2).getItemRecord().getProperty().getLabel(); if (label1 == null) { return -1; } if (label2 == null) { return 1; } if(label1.equals(label2)) { String version1 = ((ImportNode)o1).getItemRecord().getProperty().getVersion(); String version2 = ((ImportNode)o2).getItemRecord().getProperty().getVersion(); if (version1 == null) { return -1; } if (version2 == null) { return 1; } try { float v1 = Float.parseFloat(version1); <START> float v2 = Float.parseFloat(version2); <END> if(v1 > v2) { return 1; }else if(v1 < v2) { return -1; } } catch (Exception e) { return 0; } } } } return super.compare(viewer, o1, o2); }</code><technical_language>process version 1.11? I problem. org.talend.commons.utils.Version, implements interface Comparable</technical_language>

Target:
public int compare(Viewer viewer, Object o1, Object o2) { if(o1 instanceof ImportNode && o2 instanceof ImportNode) { if(((ImportNode)o1).getItemRecord() != null && ((ImportNode)o2).getItemRecord() != null && ((ImportNode)o1).getItemRecord().getProperty() != null && ((ImportNode)o2).getItemRecord().getProperty() != null) { String label1 = ((ImportNode)o1).getItemRecord().getProperty().getLabel(); String label2 = ((ImportNode)o2).getItemRecord().getProperty().getLabel(); if (label1 == null) { return -1; } if (label2 == null) { return 1; } if(label1.equals(label2)) { String version1 = ((ImportNode)o1).getItemRecord().getProperty().getVersion(); String version2 = ((ImportNode)o2).getItemRecord().getProperty().getVersion(); if (version1 == null) { return -1; } if (version2 == null) { return 1; } return new Version(version1).compareTo(new Version(version2)); } } } return super.compare(viewer, o1, o2); }
Source:
<code>ListeningUser checkPermissionReturningListeningUser(String methodName, String permissionMsg) throws NotConnectedException, PermissionException { <START> Pair<ListeningUser, UserIdentificationImpl> pair = renewSession(false); <END> final String fullMethodName = SchedulerFrontend.class.getName() + "." + methodName; final MethodCallPermission methodCallPermission = new MethodCallPermission(fullMethodName); try { pair.getRight().checkPermission(methodCallPermission, permissionMsg); } catch (PermissionException ex) { logger.debug(permissionMsg); throw ex; } return pair.getLeft(); }</code><technical_language>rename pair userIdPair userSessionPair</technical_language>

Target:
ListeningUser checkPermissionReturningListeningUser(String methodName, String permissionMsg) throws NotConnectedException, PermissionException { Pair<ListeningUser, UserIdentificationImpl> userSessionInfo = renewSession(false); final String fullMethodName = SchedulerFrontend.class.getName() + "." + methodName; final MethodCallPermission methodCallPermission = new MethodCallPermission(fullMethodName); try { userSessionInfo.getRight().checkPermission(methodCallPermission, permissionMsg); } catch (PermissionException ex) { logger.debug(permissionMsg); throw ex; } return userSessionInfo.getLeft(); }
Source:
<code>private Optional<AssignableNode> getNodeWithHighestPoints(AssignableReplica replica, List<AssignableNode> assignableNodes, ClusterContext clusterContext, OptimalAssignment optimalAssignment) { Map<AssignableNode, List<HardConstraint>> hardConstraintFailures = new HashMap<>(); List<AssignableNode> candidateNodes = assignableNodes.stream().filter(candidateNode -> { boolean isValid = true; for (HardConstraint hardConstraint : _hardConstraints) { if (!hardConstraint.isAssignmentValid(candidateNode, replica, clusterContext)) { hardConstraintFailures.computeIfAbsent(candidateNode, node -> new ArrayList<>()).add(hardConstraint); isValid = false; } } return isValid; }).collect(Collectors.toList()); if (candidateNodes.isEmpty()) { optimalAssignment.recordAssignmentFailure(replica, hardConstraintFailures); return Optional.empty(); } Function<AssignableNode, Double> calculatePoints = (candidateNode) -> _softConstraints.stream().map(softConstraint -> softConstraint <START> .getAssignmentOriginScore(candidateNode, replica, clusterContext)) <END> .mapToDouble(score -> score).sum(); return candidateNodes.stream().max(Comparator.comparing(calculatePoints)); }</code><technical_language>ScalerFunction is used</technical_language>

Target:
private Optional<AssignableNode> getNodeWithHighestPoints(AssignableReplica replica, List<AssignableNode> assignableNodes, ClusterContext clusterContext, OptimalAssignment optimalAssignment) { Map<AssignableNode, List<HardConstraint>> hardConstraintFailures = new HashMap<>(); List<AssignableNode> candidateNodes = assignableNodes.stream().filter(candidateNode -> { boolean isValid = true; for (HardConstraint hardConstraint : _hardConstraints) { if (!hardConstraint.isAssignmentValid(candidateNode, replica, clusterContext)) { hardConstraintFailures.computeIfAbsent(candidateNode, node -> new ArrayList<>()) .add(hardConstraint); isValid = false; } } return isValid; }).collect(Collectors.toList()); if (candidateNodes.isEmpty()) { optimalAssignment.recordAssignmentFailure(replica, Maps.transformValues(hardConstraintFailures, this::convertFailureReasons)); return Optional.empty(); } Function<AssignableNode, Float> calculatePoints = (candidateNode) -> _softConstraintsWeightModel.getSumOfScores(_softConstraints.stream() .collect(Collectors.toMap(Function.identity(), softConstraint -> softConstraint .getAssignmentOriginScore(candidateNode, replica, clusterContext)))); return candidateNodes.stream().max(Comparator.comparing(calculatePoints)); }
Source:
<code>private Type handleResolvedField(Expression node, FieldId fieldId, Field field, StackableAstVisitorContext<Context> context) { if (context.getContext().isInLambda()) { LambdaArgumentDeclaration lambdaArgumentDeclaration = context.getContext().getFieldToLambdaArgumentDeclaration().get(fieldId); if (lambdaArgumentDeclaration != null) { lambdaArgumentReferences.put(NodeRef.of((Identifier) node), lambdaArgumentDeclaration); return setExpressionType(node, field.getType()); } } <START> if (field.getOriginTable().isPresent() && field.getName().isPresent() && !field.isAliased()) { <END> tableColumnReferences.put(field.getOriginTable().get(), field.getName().get()); } FieldId previous = columnReferences.put(NodeRef.of(node), fieldId); checkState(previous == null, "%s already known to refer to %s", node, previous); return setExpressionType(node, field.getType()); }</code><technical_language>This wrong. field is alias, name refers a column in source table (vs a column in output of a SELECT). For instance, this work expected this fix: SELECT my_alias (SELECT name my_alias nation) my_alias in outer select origin table, is aliased. fix this, I need track origin table origin column for field</technical_language>

Target:
private Type handleResolvedField(Expression node, FieldId fieldId, Field field, StackableAstVisitorContext<Context> context) { if (context.getContext().isInLambda()) { LambdaArgumentDeclaration lambdaArgumentDeclaration = context.getContext().getFieldToLambdaArgumentDeclaration().get(fieldId); if (lambdaArgumentDeclaration != null) { lambdaArgumentReferences.put(NodeRef.of((Identifier) node), lambdaArgumentDeclaration); return setExpressionType(node, field.getType()); } } if (field.getOriginTable().isPresent() && field.getOriginColumnName().isPresent()) { tableColumnReferences.put(field.getOriginTable().get(), field.getOriginColumnName().get()); } FieldId previous = columnReferences.put(NodeRef.of(node), fieldId); checkState(previous == null, "%s already known to refer to %s", node, previous); return setExpressionType(node, field.getType()); }
Source:
<code>private void emitBacklinkFieldAccessors(JavaWriter writer) throws IOException { for (Backlink backlink : metadata.getBacklinkFields()) { String cacheFieldName = backlink.getTargetField() + BACKLINKS_FIELD_EXTENSION; String realmResultsType = "RealmResults<" + backlink.getSourceClass() + ">"; <START> writer.beginMethod(realmResultsType, metadata.getInternalGetter(backlink.getTargetField()), EnumSet.of(Modifier.PUBLIC)); <END> writer.emitStatement("BaseRealm realm = proxyState.getRealm$realm()"); writer.emitStatement("realm.checkIfValid()"); writer.beginControlFlow("if (" + cacheFieldName + " == null)"); writer.emitStatement( cacheFieldName + " = RealmResults.createBacklinkResults(realm, proxyState.getRow$realm(), %s.class, \"%s\")", backlink.getSourceClass(), backlink.getSourceField()); writer.endControlFlow(); writer.emitStatement("return " + cacheFieldName); writer.endMethod(); writer.emitEmptyLine(); writer.beginMethod("void", metadata.getInternalSetter(backlink.getTargetField()), EnumSet.of(Modifier.PUBLIC), realmResultsType, "value"); writer.emitStatement("throw new UnsupportedOperationException(\"Fields that are @LinkingObjects cannot be modified. They are managed by Realm.\")"); writer.endMethod(); writer.emitEmptyLine(); } }</code><technical_language>I conistent, repeating writer. reduces noise of lines writer .emitStatement("...") .beginControlFlow("...") // instead of writer.emitStatement("...") writer.beginControlFlow("...")</technical_language>

Target:
private void emitBacklinkFieldAccessors(JavaWriter writer) throws IOException { for (Backlink backlink : metadata.getBacklinkFields()) { String cacheFieldName = backlink.getTargetField() + BACKLINKS_FIELD_EXTENSION; String realmResultsType = "RealmResults<" + backlink.getSourceClass() + ">"; writer.beginMethod(realmResultsType, metadata.getInternalGetter(backlink.getTargetField()), EnumSet.of(Modifier.PUBLIC)) .emitStatement("BaseRealm realm = proxyState.getRealm$realm()") .emitStatement("realm.checkIfValid()") .beginControlFlow("if (" + cacheFieldName + " == null)") .emitStatement(cacheFieldName + " = RealmResults.createBacklinkResults(realm, proxyState.getRow$realm(), %s.class, \"%s\")", backlink.getSourceClass(), backlink.getSourceField()) .endControlFlow() .emitStatement("return " + cacheFieldName) .endMethod() .emitEmptyLine(); } }
Source:
<code>protected View inflateDialogView(LayoutInflater inflater, ViewGroup container) { pageTitle = getArguments().getParcelable("title"); selectedText = getArguments().getString("selected_text"); rootView = inflater.inflate(R.layout.dialog_wiktionary, container); progressBar = (ProgressBar) rootView.findViewById(R.id.dialog_wiktionary_progress); View overlayRootView = addOverlay(inflater, R.layout.dialog_wiktionary_overlay); Button fullDefinitionButton = (Button) overlayRootView.findViewById(R.id.wiktionary_full_definition_button); fullDefinitionButton.setOnClickListener(viewDefinitionButtonClickListener); fullDefinitionButton.setText(getStringForArticleLanguage(pageTitle, R.string.wiktionary_full_definition)); TextView titleText = (TextView) rootView.findViewById(R.id.wiktionary_definition_dialog_title); titleText.setText(selectedText); setConditionalLayoutDirection(rootView, pageTitle.getSite().getLanguageCode()); <START> progressBar.setVisibility(View.VISIBLE); <END> loadDefinitions(); return rootView; }</code><technical_language>This appears visible in XML</technical_language>

Target:
protected View inflateDialogView(LayoutInflater inflater, ViewGroup container) { pageTitle = getArguments().getParcelable(TITLE); selectedText = getArguments().getString(SELECTED_TEXT); rootView = inflater.inflate(R.layout.dialog_wiktionary, container); progressBar = (ProgressBar) rootView.findViewById(R.id.dialog_wiktionary_progress); View overlayRootView = addOverlay(inflater, R.layout.dialog_wiktionary_overlay); Button fullDefinitionButton = (Button) overlayRootView.findViewById(R.id.wiktionary_full_definition_button); fullDefinitionButton.setOnClickListener(viewDefinitionButtonClickListener); fullDefinitionButton.setText(getStringForArticleLanguage(pageTitle, R.string.wiktionary_full_definition)); TextView titleText = (TextView) rootView.findViewById(R.id.wiktionary_definition_dialog_title); titleText.setText(selectedText); setConditionalLayoutDirection(rootView, pageTitle.getSite().getLanguageCode()); loadDefinitions(); return rootView; }
Source:
<code>protected void onResume() { super.onResume(); <START> <END> }</code><technical_language>Register receiver if isReceiverRegistered is false</technical_language>

Target:
protected void onResume() { super.onResume(); registerReceiver(); }