auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void removeFileMetadataFromList(Collection<FileMetadata> collection, FileMetadata fmToDelete) { if (fmToDelete.getId() != null) { collection.remove(fmToDelete); } else { Iterator<FileMetadata> fmit = collection.iterator(); while (fmit.hasNext()) { FileMetadata fmd = fmit.next(); if (fmToDelete.getDataFile().getStorageIdentifier().equals(fmd.getDataFile().getStorageIdentifier())) { <START> if (fmToDelete.getDatasetVersion().getId() == null) { <END> if (fmd.getDatasetVersion().getId() == null) { fmit.remove(); break; } } else if (fmToDelete.getDatasetVersion().getId().equals(fmd.getDatasetVersion().getId())) { fmit.remove(); break; } } } } }</code><technical_language>a null pointer I try uncommon, previously supported, action of uploading a number of files, deleting saving rest draft version</technical_language>

Target:
public static void removeFileMetadataFromList(Collection<FileMetadata> collection, FileMetadata fmToDelete) { if (fmToDelete.getId() != null) { collection.remove(fmToDelete); } else { Iterator<FileMetadata> fmit = collection.iterator(); while (fmit.hasNext()) { FileMetadata fmd = fmit.next(); if (fmToDelete.getDataFile().getStorageIdentifier().equals(fmd.getDataFile().getStorageIdentifier())) { if(fmToDelete.getDatasetVersion() == null) { fmit.remove(); } else if (fmToDelete.getDatasetVersion().getId() == null) { if (fmd.getDatasetVersion().getId() == null) { fmit.remove(); break; } } else if (fmToDelete.getDatasetVersion().getId().equals(fmd.getDatasetVersion().getId())) { fmit.remove(); break; } } } } }
Source:
<code>public Set<SchemaDescriptor> getRelatedIndexes( long[] changedEntityTokens, long[] unchangedEntityTokens, IntSet properties, <START> EntityType entityType ) <END> { Function<long[],Set<SchemaDescriptor>> byEnitiyIds; BiFunction<long[],IntSet,Set<SchemaDescriptor>> byProperties; if ( entityType == EntityType.NODE ) { byEnitiyIds = labels -> extractIndexesByEntityTokens( labels, descriptorsByLabel, descriptorsForAllLabels ); byProperties = ( unchangedLabels, changedProperties ) -> getDescriptorsByProperties( unchangedLabels, changedProperties, descriptorsByLabel, descriptorsForAllLabels, descriptorsByProperty ); } else { byEnitiyIds = reltypes -> extractIndexesByEntityTokens( reltypes, descriptorsByReltype, descriptorsForAllReltypes ); byProperties = ( unchangedLabels, changedProperties ) -> getDescriptorsByProperties( unchangedLabels, changedProperties, descriptorsByReltype, descriptorsForAllReltypes, relationshipDescriptorsByProperty ); } if ( properties.isEmpty() ) { Set<SchemaDescriptor> descriptors = byEnitiyIds.apply( changedEntityTokens ); return descriptors == null ? Collections.emptySet() : descriptors; } if ( changedEntityTokens.length == 0 ) { return byProperties.apply( unchangedEntityTokens, properties ); } Set<SchemaDescriptor> descriptors = byEnitiyIds.apply( changedEntityTokens ); descriptors.addAll( byProperties.apply( unchangedEntityTokens, properties ) ); return descriptors; }</code><technical_language>clearer if this method specialised entity type, entity type branching happened call stack</technical_language>

Target:
public Set<SchemaDescriptor> getRelatedIndexes( long[] changedEntityTokens, long[] unchangedEntityTokens, IntSet properties, EntityType entityType ) { switch ( entityType ) { case NODE: return getRelatedDescriptors( changedEntityTokens, unchangedEntityTokens, properties, descriptorsByLabel, descriptorsForAllLabels, nodeDescriptorsByProperty ); case RELATIONSHIP: return getRelatedDescriptors( changedEntityTokens, unchangedEntityTokens, properties, descriptorsByReltype, descriptorsForAllReltypes, relationshipDescriptorsByProperty ); default: throw new IllegalArgumentException( "The given EntityType cannot be indexed: " + entityType ); } }
Source:
<code>public static Package getBaseProtocol(Element anElement) { if (anElement != null) { IDefaultLanguage language = null; try { IDefaultLanguageService service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, anElement); language = service.getActiveDefaultLanguage(anElement); } catch (ServiceException e) { Activator.log.error(e); } TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(anElement); Collaboration baseProtocol = language.getBaseProtocol(domain.getResourceSet()); if (baseProtocol != null) { <START> return getProtocolContainer(language.getBaseProtocol(domain.getResourceSet())); <END> } } return null; }</code><technical_language>baseProtocol instead of repeating call language.getBaseProtocol..</technical_language>

Target:
public static Package getBaseProtocol(Element anElement) { if (anElement != null) { IDefaultLanguage language = null; try { IDefaultLanguageService service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, anElement); language = service.getActiveDefaultLanguage(anElement); } catch (ServiceException e) { Activator.log.error(e); } TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(anElement); Collaboration baseProtocol = language.getBaseProtocol(domain.getResourceSet()); if (baseProtocol != null) { return getProtocolContainer(baseProtocol); } } return null; }
Source:
<code>private ValidationResult validateSnapshotsLegality() { Snapshot snapshot = getSnapshotDao().getSnapshotByImageStatus(ImageStatus.ILLEGAL); <START> if (snapshot != null && !snapshot.getId().equals(getParameters().getSnapshotId())) { <END> return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_WITH_ILLEGAL_VOLUME_EXISTS, String.format("$snapshot %s", snapshot.getDescription())); } return ValidationResult.VALID; }</code><technical_language>check snapshots of this specific vm</technical_language>

Target:
private ValidationResult validateSnapshotsLegality() { Optional<Snapshot> snapshot = getSnapshotDao().getSnapshotsByImageStatus(getVmId(), ImageStatus.ILLEGAL).stream().findFirst(); if (snapshot.isPresent() && !snapshot.get().getId().equals(getParameters().getSnapshotId())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_WITH_ILLEGAL_VOLUME_EXISTS, String.format("$snapshot %s", snapshot.get().getDescription())); } return ValidationResult.VALID; }
Source:
<code>public <T> CompletableFuture<ControllerProxy<T>> createController(String name) { if(StringUtil.isBlank(name)) { throw new IllegalArgumentException("name must not be null or empty!"); } if(destroyed) { throw new IllegalStateException("The client is disconnected!"); } <START> final HighlanderBean bean = platformBeanRepository.getHighlanderBean(); <END> bean.setControllerName(name); return invokeDolphinCommand(PlatformConstants.REGISTER_CONTROLLER_COMMAND_NAME).handle((v, e) -> { if (e != null) { throw new RuntimeException(e); } @SuppressWarnings("unchecked") final T model = (T) bean.getModel(); return new ControllerProxyImpl<>(bean.getControllerId(), model, clientDolphin, platformBeanRepository); }); }</code><technical_language>HighlanderBean? Really? :D</technical_language>

Target:
public <T> CompletableFuture<ControllerProxy<T>> createController(String name) { if(StringUtil.isBlank(name)) { throw new IllegalArgumentException("name must not be null or empty!"); } if(destroyed) { throw new IllegalStateException("The client is disconnected!"); } final InternalAttributesBean bean = platformBeanRepository.getInternalAttributesBean(); bean.setControllerName(name); return invokeDolphinCommand(PlatformConstants.REGISTER_CONTROLLER_COMMAND_NAME).handle((v, e) -> { if (e != null) { throw new RuntimeException(e); } @SuppressWarnings("unchecked") final T model = (T) bean.getModel(); return new ControllerProxyImpl<>(bean.getControllerId(), model, clientDolphin, platformBeanRepository); }); }
Source:
<code>public List<URI> getSupportedClaimTypes() { List<URI> supportedClaimTypes = new ArrayList<>(); for (String claim : supportedClaims) { try { supportedClaimTypes.add(new URI(claim)); } catch (URISyntaxException e) { <START> LOGGER.error("Invalid supported claim: \"{}\"", claim); <END> } } return supportedClaimTypes; }</code><technical_language>warning, need admin fix it</technical_language>

Target:
public List<URI> getSupportedClaimTypes() { return this.supportedClaims; }
Source:
<code>public Set<Integer> getGermplasmsWithOpenLots(final List<Integer> gids) { Set<Integer> gidsWithOpenLots = new HashSet<>(); try { Query query = this.getSession().createSQLQuery(GET_GIDS_WITH_OPEN_LOTS).setParameterList("gids", gids); gidsWithOpenLots = Sets.newHashSet(query.list()); } catch (Exception e) { <START> this.logAndThrowException("Error at checkGermplasmsWithOpenLots for GIDss = " + gids + AT_LOT_DAO + e.getMessage(), e); <END> } return gidsWithOpenLots; }</code><technical_language>Split in log throw</technical_language>

Target:
public Set<Integer> getGermplasmsWithOpenLots(final List<Integer> gids) { Set<Integer> gidsWithOpenLots = new HashSet<>(); try { Query query = this.getSession().createSQLQuery(GET_GIDS_WITH_OPEN_LOTS).setParameterList("gids", gids); gidsWithOpenLots = Sets.newHashSet(query.list()); } catch (Exception e) { LotDAO.LOG.error("Error at checkGermplasmsWithOpenLots for GIDss = " + gids + AT_LOT_DAO + e.getMessage(), e); throw new MiddlewareQueryException("Error at checkGermplasmsWithOpenLots for GIDss = " + gids + AT_LOT_DAO + e.getMessage(), e); } return gidsWithOpenLots; }
Source:
<code>public Builder(Retrofit retrofit) { this.platform = retrofit.platform; this.callFactory = retrofit.callFactory; this.baseUrl = retrofit.baseUrl; <START> this.converterFactories = retrofit.converterFactories; <END> this.adapterFactories = retrofit.adapterFactories; this.callbackExecutor = retrofit.callbackExecutor; this.validateEagerly = retrofit.validateEagerly; }</code><technical_language>lists addAll retain unmodifiable references</technical_language>

Target:
public Builder(Retrofit retrofit) { this.platform = retrofit.platform; this.callFactory = retrofit.callFactory; this.baseUrl = retrofit.baseUrl; this.converterFactories.addAll(retrofit.converterFactories); this.adapterFactories.addAll(retrofit.adapterFactories); this.callbackExecutor = retrofit.callbackExecutor; this.validateEagerly = retrofit.validateEagerly; }
Source:
<code>public Response invalidate(@Required @QueryParam("oauth_provider") String oauthProvider) throws IOException, BadRequestException { OAuthAuthenticator oauth = getAuthenticator(oauthProvider); final Principal principal = security.getUserPrincipal(); if (principal != null && oauth.invalidateToken(principal.getName())) { return Response.ok().build(); } <START> return Response.status(404) <END> .entity("Not found OAuth token for " + (principal != null ? principal.getName() : null)) .type(MediaType.TEXT_PLAIN).build(); }</code><technical_language>throw NotFoundException set method return type void</technical_language>

Target:
public void invalidate(@Required @QueryParam("oauth_provider") String oauthProvider) throws BadRequestException, NotFoundException, ServerException, ForbiddenException { OAuthAuthenticator oauth = getAuthenticator(oauthProvider); final User user = EnvironmentContext.getCurrent().getUser(); try { if (!oauth.invalidateToken(user.getId())) { throw new NotFoundException("OAuth token for user " + user.getId() + " was not found"); } } catch (IOException e) { throw new ServerException(e.getMessage()); } }
Source:
<code>public void starting(Description description) { String seedProperty = System.getProperty(RANDOM_SEED_PROPERTY); Long seed; try { seed = Long.parseLong(seedProperty); } catch (NumberFormatException e) { log.info("Property '{}' was not set, using System.currentTimeMillis() as a seed.", RANDOM_SEED_PROPERTY); seed = System.currentTimeMillis(); } RandomUtils.instance().setSeed(seed); <START> log.info("Running test with random seed: {}", RandomUtils.instance().getSeed()); <END> }</code><technical_language>this a bug... seed log set</technical_language>

Target:
public void starting(Description description) { String seedProperty = System.getProperty(RANDOM_SEED_PROPERTY); Long seed; try { seed = Long.parseLong(seedProperty); } catch (NumberFormatException e) { log.info("Property '{}' was not set, using System.currentTimeMillis() as a seed.", RANDOM_SEED_PROPERTY); seed = System.currentTimeMillis(); } log.info("Running test with random seed '{}'", seed); RandomUtils.instance().setSeed(seed); }
Source:
<code>void dispose() { if (gc != null) { gc.dispose(); gc = null; } if (resources != null) { <START> Enumeration<Resource> enumeration = resources.elements(); while (enumeration.hasMoreElements()) { Resource resource = enumeration.nextElement(); <END> resource.dispose(); } resources = null; } if (printerFont != null) { printerFont.dispose(); printerFont = null; } if (printerRenderer != null) { printerRenderer.dispose(); printerRenderer = null; } }</code><technical_language>Revert</technical_language>

Target:
void dispose() { if (gc != null) { gc.dispose(); gc = null; } if (resources != null) { Iterator<Resource> enumeration = resources.values().iterator(); while (enumeration.hasNext()) { Resource resource = enumeration.next(); resource.dispose(); } resources = null; } if (printerFont != null) { printerFont.dispose(); printerFont = null; } if (printerRenderer != null) { printerRenderer.dispose(); printerRenderer = null; } }
Source:
<code>public synchronized void shutdown() { <START> sweepOutcomeMetrics.shutdown(); <END> if (daemon == null) { return; } log.info("Signalling background sweeper to shut down."); daemon.interrupt(); try { daemon.join(); daemon = null; } catch (InterruptedException e) { throw Throwables.rewrapAndThrowUncheckedException(e); } }</code><technical_language>call sweepOutcomeMetrics .registerOccurrenceOf(SHUTDOWN);</technical_language>

Target:
public synchronized void shutdown() { sweepOutcomeMetrics.registerOccurrenceOf(SweepOutcome.SHUTDOWN); if (daemon == null) { return; } log.info("Signalling background sweeper to shut down."); daemon.interrupt(); try { daemon.join(); daemon = null; } catch (InterruptedException e) { throw Throwables.rewrapAndThrowUncheckedException(e); } }
Source:
<code>private String getNodePath(ResourceBasedNode<?> node, String projectName) { String path = ""; if (node instanceof ModuleDescriptorNode) { path = ((ModuleDescriptorNode)node).getStorablePath(); } else if (node instanceof FolderReferenceNode) { path = ((FolderReferenceNode)node).getStorablePath(); } else if (node instanceof FileReferenceNode) { path = ((FileReferenceNode)node).getStorablePath(); } <START> return path.substring(projectName.length() + 2); <END> }</code><technical_language>this line of code path equals ""</technical_language>

Target:
private String getNodePath(ResourceBasedNode<?> node, String projectName) { String path = ""; if (node instanceof ModuleNode) { path = ((ModuleNode)node).getStorablePath(); } else if (node instanceof FolderReferenceNode) { path = ((FolderReferenceNode)node).getStorablePath(); } else if (node instanceof FileReferenceNode) { path = ((FileReferenceNode)node).getStorablePath(); } if (!path.isEmpty()) { return path.substring(projectName.length() + 2); } else { return path; } }
Source:
<code>public IResolver selectResolver(List<Diagnosis> diagnosis) { Map<String, Diagnosis> diagnosisMap = diagnosis.stream().collect(Collectors.toMap(Diagnosis::getName, d -> d)); if (diagnosisMap.containsKey(DIAGNOSIS_DATA_SKEW.text())) { LOG.warning("Data Skew diagnoses. This diagnosis does not have any resolver."); } else if (diagnosisMap.containsKey(DIAGNOSIS_SLOW_INSTANCE.text())) { return restartContainerResolver; } else if (diagnosisMap.containsKey(DIAGNOSIS_UNDER_PROVISIONING.text())) { LOG.warning("Under provisioning diagnoses. This diagnosis does not have any resolver."); } <START> <END> return null; }</code><technical_language>A log is required resolver exists. throw exceptions if means some bad things</technical_language>

Target:
public IResolver selectResolver(List<Diagnosis> diagnosis) { Map<String, Diagnosis> diagnosisMap = diagnosis.stream().collect(Collectors.toMap(Diagnosis::getName, d -> d)); if (diagnosisMap.containsKey(DIAGNOSIS_SLOW_INSTANCE.text())) { return restartContainerResolver; } LOG.warning("Unknown diagnoses. None resolver selected."); return null; }
Source:
<code><START> public void createsFormRequestWithParams() throws IOException { <END> final String key = "key"; final String akey = "anotherkey"; final String value = "value"; final String avalue = "a&b"; final String aavalue = "againanothervalue"; final RqForm req = new RqForm.Fake( new RqFake(), key, value, key, avalue, akey, aavalue ); MatcherAssert.assertThat( req.param(key), Matchers.hasItems(value, avalue) ); MatcherAssert.assertThat( req.param(akey), Matchers.hasItems(aavalue) ); MatcherAssert.assertThat( req.names(), Matchers.hasItems(key, akey) ); }</code><technical_language>@erimerturk declare throws Exception, recommendation [in this post](<LINK_0></technical_language>

Target:
public void createsFormRequestWithParams() throws Exception { final String key = "key"; final String akey = "anotherkey"; final String value = "value"; final String avalue = "a&b"; final String aavalue = "againanothervalue"; final RqForm req = new RqForm.Fake( new RqFake(), key, value, key, avalue, akey, aavalue ); MatcherAssert.assertThat( req.param(key), Matchers.hasItems(value, avalue) ); MatcherAssert.assertThat( req.param(akey), Matchers.hasItems(aavalue) ); MatcherAssert.assertThat( req.names(), Matchers.hasItems(key, akey) ); }
Source:
<code>public void stop() { if (trace) log.tracef("Stopping %s", this.getClass().getSimpleName()); synchronized (versionRequestMap) { if (trace) log.tracef("Stopping %s. isRunning=%s. %s", this.getClass().getSimpleName(), running, Arrays.toString(Thread.currentThread().getStackTrace())); cancelVersionRequests(); versionRequestMap.clear(); } if (isConflictResolutionInProgress()) conflictSpliterator.stop(); <START> <END> this.running = false; }</code><technical_language>I this needs a more safeguards: * running = false set * getConflicts() create a new spliterator if running == true * null check for conflictSpliterator (getConflicts() CAS conflictSpliterator assignment)</technical_language>

Target:
public void stop() { if (trace) log.tracef("Stopping %s", this.getClass().getSimpleName()); this.running = false; synchronized (versionRequestMap) { if (trace) log.tracef("Stopping %s. isRunning=%s. %s", this.getClass().getSimpleName(), running, Arrays.toString(Thread.currentThread().getStackTrace())); cancelVersionRequests(); versionRequestMap.clear(); } if (isConflictResolutionInProgress() && conflictSpliterator != null) conflictSpliterator.stop(); }
Source:
<code><START> private void initRecordingDialog() { <END> Rect displayRectangle = new Rect(); Window window = this.getWindow(); window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle); LayoutInflater inflater = LayoutInflater.from(this); View builderView = inflater.inflate(R.layout.recording_dialog, null); int dialogMinWidth = (int) (displayRectangle.width() * 0.8f); int dialogMinHeight = (int) (displayRectangle.height() * 0.5f); builderView.setMinimumWidth(dialogMinWidth); builderView.setMinimumHeight(dialogMinHeight); soundLevelCircleMaxDiameter = (int) (dialogMinWidth * 0.8f); soundLevelView = (TextView) builderView.findViewById(R.id.view_sound_level); AlertDialog.Builder builder; builder = new AlertDialog.Builder(this); builder.setView(builderView); builder.setCancelable(false); builder.setPositiveButton(getString(R.string.dialog_button_done), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { stopRecord(); } }); recordingDialog = builder.create(); }</code><technical_language>this file bigger bigger, move kind of function a standalone class, AudioVizDialog</technical_language>

Target:
private void initRecordingDialog() { recordingDialog = new AudioVizDialog(this, new AudioVizDialog.Listener() { @Override public void onDoneClick() { stopRecord(); } }); recordingDialog.setMaxRecordLength(MAX_RECORD_LENGTH / 1000); }
Source:
<code>protected void createButtonsForButtonBar(final Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); Button manageButton = createButton(parent, IDialogConstants.CLIENT_ID + 1, Messages.TraceControl_ManageButtonText, true); manageButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(parent.getShell(), ControlRemoteProfilesPreferencePage.ID, new String[] { ControlRemoteProfilesPreferencePage.ID }, null); <START> dialog.open(); <END> } }); Button button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); button.setEnabled(false); }</code><technical_language>Preference page is closed, local/remote composite input is updated. I if updated soon update preference page (e.g. import/delete)</technical_language>

Target:
protected void createButtonsForButtonBar(final Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); Button manageButton = createButton(parent, IDialogConstants.CLIENT_ID + 1, Messages.TraceControl_ManageButtonText, true); manageButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(parent.getShell(), ControlRemoteProfilesPreferencePage.ID, new String[] { ControlRemoteProfilesPreferencePage.ID }, null); dialog.open(); if (fLocalComposite != null) { fFolderViewer.refresh(); } } }); Button button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); button.setEnabled(false); }
Source:
<code>protected IStateHistoryBackend getBackendForQuerying(IStateHistoryBackend backend) throws IOException { if (!fReOpen) { return backend; } File historyTreeFile = fBackendMap.remove(backend); if (historyTreeFile == null) { <START> return backend; <END> } backend.dispose(); HistoryTreeBackend reOpenedBackend = new HistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION); fBackendMap.put(reOpenedBackend, historyTreeFile); return reOpenedBackend; }</code><technical_language>Actually, if is null, is a problem test, throw exception here</technical_language>

Target:
protected IStateHistoryBackend getBackendForQuerying(IStateHistoryBackend backend) throws IOException { if (!fReOpen) { return backend; } File historyTreeFile = fBackendMap.remove(backend); if (historyTreeFile == null) { throw new IllegalStateException(); } backend.dispose(); HistoryTreeBackend reOpenedBackend = new HistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION); fBackendMap.put(reOpenedBackend, historyTreeFile); return reOpenedBackend; }
Source:
<code>public static ChangeDetail reverse(ChangeInfo info) { info.revisions().copyKeysIntoChildren("name"); RevisionInfo rev = current(info); ChangeDetail r = new ChangeDetail(); r.setAllowsAnonymous(rev.has_fetch() && rev.fetch().containsKey("http")); r.setCanAbandon(can(info.actions(), "abandon")); r.setCanEditCommitMessage(can(info.actions(), "message")); r.setCanCherryPick(can(rev.actions(), "cherrypick")); r.setCanPublish(can(rev.actions(), "publish")); r.setCanRebase(can(rev.actions(), "rebase")); r.setCanRestore(can(info.actions(), "restore")); r.setCanRevert(can(info.actions(), "revert")); r.setCanDeleteDraft(can(rev.actions(), "/")); r.setCanEditTopicName(can(info.actions(), "topic")); r.setCanEdit(true); r.setChange(toChange(info)); r.setStarred(info.starred()); r.setPatchSets(toPatchSets(info)); r.setMessages(toMessages(info)); r.setAccounts(new AccountInfoCache(users(info))); r.setCurrentPatchSetId(new PatchSet.Id(info.legacy_id(), rev._number())); r.setSubmitTypeRecord(new SubmitTypeRecord()); r.getSubmitTypeRecord().status = SubmitTypeRecord.Status.RULE_ERROR; r.setDependsOn(new ArrayList<com.google.gerrit.common.data.ChangeInfo>()); <START> r.setNeededBy(new ArrayList<com.google.gerrit.common.data.ChangeInfo>()); <END> r.setPatchSetsWithDraftComments(new HashSet<PatchSet.Id>()); r.setSubmitRecords(new ArrayList<SubmitRecord>()); r.setCurrentPatchSetDetail(toPatchSetDetail(info)); return r; }</code><technical_language>Missing dependencies is a serious limitation. I undecided if sense push change implemented first</technical_language>

Target:
public static ChangeDetail reverse(ChangeInfo info) { info.revisions().copyKeysIntoChildren("name"); RevisionInfo rev = current(info); ChangeDetail r = new ChangeDetail(); r.setAllowsAnonymous(rev.has_fetch() && rev.fetch().containsKey("http")); r.setCanAbandon(can(info.actions(), "abandon")); r.setCanEditCommitMessage(can(info.actions(), "message")); r.setCanCherryPick(can(rev.actions(), "cherrypick")); r.setCanPublish(can(rev.actions(), "publish")); r.setCanRebase(can(rev.actions(), "rebase")); r.setCanRestore(can(info.actions(), "restore")); r.setCanRevert(can(info.actions(), "revert")); r.setCanDeleteDraft(can(rev.actions(), "/")); r.setCanEditTopicName(can(info.actions(), "topic")); r.setCanSubmit(can(rev.actions(), "submit")); r.setCanEdit(true); r.setChange(toChange(info)); r.setStarred(info.starred()); r.setPatchSets(toPatchSets(info)); r.setMessages(toMessages(info)); r.setAccounts(users(info)); r.setCurrentPatchSetId(new PatchSet.Id(info.legacy_id(), rev._number())); r.setCurrentPatchSetDetail(toPatchSetDetail(info)); r.setSubmitRecords(new ArrayList<SubmitRecord>()); r.setSubmitTypeRecord(new SubmitTypeRecord()); r.getSubmitTypeRecord().status = SubmitTypeRecord.Status.RULE_ERROR; r.setPatchSetsWithDraftComments(new HashSet<PatchSet.Id>()); r.setDependsOn(new ArrayList<com.google.gerrit.common.data.ChangeInfo>()); r.setNeededBy(new ArrayList<com.google.gerrit.common.data.ChangeInfo>()); return r; }
Source:
<code>public void refreshStereotypeStructure() { <START> if (stereoList.size() != 0) { <END> for (Stereotype stereotype : stereoList) { refreshStereotypeCompartmentStructure(stereotype); } } }</code><technical_language>List#isEmpty()</technical_language>

Target:
public void refreshStereotypeStructure() { if (!stereotypeList.isEmpty()) { for (Stereotype stereotype : stereotypeList) { refreshStereotypeCompartmentStructure(stereotype); } } }
Source:
<code>public void authenticate() { final String principal = props.getProperty("druid.hdfs.security.kerberos.principal"); <START> final String keytab = props.getProperty("druid.hdfs.security.kerberos.keytab"); <END> if (!Strings.isNullOrEmpty(principal) && !Strings.isNullOrEmpty(keytab)) { UserGroupInformation.setConfiguration(conf); if (UserGroupInformation.isSecurityEnabled()) { try { if (UserGroupInformation.getCurrentUser().hasKerberosCredentials() == false || !UserGroupInformation.getCurrentUser().getUserName().equals(principal)) { log.info("trying to authenticate user [%s] with keytab [%s]", principal, keytab); UserGroupInformation.loginUserFromKeytab(principal, keytab); } } catch (IOException e) { throw new ISE(e, "Failed to authenticate user principal [%s] with keytab [%s]", principal, keytab); } } } }</code><technical_language>Minor Nit: Is extract keytab principal properties in a HadoopStorageAuthenticationConfig class, bind JsonconfigProvider</technical_language>

Target:
public void authenticate() { String principal = hdfsKerberosConfig.getPrincipal(); String keytab = hdfsKerberosConfig.getKeytab(); if (!Strings.isNullOrEmpty(principal) && !Strings.isNullOrEmpty(keytab)) { UserGroupInformation.setConfiguration(hadoopConf); if (UserGroupInformation.isSecurityEnabled()) { try { if (UserGroupInformation.getCurrentUser().hasKerberosCredentials() == false || !UserGroupInformation.getCurrentUser().getUserName().equals(principal)) { log.info("Trying to authenticate user [%s] with keytab [%s]..", principal, keytab); UserGroupInformation.loginUserFromKeytab(principal, keytab); } } catch (IOException e) { throw new ISE(e, "Failed to authenticate user principal [%s] with keytab [%s]", principal, keytab); } } } }
Source:
<code>public static PassthroughServer remove(URI uri) { URI keyURI = createKey(uri); ServerDescriptor serverDescriptor = servers.remove(keyURI); if (serverDescriptor != null) { serverDescriptor.server.stop(); LOGGER.info("Stopped PassthroughServer at {}", keyURI); for (Connection connection : serverDescriptor.getConnections().keySet()) { try { <START> LOGGER.warn("Force close {}", formatConnectionId(connection)); <END> connection.close(); } catch (IOException e) { } } return serverDescriptor.server; } else { return null; } }</code><technical_language>this pass servers responsibility</technical_language>

Target:
public static PassthroughServer remove(URI uri) { URI keyURI = createKey(uri); ServerDescriptor serverDescriptor = SERVERS.remove(keyURI); if (serverDescriptor != null) { serverDescriptor.server.stop(); LOGGER.info("Stopped PassthroughServer at {}", keyURI); for (Connection connection : serverDescriptor.getConnections().keySet()) { try { LOGGER.warn("Force close {}", formatConnectionId(connection)); connection.close(); } catch (IOException e) { } } return serverDescriptor.server; } else { return null; } }
Source:
<code><START> void validateJoinKeySchemas(Map<String, Schema> inputSchemas, Map<String, List<String>> joinKeys, <END> FailureCollector collector) { perStageJoinKeys = joinKeys; conf.validateJoinKeySchemas(inputSchemas, joinKeys, collector); List<Schema> prevSchemaList = null; for (Map.Entry<String, List<String>> entry : perStageJoinKeys.entrySet()) { ArrayList<Schema> schemaList = new ArrayList<>(); String stageName = entry.getKey(); Schema schema = inputSchemas.get(stageName); if (schema == null) { return; } for (String joinKey : entry.getValue()) { Schema.Field field = schema.getField(joinKey); if (field == null) { collector.addFailure( String.format("Join key field '%s' is not present in input stage of '%s'.", joinKey, stageName), null) .withConfigProperty(conf.JOIN_KEYS); } schemaList.add(field.getSchema()); } if (prevSchemaList != null && !prevSchemaList.equals(schemaList)) { collector.addFailure( String.format("For stage '%s', Schemas of join keys '%s' are expected to be: '%s', but found: '%s'.", stageName, entry.getValue(), prevSchemaList.toString(), schemaList.toString()), null) .withConfigProperty(conf.JOIN_KEYS); } prevSchemaList = schemaList; } }</code><technical_language>this method private</technical_language>

Target:
private void validateJoinKeySchemas(Map<String, Schema> inputSchemas, Map<String, List<String>> joinKeys, FailureCollector collector) { perStageJoinKeys = joinKeys; conf.validateJoinKeySchemas(inputSchemas, joinKeys, collector); List<Schema> prevSchemaList = null; for (Map.Entry<String, List<String>> entry : perStageJoinKeys.entrySet()) { ArrayList<Schema> schemaList = new ArrayList<>(); String stageName = entry.getKey(); Schema schema = inputSchemas.get(stageName); if (schema == null) { return; } for (String joinKey : entry.getValue()) { Schema.Field field = schema.getField(joinKey); if (field == null) { collector.addFailure( String.format("Join key field '%s' is not present in input stage of '%s'.", joinKey, stageName), null) .withConfigProperty(JoinerConfig.JOIN_KEYS); } schemaList.add(field.getSchema()); } if (prevSchemaList != null && !prevSchemaList.equals(schemaList)) { collector.addFailure( String.format("For stage '%s', Schemas of join keys '%s' are expected to be: '%s', but found: '%s'.", stageName, entry.getValue(), prevSchemaList.toString(), schemaList.toString()), null) .withConfigProperty(JoinerConfig.JOIN_KEYS); } prevSchemaList = schemaList; } }
Source:
<code>public void init() { <START> MockitoAnnotations.initMocks(this); <END> when(dockerImage.getCreated()).thenReturn(Instant.now().minus(2, ChronoUnit.HOURS).getEpochSecond()); when(dockerImage.getRepoTags()).thenReturn(Collections.emptyList()); }</code><technical_language>if ImageData interface, avoid mocks (and prefer avoid possible)</technical_language>

Target:
public void init() { MockitoAnnotations.initMocks(this); when(dockerImageData.getCreated()).thenReturn(Instant.now().minus(2, ChronoUnit.HOURS)); }
Source:
<code>public void physicalSend(Command command) throws IOException { if (logger.isTraceEnabled()) { tracePhysicalSend(transportConnection, command); } try { final ByteSequence bytes = outWireFormat.marshal(command); final int bufferSize = bytes.length; final ActiveMQBuffer buffer = transportConnection.createTransportBuffer(bufferSize); buffer.writeBytes(bytes.data, bytes.offset, bufferSize); <START> synchronized (sendLock) { <END> getTransportConnection().write(buffer, false, false); } bufferSent(); } catch (IOException e) { throw e; } catch (Throwable t) { ActiveMQServerLogger.LOGGER.error("error sending", t); } }</code><technical_language>this getTransportConnection, existing code below, existing code field also. a consistency POV</technical_language>

Target:
public void physicalSend(Command command) throws IOException { if (logger.isTraceEnabled()) { tracePhysicalSend(transportConnection, command); } try { final ByteSequence bytes = outWireFormat.marshal(command); final int bufferSize = bytes.length; final ActiveMQBuffer buffer = transportConnection.createTransportBuffer(bufferSize); buffer.writeBytes(bytes.data, bytes.offset, bufferSize); transportConnection.write(buffer, false, false); bufferSent(); } catch (IOException e) { throw e; } catch (Throwable t) { ActiveMQServerLogger.LOGGER.error("error sending", t); } }
Source:
<code>public EditorPartPresenter getNextFor(EditorPartPresenter editorPart) { int indexForNext = partsOrder.indexOf(editorPart) + 1; <START> return indexForNext >= partsOrder.size() ? (EditorPartPresenter)partsOrder.getFirst() <END> : (EditorPartPresenter)partsOrder.get(indexForNext); }</code><technical_language><LINK_0></technical_language>

Target:
public EditorPartPresenter getNextFor(EditorPartPresenter editorPart) { int indexForNext = partsOrder.indexOf(editorPart) + 1; return indexForNext >= partsOrder.size() ? partsOrder.getFirst() : partsOrder.get(indexForNext); }
Source:
<code>private byte[] toBinaryIon(String text) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); <START> IonReader ionReader = system().newReader(text); <END> IonWriter ionWriter = system().newBinaryWriter(out); ionWriter.writeValues(ionReader); ionWriter.close(); return out.toByteArray(); }</code><technical_language>close ionReader,</technical_language>

Target:
private byte[] toBinaryIon(String text) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); IonReader ionReader = system().newReader(text); IonWriter ionWriter = system().newBinaryWriter(out); ionWriter.writeValues(ionReader); ionWriter.close(); ionReader.close(); return out.toByteArray(); }
Source:
<code>protected void setupNotification() { notificationManager = NotificationManagerCompat.from(this); notificationBuilder = createNotification(); startForeground(getNotificationId(), notificationBuilder.build()); disposables.add(notificationUpdater .filter(s -> !s.isEmpty()) <START> .publish(stringFlowable -> stringFlowable.limit(1) <END> .concatWith(stringFlowable.skip(1).throttleLast(NOTIFICATION_SAMPLING_PERIOD, TimeUnit.MILLISECONDS))) .observeOn(AndroidSchedulers.mainThread()) .subscribe(this::updateNotification)); }</code><technical_language>some eye squinting get this is doing. a good idea extract this name notifyFirstThenThrottle more descriptive</technical_language>

Target:
protected void setupNotification() { notificationManager = NotificationManagerCompat.from(this); notificationBuilder = createNotification(); startForeground(getNotificationId(), notificationBuilder.build()); final Function<Flowable<String>, Publisher<String>> throttleAfterFirstEmission = flow -> flow.limit(1) .concatWith(flow.skip(1).throttleLast(NOTIFICATION_SAMPLING_PERIOD, TimeUnit.MILLISECONDS)); disposables.add(notificationUpdater .filter(s -> !s.isEmpty()) .publish(throttleAfterFirstEmission) .observeOn(AndroidSchedulers.mainThread()) .subscribe(this::updateNotification)); }
Source:
<code>public static synchronized Log getLog(String logTag) { logTag = getTruncatedLogTag(logTag); Log log = logMap.get(logTag); if (log != null) { return log; } <START> if (checkApacheCommonsLoggingExists()) { <END> log = new ApacheCommonsLogging(logTag); } else if (checkAndroidLoggingMocked()) { log = new AndroidLog(logTag); } else { log = new ConsoleLog(logTag); } logMap.put(logTag, log); return log; }</code><technical_language>I get of semblance of support for Apache</technical_language>

Target:
public static synchronized Log getLog(String logTag) { logTag = getTruncatedLogTag(logTag); Log log = logMap.get(logTag); if (log != null) { return log; } if (Environment.isJUnitTest()) { log = new ConsoleLog(logTag); } else if (checkApacheCommonsLoggingExists()) { log = new ApacheCommonsLogging(logTag); } else { log = new AndroidLog(logTag); } logMap.put(logTag, log); return log; }
Source:
<code>private TopologyContext createTopologyContext(Map<String, Object> topoConf) { <START> CustomIndexArray<String> taskToComponent = new CustomIndexArray<>(0,8); <END> taskToComponent.set(7, "Xcom"); return new TopologyContext(null, topoConf, taskToComponent, null, null, null, null, null, null, 7, 6703, null, null, null, null, null, null); }</code><technical_language>0,8 if setting is 7</technical_language>

Target:
private TopologyContext createTopologyContext(Map<String, Object> topoConf) { CustomIndexArray<String> taskToComponent = new CustomIndexArray<>(7,7); taskToComponent.set(7, "Xcom"); return new TopologyContext(null, topoConf, taskToComponent, null, null, null, null, null, null, 7, 6703, null, null, null, null, null, null); }
Source:
<code><START> boolean addReftable(Writer w) throws IOException { <END> LockFile lock = new LockFile(stackPath); try { if (!lock.lockForAppend()) { return false; } if (!uptodate()) { return false; } String fn = filename(nextUpdateIndex(), nextUpdateIndex()); File tmpTable = File.createTempFile(fn + "_", ".ref", stackPath.getParentFile()); ReftableWriter.Stats stats; try (FileOutputStream fos = new FileOutputStream(tmpTable)) { ReftableWriter rw = new ReftableWriter(reftableConfig(), fos); w.call(rw); rw.finish(); stats = rw.getStats(); } fn += stats.refCount() > 0 ? ".ref" : ".log"; File dest = new File(reftableDir, fn); FileUtils.rename(tmpTable, dest, StandardCopyOption.ATOMIC_MOVE); lock.write((fn + "\n").getBytes(UTF_8)); if (!lock.commit()) { FileUtils.delete(dest); return false; } reload(); autoCompact(); } finally { lock.unlock(); } return true; }</code><technical_language>@SuppressWarnings("nls") suppress non-externalized string warnings</technical_language>

Target:
boolean addReftable(Writer w) throws IOException { LockFile lock = new LockFile(stackPath); try { if (!lock.lockForAppend()) { return false; } if (!uptodate()) { return false; } String fn = filename(nextUpdateIndex(), nextUpdateIndex()); File tmpTable = File.createTempFile(fn + "_", ".ref", stackPath.getParentFile()); ReftableWriter.Stats s; try (FileOutputStream fos = new FileOutputStream(tmpTable)) { ReftableWriter rw = new ReftableWriter(reftableConfig(), fos); w.call(rw); rw.finish(); s = rw.getStats(); } fn += s.refCount() > 0 ? ".ref" : ".log"; File dest = new File(reftableDir, fn); FileUtils.rename(tmpTable, dest, StandardCopyOption.ATOMIC_MOVE); lock.write((fn + "\n").getBytes(UTF_8)); if (!lock.commit()) { FileUtils.delete(dest); return false; } reload(); autoCompact(); } finally { lock.unlock(); } return true; }
Source:
<code>public Map<String, Accessor> getPropertyWriteAccessors(CollectionMappingStrategyPrism cmStrategy) { List<Accessor> candidates = new ArrayList<Accessor>(); candidates.addAll( getSetters() ); candidates.addAll( getAlternativeTargetAccessors() ); Map<String, Accessor> result = new LinkedHashMap<String, Accessor>(); for ( Accessor candidate : candidates ) { String targetPropertyName = Executables.getPropertyName( candidate ); if ( cmStrategy == CollectionMappingStrategyPrism.SETTER_PREFERRED || cmStrategy == CollectionMappingStrategyPrism.ADDER_PREFERRED ) { Accessor adderMethod = null; if ( Executables.isSetterMethod( candidate ) ) { Type targetType = typeFactory.getSingleParameter( (DeclaredType) typeMirror, candidate ).getType(); if ( cmStrategy == CollectionMappingStrategyPrism.ADDER_PREFERRED ) { adderMethod = getAdderForType( targetType, targetPropertyName ); } } else if ( Executables.isGetterMethod( candidate ) ) { <START> Type targetType = typeFactory.getReturnType( (DeclaredType) typeMirror, candidate ); <END> adderMethod = getAdderForType( targetType, targetPropertyName ); } if ( adderMethod != null ) { candidate = adderMethod; } } else if ( Executables.isFieldAccessor( candidate ) && ( Executables.isFinal( candidate ) || result.containsKey( targetPropertyName ) ) ) { continue; } result.put( targetPropertyName, candidate ); } return result; }</code><technical_language>Hmm.. is typeFactory.getMethodType required..? is this handled type factory</technical_language>

Target:
public Map<String, Accessor> getPropertyWriteAccessors( CollectionMappingStrategyPrism cmStrategy ) { List<Accessor> candidates = new ArrayList<Accessor>( getSetters() ); candidates.addAll( getAlternativeTargetAccessors() ); Map<String, Accessor> result = new LinkedHashMap<String, Accessor>(); for ( Accessor candidate : candidates ) { String targetPropertyName = Executables.getPropertyName( candidate ); Accessor readAccessor = getPropertyReadAccessors().get( targetPropertyName ); Type preferredType = determinePreferredType( readAccessor ); Type targetType = determineTargetType( candidate ); if ( cmStrategy == CollectionMappingStrategyPrism.SETTER_PREFERRED || cmStrategy == CollectionMappingStrategyPrism.ADDER_PREFERRED ) { Accessor adderMethod = null; if ( Executables.isSetterMethod( candidate ) && cmStrategy == CollectionMappingStrategyPrism.ADDER_PREFERRED ) { adderMethod = getAdderForType( targetType, targetPropertyName ); } else if ( Executables.isGetterMethod( candidate ) ) { adderMethod = getAdderForType( targetType, targetPropertyName ); } if ( adderMethod != null ) { candidate = adderMethod; } } else if ( Executables.isFieldAccessor( candidate ) && ( Executables.isFinal( candidate ) || result.containsKey( targetPropertyName ) ) ) { continue; } Accessor previousCandidate = result.get( targetPropertyName ); if ( previousCandidate == null || preferredType == null || ( targetType != null && typeUtils.isAssignable( preferredType.getTypeMirror(), targetType.getTypeMirror() ) ) ) { result.put( targetPropertyName, candidate ); } } return result; }
Source:
<code>public void deleteSubscription(final String subscriptionId) throws DbWriteOperationsBlockedException, NoSuchSubscriptionException, NoSuchEventTypeException, ServiceTemporarilyUnavailableException, InternalNakadiException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot delete subscription: write operations on DB " + "are blocked by feature flag."); } final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); authorizationValidator.authorizeSubscriptionAdmin(subscription); subscriptionRepository.deleteSubscription(subscriptionId); final ZkSubscriptionClient zkSubscriptionClient = subscriptionClientFactory.createClient( subscription, LogPathBuilder.build(subscriptionId, "delete_subscription")); zkSubscriptionClient.deleteSubscription(); nakadiKpiPublisher.publish(subLogEventType, () -> new JSONObject() .put("subscription_id", subscriptionId) .put("status", "deleted")); <START> subscriptionCache.invalidateSubscription(subscriptionId); <END> }</code><technical_language>I this call is useless 150 instances</technical_language>

Target:
public void deleteSubscription(final String subscriptionId) throws DbWriteOperationsBlockedException, NoSuchSubscriptionException, NoSuchEventTypeException, ServiceTemporarilyUnavailableException, InternalNakadiException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot delete subscription: write operations on DB " + "are blocked by feature flag."); } final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); authorizationValidator.authorizeSubscriptionAdmin(subscription); subscriptionRepository.deleteSubscription(subscriptionId); final ZkSubscriptionClient zkSubscriptionClient = subscriptionClientFactory.createClient( subscription, LogPathBuilder.build(subscriptionId, "delete_subscription")); zkSubscriptionClient.deleteSubscription(); nakadiKpiPublisher.publish(subLogEventType, () -> new JSONObject() .put("subscription_id", subscriptionId) .put("status", "deleted")); }
Source:
<code>private static boolean shouldSkipInputFileNameCheck(String path, String fileName) { return "package-info.java".equals(fileName) || "package.html".equals(fileName) || path.contains(File.separatorChar + "inputs" + File.separatorChar) || path.contains(File.separatorChar + "translation" + File.separatorChar) <START> || ".DS_Store".equals(fileName); <END> }</code><technical_language>".DS_Store" is this file</technical_language>

Target:
private static boolean shouldSkipInputFileNameCheck(String path, String fileName) { return "package-info.java".equals(fileName) || "package.html".equals(fileName) || path.contains(File.separatorChar + "inputs" + File.separatorChar) || path.contains(File.separatorChar + "translation" + File.separatorChar); }
Source:
<code>public void testStatsForEmptyValues() { tester.assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", BIGINT)), ImmutableList.of())) .check(outputStats -> outputStats.equalTo( PlanNodeStatsEstimate.builder() .setOutputRowCount(0) .addSymbolStatistics( new Symbol("a"), <START> SymbolStatsEstimate.builder() <END> .setLowValue(NaN) .setHighValue(NaN) .setNullsFraction(0.0) .setDistinctValuesCount(0.0) .build()) .build())); }</code><technical_language>empty</technical_language>

Target:
public void testStatsForEmptyValues() { tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", BIGINT)), ImmutableList.of())) .check(outputStats -> outputStats.equalTo( PlanNodeStatsEstimate.builder() .setOutputRowCount(0) .addSymbolStatistics(new Symbol("a"), SymbolStatsEstimate.ZERO_STATS) .build())); }
Source:
<code>protected void searchForSelectedParam() { HtmlParameterStats item = this.getParamsPanel().getSelectedParam(); if (item != null) { ExtensionSearch extSearch = Control.getSingleton().getExtensionLoader().getExtension(ExtensionSearch.class); if (extSearch != null) { if (HtmlParameter.Type.url.equals(item.getType())) { extSearch.search("[?&]" + item.getName() + "=.*", ExtensionSearch.Type.URL, true, false); } else if (HtmlParameter.Type.cookie.equals(item.getType())) { extSearch.search( item.getName() + "=.*", ExtensionSearch.Type.Header, true, false); } else if (HtmlParameter.Type.header.equals(item.getType())) { extSearch.search(item.getName() + ":.*", ExtensionSearch.Type.Header, true, false); } else if (HtmlParameter.Type.multipart.equals(item.getType())) { <START> extSearch.search("(?i)\\s*content-disposition\\s*:.*\\s+name\\s*\\=?\\s*\\\"?" + item.getName(), <END> ExtensionSearch.Type.Request, true, false); } else { extSearch.search( item.getName() + "=.*", ExtensionSearch.Type.Request, true, false); } } } }</code><technical_language>quote name, affect regex (same applies other types though)</technical_language>

Target:
protected void searchForSelectedParam() { HtmlParameterStats item = this.getParamsPanel().getSelectedParam(); if (item != null) { ExtensionSearch extSearch = Control.getSingleton().getExtensionLoader().getExtension(ExtensionSearch.class); if (extSearch != null) { if (HtmlParameter.Type.url.equals(item.getType())) { extSearch.search("[?&]" + Pattern.quote(item.getName()) + "=.*", ExtensionSearch.Type.URL, true, false); } else if (HtmlParameter.Type.cookie.equals(item.getType())) { extSearch.search(Pattern.quote(item.getName()) + "=.*", ExtensionSearch.Type.Header, true, false); } else if (HtmlParameter.Type.header.equals(item.getType())) { extSearch.search(Pattern.quote(item.getName()) + ":.*", ExtensionSearch.Type.Header, true, false); } else if (HtmlParameter.Type.multipart.equals(item.getType())) { extSearch.search("(?i)\\s*content-disposition\\s*:.*\\s+name\\s*\\=?\\s*\\\"?" + Pattern.quote(item.getName()), ExtensionSearch.Type.Request, true, false); } else { extSearch.search(Pattern.quote(item.getName()) + "=.*", ExtensionSearch.Type.Request, true, false); } } } }