auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testLdapLoginConfig() { LdapService ldapService = new LdapService(context); <START> LdapLoginConfig ldapConfigOne = createLdapConfig(ldapService, "ldaps://ldap:1636"); <END> ldapConfigOne.configure(); String configIdOne = ldapConfigOne.getId(); verify(context) .registerService( eq(JaasRealm.class), any(JaasRealm.class), Matchers.<Dictionary<String, Object>>any()); LdapLoginConfig ldapConfigTwo = createLdapConfig(ldapService, "ldaps://ldap:1636", "ldaps://ldap2:1636"); ldapConfigTwo.configure(); String configIdTwo = ldapConfigTwo.getId(); Map<String, String> ldapPropsOne = createLdapProperties("cn=user1"); ldapConfigOne.update(ldapPropsOne); Map<String, String> ldapPropsTwo = createLdapProperties("cn=user2"); ldapConfigTwo.update(ldapPropsTwo); List<Module> ldapModules = ldapService.getModules(); for (Module module : ldapModules) { String moduleName = module.getName(); String username = module.getOptions().getProperty(CONNECTION_USERNAME_OPTIONS_KEY); if (moduleName.equals(configIdOne)) { assertThat(username, is(equalTo("cn=user1"))); } else if (moduleName.equals(configIdTwo)) { assertThat(username, is(equalTo("cn=user2"))); } else { fail("The ldap modules did not update correctly."); } } verify(context, times(1)) .registerService( eq(JaasRealm.class), any(JaasRealm.class), Matchers.<Dictionary<String, Object>>any()); ldapConfigOne.destroy(1); assertThat(ldapService.delete(configIdOne), is(equalTo(false))); assertThat(ldapService.delete(configIdTwo), is(equalTo(true))); }</code><technical_language>a good idea pull "ldaps://ldap:1636" out a constant</technical_language>

Target:
public void testLdapLoginConfig() { LdapService ldapService = new LdapService(context); LdapLoginConfig ldapConfigOne = createLdapConfig(ldapService, LDAP_URL_1); ldapConfigOne.configure(); String configIdOne = ldapConfigOne.getId(); verify(context) .registerService( eq(JaasRealm.class), any(JaasRealm.class), Matchers.<Dictionary<String, Object>>any()); LdapLoginConfig ldapConfigTwo = createLdapConfig(ldapService, LDAP_URL_1, LDAP_URL_2); ldapConfigTwo.configure(); String configIdTwo = ldapConfigTwo.getId(); Map<String, String> ldapPropsOne = createLdapProperties("cn=user1"); ldapConfigOne.update(ldapPropsOne); Map<String, String> ldapPropsTwo = createLdapProperties("cn=user2"); ldapConfigTwo.update(ldapPropsTwo); List<Module> ldapModules = ldapService.getModules(); for (Module module : ldapModules) { String moduleName = module.getName(); String username = module.getOptions().getProperty(CONNECTION_USERNAME_OPTIONS_KEY); if (moduleName.equals(configIdOne)) { assertThat(username, is(equalTo("cn=user1"))); } else if (moduleName.equals(configIdTwo)) { assertThat(username, is(equalTo("cn=user2"))); } else { fail("The ldap modules did not update correctly."); } } verify(context, times(1)) .registerService( eq(JaasRealm.class), any(JaasRealm.class), Matchers.<Dictionary<String, Object>>any()); ldapConfigOne.destroy(1); assertThat(ldapService.delete(configIdOne), is(equalTo(false))); assertThat(ldapService.delete(configIdTwo), is(equalTo(true))); }
Source:
<code>void tick() { <START> if (counter.getAndIncrement() == 0) { <END> int emitted = 0; do { if (requested.get() > 0) { Object o = buffer.poll(); if (o != null) { if (buffer.isCompleted(o)) { child.onCompleted(); } else { buffer.accept(o, child); emitted++; requested.decrementAndGet(); } } } } while (counter.decrementAndGet() > 0); if (emitted > 0) { for (MultiSourceRequestableSubscriber<T, R> s : subscribers) { s.requestUpTo(emitted); } } } }</code><technical_language>counter read a local variable getAndIncrement force re-read of fields below, including counter itself</technical_language>

Target:
void tick() { AtomicLong localCounter = this.counter; if (localCounter.getAndIncrement() == 0) { int emitted = 0; do { if (requested.get() > 0) { Object o = buffer.poll(); if (o != null) { if (buffer.isCompleted(o)) { child.onCompleted(); } else { buffer.accept(o, child); emitted++; requested.decrementAndGet(); } } } } while (localCounter.decrementAndGet() > 0); if (emitted > 0) { for (MultiSourceRequestableSubscriber<T, R> s : subscribers) { s.requestUpTo(emitted); } } } }
Source:
<code>public URI getSkillifierUrl(String addition) { if (!addition.isEmpty()) { return URI.create("<LINK_1>" + addition); } <START> return URI.create("<LINK_1>"); <END> }</code><technical_language>I dislike hard-coded URLs, consider moving this URL settings window in a future sprint (Consult @nygrenh)</technical_language>

Target:
public URI getSkillifierUrl(String addition) { if (addition.isEmpty()) { return URI.create("<LINK_0>"); } return URI.create("<LINK_0>" + addition); }
Source:
<code>static String toRelativeString(Path path, Path moduleLocationBasePath) { String moduleRelativePath = moduleLocationBasePath.relativize(path).toString(); if (moduleRelativePath.isEmpty()) { return ""; } else { <START> return "/" + MorePaths.pathWithUnixSeparators(moduleRelativePath); <END> } }</code><technical_language>File separator instead of /</technical_language>

Target:
static String toRelativeString(Path path, Path moduleLocationBasePath) { String moduleRelativePath = moduleLocationBasePath.relativize(path).toString(); if (moduleRelativePath.isEmpty()) { return ""; } else { return File.separator + MorePaths.pathWithUnixSeparators(moduleRelativePath); } }
Source:
<code>static CallAdapter<Completable> makeCompletable() { final CompletableCallAdapter callAdapter = new CompletableCallAdapter(); <START> return new CallAdapter<Completable>() { <END> @Override public Type responseType() { return callAdapter.responseType(); } @Override public Completable adapt(Call call) { return callAdapter.adapt(call); } }; }</code><technical_language>wrapper? return callAdapter here</technical_language>

Target:
static CallAdapter<Completable> makeCompletable() { return COMPLETABLE_CALL_ADAPTER; }
Source:
<code>protected void postSetUp() throws Exception { EventService service = Framework.getService(EventService.class); <START> serviceImpl = (EventServiceImpl) service; <END> }</code><technical_language>Put cast line</technical_language>

Target:
protected void postSetUp() throws Exception { serviceImpl = (EventServiceImpl) Framework.getService(EventService.class); }
Source:
<code>public VirtualMachine getCurrentMachineBuild(ITmfEvent event) { VirtualMachine machine = innerGetCurrentMachine(event); if (machine == null) { synchronized (fStateSystem) { String hostId = event.getTrace().getHostId(); <START> machine = createMachine(fStateSystem, event.getTimestamp().toNanos(), hostId, event.getTrace().getName()); <END> fKnownMachines.put(hostId, machine); } } return machine; }</code><technical_language>this is nullable</technical_language>

Target:
public VirtualMachine getCurrentMachineBuild(ITmfEvent event) { VirtualMachine machine = innerGetCurrentMachine(event); if (machine == null) { synchronized (fStateSystem) { String hostId = event.getTrace().getHostId(); machine = createMachine(fStateSystem, event.getTimestamp().toNanos(), hostId, String.valueOf(event.getTrace().getName())); fKnownMachines.put(hostId, machine); } } return machine; }
Source:
<code>public void onPageUpdated(ApiDatasetLandingPage page, String uri) throws IOException { try { datasetAPIClient.deleteDataset(page.getapiDatasetId()); } catch (DatasetAPIException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>add log message</technical_language>

Target:
public void onPageUpdated(ApiDatasetLandingPage page, String uri) throws IOException { try { datasetAPIClient.deleteDataset(page.getapiDatasetId()); } catch (DatasetAPIException e) { logError(e, "failed to delete dataset in the dataset api").log(); throw new RuntimeException(e); } }
Source:
<code>public SAMRecord next() { if (!hasNext()) { <START> return null; <END> } return nextAlignment(); }</code><technical_language>Java standard practice is throw a NoSuchElementException next() is called hasNext() is false</technical_language>

Target:
public SAMRecord next() { if (!hasNext()) { throw new NoSuchElementException("No more alignments are available"); } return nextAlignment(); }
Source:
<code>public ProcessModelResource getProcessModel(@PathVariable String id) { try (final InputStream resourceStream = repositoryService.getProcessModel(id)) { <START> String xml = new String(IoUtil.readInputStream(resourceStream, null), StandardCharsets.UTF_8); <END> return processModelResourceAssembler.toResource(new ProcessModel(id, xml)); } catch (IOException e) { throw new ActivitiException("Error occured while getting process model '" + id + "' : " + e.getMessage(), e); } }</code><technical_language>@daisuke-yoshimoto endpoint return XML string, is I expect a client of this service. need return a resource. @erdemedeiros do that</technical_language>

Target:
public String getProcessModel(@PathVariable String id) { try (final InputStream resourceStream = repositoryService.getProcessModel(id)) { return new String(IoUtil.readInputStream(resourceStream, null), StandardCharsets.UTF_8); } catch (IOException e) { throw new ActivitiException("Error occured while getting process model '" + id + "' : " + e.getMessage(), e); } }
Source:
<code>public void shouldRemoveTemporaryWorkspaces() throws Exception { doNothing().when(workspaceDao).remove(anyString()); when(workspaceDao.getWorkspaces(eq(true), anyInt(), anyLong())) .thenReturn(new Page<>(createEntities(250), 0, 50, 250)); when(workspaceDao.getWorkspaces( eq(true), intThat(integer -> integer.intValue() > 250), anyLong())) .thenReturn(new Page<>(Collections.emptyList(), 250, 50, 250)); remover.removeTemporaryWs(); <START> verify(workspaceDao, times(250)).remove(anyString()); <END> }</code><technical_language>constant</technical_language>

Target:
public void shouldRemoveTemporaryWorkspaces() throws Exception { when(workspaceDao.getWorkspaces(eq(true), anyInt(), anyLong())) .thenReturn( new Page<>( createEntities(DEFAULT_PAGE_SIZE), 0, DEFAULT_PAGE_SIZE, COUNT_OF_WORKSPACES)) .thenReturn( new Page<>( createEntities(DEFAULT_PAGE_SIZE), DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE, COUNT_OF_WORKSPACES)) .thenReturn( new Page<>( createEntities(DEFAULT_PAGE_SIZE), DEFAULT_PAGE_SIZE * 2, DEFAULT_PAGE_SIZE, COUNT_OF_WORKSPACES)); remover.removeTemporaryWs(); verify(workspaceDao, times(COUNT_OF_WORKSPACES)).remove(anyString()); }
Source:
<code>public void testrunActionImpl_ignored_failure() { VdcActionParametersBase testParameters = new VdcActionParametersBase(); frontend.runAction(VdcActionType.AddDisk, testParameters, mockActionCallback, testState, false); verify(mockService).runAction(eq(VdcActionType.AddDisk), eq(testParameters), callbackAction.capture()); StatusCodeException exception = new StatusCodeException(0, "0 status code"); callbackAction.getValue().onFailure(exception); verify(mockFrontendFailureEvent, never()).raise(eq(Frontend.class), (FrontendFailureEventArgs) any()); verify(mockActionCallback, never()).executed(any(FrontendActionAsyncResult.class)); <START> verifyAsyncActionStarted(); <END> }</code><technical_language>answer. Note java doc explanation of test. Basically if presses escape http status code of 0 in Frontend code is failure, want ignore result</technical_language>

Target:
public void testrunActionImpl_ignored_failure() { VdcActionParametersBase testParameters = new VdcActionParametersBase(); frontend.runAction(VdcActionType.AddDisk, testParameters, mockActionCallback, testState, false); verify(mockService).runAction(eq(VdcActionType.AddDisk), eq(testParameters), callbackAction.capture()); StatusCodeException exception = new StatusCodeException(0, "0 status code"); callbackAction.getValue().onFailure(exception); verify(mockFrontendFailureEvent, never()).raise(eq(Frontend.class), (FrontendFailureEventArgs) any()); verify(mockActionCallback, never()).executed(any(FrontendActionAsyncResult.class)); verifyAsyncActionStartedButNotCompleted(); }
Source:
<code>private <T> Copier<T> createCopier(CopierConfiguration.Type type, Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?>... configs) { DefaultCopierConfiguration<T> conf = find(type, configs); Copier<T> copier; <START> final ClassInstanceConfiguration<Copier<?>> preConfigured = preconfiguredLoaders.get(clazz.getName()); <END> if (conf != null && conf.getInstance() != null) { copier = conf.getInstance(); } else if (conf != null && conf.getClazz().isAssignableFrom(SerializingCopier.class)) { if (serializer == null) { throw new IllegalStateException("No Serializer configured for type '" + clazz.getName() + "' which doesn't implement java.io.Serializable"); } copier = new SerializingCopier<T>(serializer); } else if (conf == null && preConfigured != null && preConfigured.getClazz().isAssignableFrom(SerializingCopier.class)) { if (serializer == null) { throw new IllegalStateException("No Serializer configured for type '" + clazz.getName() + "' which doesn't implement java.io.Serializable"); } copier = new SerializingCopier<T>(serializer); } else { copier = createCopier(clazz, conf); } LOG.info("Copier for <{}> : {}", clazz.getName(), copier); return copier; }</code><technical_language>of preconfiguredLoaders this field renamed</technical_language>

Target:
private <T> Copier<T> createCopier(CopierConfiguration.Type type, Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?>... configs) { DefaultCopierConfiguration<T> conf = find(type, configs); Copier<T> copier; final ClassInstanceConfiguration<Copier<?>> preConfigured = preconfigured.get(clazz.getName()); if (conf != null && conf.getInstance() != null) { copier = conf.getInstance(); } else if (conf != null && conf.getClazz().isAssignableFrom(SerializingCopier.class)) { if (serializer == null) { throw new IllegalStateException("No Serializer configured for type '" + clazz.getName() + "' which doesn't implement java.io.Serializable"); } copier = new SerializingCopier<T>(serializer); } else if (conf == null && preConfigured != null && preConfigured.getClazz().isAssignableFrom(SerializingCopier.class)) { if (serializer == null) { throw new IllegalStateException("No Serializer configured for type '" + clazz.getName() + "' which doesn't implement java.io.Serializable"); } copier = new SerializingCopier<T>(serializer); } else { copier = createCopier(clazz, conf); } LOG.info("Copier for <{}> : {}", clazz.getName(), copier); return copier; }
Source:
<code>public void revertSamRecord(final SAMRecord rec) { if (RESTORE_ORIGINAL_QUALITIES) { final byte[] oq = rec.getOriginalBaseQualities(); if (oq != null) { rec.setBaseQualities(oq); rec.setOriginalBaseQualities(null); } } if (REMOVE_DUPLICATE_INFORMATION) { rec.setDuplicateReadFlag(false); } if (REMOVE_ALIGNMENT_INFORMATION) { if (rec.getReadNegativeStrandFlag()) { SAMRecordUtil.reverseComplement(rec); rec.setReadNegativeStrandFlag(false); } rec.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setCigarString(SAMRecord.NO_ALIGNMENT_CIGAR); rec.setMappingQuality(SAMRecord.NO_MAPPING_QUALITY); <START> if (!rec.getReadUnmappedFlag()) { <END> rec.setInferredInsertSize(0); rec.setNotPrimaryAlignmentFlag(false); rec.setProperPairFlag(false); rec.setReadUnmappedFlag(true); } rec.setMateAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setMateNegativeStrandFlag(false); rec.setMateReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setMateUnmappedFlag(true); for (final String tag : ATTRIBUTE_TO_CLEAR) { rec.setAttribute(tag, null); } } }</code><technical_language>clearing mate information, I set of getReadUnmappedFlag flag</technical_language>

Target:
public void revertSamRecord(final SAMRecord rec) { if (RESTORE_ORIGINAL_QUALITIES) { final byte[] oq = rec.getOriginalBaseQualities(); if (oq != null) { rec.setBaseQualities(oq); rec.setOriginalBaseQualities(null); } } if (REMOVE_DUPLICATE_INFORMATION) { rec.setDuplicateReadFlag(false); } if (REMOVE_ALIGNMENT_INFORMATION) { if (rec.getReadNegativeStrandFlag()) { SAMRecordUtil.reverseComplement(rec); rec.setReadNegativeStrandFlag(false); } rec.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setCigarString(SAMRecord.NO_ALIGNMENT_CIGAR); rec.setMappingQuality(SAMRecord.NO_MAPPING_QUALITY); rec.setInferredInsertSize(0); rec.setNotPrimaryAlignmentFlag(false); rec.setProperPairFlag(false); rec.setReadUnmappedFlag(true); rec.setMateAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setMateNegativeStrandFlag(false); rec.setMateReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setMateUnmappedFlag(true); ATTRIBUTE_TO_CLEAR.forEach(tag -> rec.setAttribute(tag, null)); } }
Source:
<code>public void persistFilterActivationState() { synchronized (activeFilters) { CommonFilterDescriptorManager dm = CommonFilterDescriptorManager .getInstance(); StringBuffer activatedFiltersPreferenceValue = new StringBuffer(DELIM); for (String string : activeFilters) { <START> String id = string.toString(); <END> if (!dm.getFilterById(id).isVisibleInUi()) continue; activatedFiltersPreferenceValue.append(id).append(DELIM); } IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot(); prefs.put(getFilterActivationPreferenceKey(), activatedFiltersPreferenceValue.toString()); NavigatorContentService.flushPreferences(prefs); } }</code><technical_language>this do anything</technical_language>

Target:
public void persistFilterActivationState() { synchronized (activeFilters) { CommonFilterDescriptorManager dm = CommonFilterDescriptorManager .getInstance(); StringBuffer activatedFiltersPreferenceValue = new StringBuffer(DELIM); for (String id : activeFilters) { if (!dm.getFilterById(id).isVisibleInUi()) continue; activatedFiltersPreferenceValue.append(id).append(DELIM); } IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot(); prefs.put(getFilterActivationPreferenceKey(), activatedFiltersPreferenceValue.toString()); NavigatorContentService.flushPreferences(prefs); } }
Source:
<code>protected void executeCommand() { DbUser userToAdd = getParameters().getUserToAdd(); <START> DbUser syncedUser = SyncUsers.sync(Arrays.asList(userToAdd)).get(0); <END> if (Guid.isNullOrEmpty(syncedUser.getId()) && syncedUser.isActive()) { DbFacade.getInstance().getDbUserDao().save(syncedUser); } else { if (!Guid.isNullOrEmpty(syncedUser.getId())) { DbFacade.getInstance().getDbUserDao().update(syncedUser); } } setActionReturnValue(DbFacade.getInstance().getDbUserDao().getByExternalId(userToAdd.getDomain(), userToAdd.getExternalId()).getId()); setSucceeded(true); }</code><technical_language>return empty list... please care of it</technical_language>

Target:
protected void executeCommand() { DbUser userToAdd = getParameters().getUserToAdd(); for (DbUser syncedUser : SyncUsers.sync(Arrays.asList(userToAdd))) { if (Guid.isNullOrEmpty(syncedUser.getId())) { if (syncedUser.isActive()) { DbFacade.getInstance().getDbUserDao().save(syncedUser); } } else { DbFacade.getInstance().getDbUserDao().update(syncedUser); } } setActionReturnValue(DbFacade.getInstance().getDbUserDao().getByExternalId(userToAdd.getDomain(), userToAdd.getExternalId()).getId()); setSucceeded(true); }
Source:
<code>public void testRank() throws Exception { CacheStore.Provider provider = new CacheStore.Provider(); Assert.assertThat(provider.rank( Collections.<ResourceType>singleton(ResourceType.Core.DISK), Collections.<ServiceConfiguration<?>>emptyList()), <START> Matchers.is(0)); <END> Assert.assertThat(provider.rank( Collections.<ResourceType>singleton(ResourceType.Core.HEAP), Collections.<ServiceConfiguration<?>>emptyList()), Matchers.is(0)); Assert.assertThat(provider.rank( Collections.<ResourceType>singleton(ResourceType.Core.OFFHEAP), Collections.<ServiceConfiguration<?>>emptyList()), Matchers.is(0)); final ResourceType unmatchedResourceType = new ResourceType() { @Override public boolean isPersistable() { return true; } @Override public boolean requiresSerialization() { return true; } }; Assert.assertThat(provider.rank( Collections.singleton(unmatchedResourceType), Collections.<ServiceConfiguration<?>>emptyList()), Matchers.is(0)); }</code><technical_language>More style anything, static imports helps readability for me</technical_language>

Target:
public void testRank() throws Exception { CacheStore.Provider provider = new CacheStore.Provider(); assertRank(provider, 0, ResourceType.Core.DISK); assertRank(provider, 0, ResourceType.Core.HEAP); assertRank(provider, 0, ResourceType.Core.OFFHEAP); assertRank(provider, 0, ResourceType.Core.DISK, ResourceType.Core.OFFHEAP); assertRank(provider, 0, ResourceType.Core.DISK, ResourceType.Core.HEAP); assertRank(provider, 0, ResourceType.Core.OFFHEAP, ResourceType.Core.HEAP); assertRank(provider, 0, ResourceType.Core.DISK, ResourceType.Core.OFFHEAP, ResourceType.Core.HEAP); final ResourceType unmatchedResourceType = new ResourceType() { @Override public boolean isPersistable() { return true; } @Override public boolean requiresSerialization() { return true; } }; assertRank(provider, 0, unmatchedResourceType); }
Source:
<code>protected void processFiltered(File file, FileText fileText) throws CheckstyleException { if (CommonUtils.matchesFileExtension(file, getFileExtensions())) { final String msg = "%s occurred during the analysis of file %s."; final String fileName = file.getPath(); try { if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) { final FileContents contents = new FileContents(fileText); final DetailAST rootAST = parse(contents); if (!ordinaryChecks.isEmpty()) { walk(rootAST, contents, AstState.ORDINARY); } if (!commentChecks.isEmpty()) { final DetailAST astWithComments = appendHiddenCommentNodes(rootAST); walk(astWithComments, contents, AstState.WITH_COMMENTS); } <START> final SortedSet<LocalizedMessage> filteredMessages = <END> getFilteredMessages(fileName, contents, rootAST); addMessages(filteredMessages); messages.clear(); } } catch (final TokenStreamRecognitionException tre) { final String exceptionMsg = String.format(Locale.ROOT, msg, "TokenStreamRecognitionException", fileName); throw new CheckstyleException(exceptionMsg, tre); } catch (RecognitionException | TokenStreamException ex) { final String exceptionMsg = String.format(Locale.ROOT, msg, ex.getClass().getSimpleName(), fileName); throw new CheckstyleException(exceptionMsg, ex); } } }</code><technical_language>do need loop set of localized messages in case filters set is empty. Add check. If filters set is empty, invoke getFilteredMessages</technical_language>

Target:
protected void processFiltered(File file, FileText fileText) throws CheckstyleException { if (CommonUtils.matchesFileExtension(file, getFileExtensions())) { final String msg = "%s occurred during the analysis of file %s."; final String fileName = file.getPath(); try { if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) { final FileContents contents = new FileContents(fileText); final DetailAST rootAST = parse(contents); if (!ordinaryChecks.isEmpty()) { walk(rootAST, contents, AstState.ORDINARY); } if (!commentChecks.isEmpty()) { final DetailAST astWithComments = appendHiddenCommentNodes(rootAST); walk(astWithComments, contents, AstState.WITH_COMMENTS); } if (filters.isEmpty()) { addMessages(messages); } else { final SortedSet<LocalizedMessage> filteredMessages = getFilteredMessages(fileName, contents, rootAST); addMessages(filteredMessages); } messages.clear(); } } catch (final TokenStreamRecognitionException tre) { final String exceptionMsg = String.format(Locale.ROOT, msg, "TokenStreamRecognitionException", fileName); throw new CheckstyleException(exceptionMsg, tre); } catch (RecognitionException | TokenStreamException ex) { final String exceptionMsg = String.format(Locale.ROOT, msg, ex.getClass().getSimpleName(), fileName); throw new CheckstyleException(exceptionMsg, ex); } } }
Source:
<code>public static org.kie.server.api.model.instance.ProcessInstanceCustomVars convertToProcessInstanceCustomVars(ProcessInstanceCustomDesc pi) { if (pi == null) { return null; } org.kie.server.api.model.instance.ProcessInstanceCustomVars instance = org.kie.server.api.model.instance.ProcessInstanceCustomVars.builder() .id(pi.getId()) .processId(pi.getProcessId()) .processName(pi.getProcessName()) .processVersion(pi.getProcessVersion()) .containerId(pi.getDeploymentId()) .processInstanceDescription(pi.getProcessInstanceDescription()) .correlationKey(pi.getCorrelationKey()) .parentInstanceId(pi.getParentId()) .date(pi.getDataTimeStamp()) .initiator(pi.getInitiator()) .state(pi.getState()) .lastModificationDate(pi.getLastModificationDate()) .build(); if(pi.getVariables() != null && !pi.getVariables().isEmpty()) { instance.setVariables(pi.getVariables()); } <START> <END> return instance; }</code><technical_language>I this is needed if is null empty is set variables() method, bad happens, it</technical_language>

Target:
public static org.kie.server.api.model.instance.ProcessInstanceCustomVars convertToProcessInstanceCustomVars(ProcessInstanceCustomDesc pi) { if (pi == null) { return null; } org.kie.server.api.model.instance.ProcessInstanceCustomVars instance = org.kie.server.api.model.instance.ProcessInstanceCustomVars.builder() .id(pi.getId()) .processId(pi.getProcessId()) .processName(pi.getProcessName()) .processVersion(pi.getProcessVersion()) .containerId(pi.getDeploymentId()) .processInstanceDescription(pi.getProcessInstanceDescription()) .correlationKey(pi.getCorrelationKey()) .parentInstanceId(pi.getParentId()) .date(pi.getDataTimeStamp()) .initiator(pi.getInitiator()) .state(pi.getState()) .lastModificationDate(pi.getLastModificationDate()) .variables(pi.getVariables()) .build(); return instance; }
Source:
<code>public Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t, Void p) { AnnotatedTypeMirror returnType = t.getReturnType(); AnnotationMirror unknownThisAnnot = AnnotationBuilder.fromClass(elements, UnknownThis.class); AnnotationMirror retAnnotation = returnType.getAnnotationInHierarchy(unknownThisAnnot); if (retAnnotation != null && AnnotationUtils.areSame(retAnnotation, THIS_ANNOTATION)) { AnnotatedTypeMirror.AnnotatedDeclaredType receiverType = t.getReceiverType(); receiverType.replaceAnnotation(THIS_ANNOTATION); } <START> if (!isConstructor(t)) { <END> for (FrameworkSupport frameworkSupport : frameworks) { if (frameworkSupport.returnsThis(t)) { returnType.replaceAnnotation(THIS_ANNOTATION); AnnotatedTypeMirror.AnnotatedDeclaredType receiverType = t.getReceiverType(); receiverType.replaceAnnotation(THIS_ANNOTATION); break; } } } return super.visitExecutable(t, p); }</code><technical_language>I find surprising this block is skipped for constructors, block is not. is reason for discrepancy</technical_language>

Target:
public Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t, Void p) { if (t.getElement().getKind() == ElementKind.CONSTRUCTOR) { return super.visitExecutable(t, p); } AnnotatedTypeMirror returnType = t.getReturnType(); if (FluentAPIGenerator.check(t)) { if (!returnType.isAnnotatedInHierarchy(THIS_ANNOTATION)) { returnType.addAnnotation(THIS_ANNOTATION); } } AnnotationMirror retAnnotation = returnType.getAnnotationInHierarchy(THIS_ANNOTATION); if (retAnnotation != null && AnnotationUtils.areSame(retAnnotation, THIS_ANNOTATION)) { AnnotatedTypeMirror.AnnotatedDeclaredType receiverType = t.getReceiverType(); if (receiverType != null && !receiverType.isAnnotatedInHierarchy(THIS_ANNOTATION)) { receiverType.addAnnotation(THIS_ANNOTATION); } } return super.visitExecutable(t, p); }
Source:
<code>public IClimateState copy() { <START> return copy(false); <END> }</code><technical_language>I return this</technical_language>

Target:
public IClimateState copy() { return this; }
Source:
<code><START> Tristate(boolean val) { <END> this.val = val; }</code><technical_language>Why</technical_language>

Target:
private Tristate(boolean val) { this.val = val; }
Source:
<code>public void expiredEmbargoedBitstreamTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) .withName("Collection 1") .build(); String bitstreamContent = "Embargoed!"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2015-10-17") .withAuthor("Smith, Donald") .build(); Bitstream bitstream = BitstreamBuilder .createBitstream(context, publicItem1, is) .withName("Test Embargoed Bitstream") .withDescription("This bitstream is embargoed") .withMimeType("text/plain") .withEmbargoPeriod("-3 months") .build(); <START> context.restoreAuthSystemState(); <END> String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isOk()); getClient().perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isOk()); checkNumberOfStatsRecords(bitstream, 2); } }</code><technical_language>Again, here, I try closed *after* BitstreamBuilder. else move of try clause. this in embargoedBitstreamAccessGrantByAdminsTest()</technical_language>

Target:
public void expiredEmbargoedBitstreamTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) .withName("Collection 1") .build(); String bitstreamContent = "Embargoed!"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2015-10-17") .withAuthor("Smith, Donald") .build(); Bitstream bitstream = BitstreamBuilder .createBitstream(context, publicItem1, is) .withName("Test Embargoed Bitstream") .withDescription("This bitstream is embargoed") .withMimeType("text/plain") .withEmbargoPeriod("-3 months") .build(); } context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isOk()); getClient().perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isOk()); checkNumberOfStatsRecords(bitstream, 2); }
Source:
<code>public void read(String currentUrl, String lastUrl) { FeedConfig[] feeds = new FeedConfig[2]; feeds[0] = new FeedConfig(currentUrl, "/([0-9a-f-]*)\\?"); feeds[1] = new FeedConfig(lastUrl, "/([0-9a-f-]*)\\?"); configService.setFeedConfigs(new FeedConfigs(new HashSet<>(Arrays.asList(feeds)))); <START> fetch(); <END> FeedRecord feedRecord = feedRecordDataService.findByURL(currentUrl); String currenData = feedRecord.getData(); int currentPage = feedRecord.getPage(currenData); feedRecord = feedRecordDataService.findByURL(currentUrl); String lastData = feedRecord.getData(); int lastPage = feedRecord.getPage(lastData); configService.readNewFeeds(currentPage, lastPage, currentUrl); fetch(); }</code><technical_language>again, create collection</technical_language>

Target:
public void read(String currentUrl, String lastUrl) { List<FeedConfig> feeds = new ArrayList<>(); String regex = "/([0-9a-f-]*)\\?"; feeds.add(new FeedConfig(currentUrl, regex)); feeds.add(new FeedConfig(lastUrl, regex)); configService.setFeedConfigs(new FeedConfigs(new HashSet<>(feeds))); fetch(); FeedRecord feedRecord = feedRecordDataService.findByURL(currentUrl); String currenData = feedRecord.getData(); int currentPage = feedRecord.getPage(currenData); feedRecord = feedRecordDataService.findByURL(lastUrl); String lastData = feedRecord.getData(); int lastPage = feedRecord.getPage(lastData); configService.readNewFeeds(currentPage, lastPage, currentUrl); fetch(); }
Source:
<code>private RecordsToOpen( @JsonProperty("records") @NonNull @Singular final List<TableRecordReference> records, @JsonProperty("adWindowId") @Nullable final String adWindowId, @JsonProperty("target") @Nullable final OpenTarget target, @JsonProperty("targetTab") final TargetTab targetTab, @JsonProperty("automaticallySetReferencingDocumentPaths") @Nullable final Boolean automaticallySetReferencingDocumentPaths, @JsonProperty("useAutoFilters") @Nullable final Boolean useAutoFilters) { Check.assumeNotEmpty(records, "records is not empty"); this.records = ImmutableList.copyOf(records); this.windowIdString = StringUtils.trimBlankToNull(adWindowId); this.target = target != null ? target : OpenTarget.GridView; <START> this.targetTab = targetTab != null ? targetTab : target == OpenTarget.GridView ? TargetTab.SAME_TAB_OVERLAY : TargetTab.SAME_TAB; <END> this.automaticallySetReferencingDocumentPaths = automaticallySetReferencingDocumentPaths != null ? automaticallySetReferencingDocumentPaths : true; this.useAutoFilters = useAutoFilters != null ? useAutoFilters : true; }</code><technical_language>avoid logic here. pls decide kind of targetTab need caller method,</technical_language>

Target:
private RecordsToOpen( @JsonProperty("records") @NonNull @Singular final List<TableRecordReference> records, @JsonProperty("adWindowId") @Nullable final String adWindowId, @JsonProperty("target") @Nullable final OpenTarget target, @JsonProperty("targetTab") final TargetTab targetTab, @JsonProperty("automaticallySetReferencingDocumentPaths") @Nullable final Boolean automaticallySetReferencingDocumentPaths, @JsonProperty("useAutoFilters") @Nullable final Boolean useAutoFilters) { Check.assumeNotEmpty(records, "records is not empty"); this.records = ImmutableList.copyOf(records); this.windowIdString = StringUtils.trimBlankToNull(adWindowId); this.target = target != null ? target : OpenTarget.GridView; this.targetTab = targetTab != null ? targetTab : TargetTab.SAME_TAB; this.automaticallySetReferencingDocumentPaths = automaticallySetReferencingDocumentPaths != null ? automaticallySetReferencingDocumentPaths : true; this.useAutoFilters = useAutoFilters != null ? useAutoFilters : true; }
Source:
<code>public void loadContactPicture(final Address address, final ImageView imageView) { Uri photoUri = mContactsHelper.getPhotoUri(address.getAddress()); if (photoUri != null) { <START> final RequestListener<Uri, GlideDrawable> noPhotoListener = new RequestListener<Uri, GlideDrawable>() { <END> @Override public boolean onException(Exception e, Uri model, Target<GlideDrawable> target, boolean isFirstResource) { loadFallbackPicture(address, imageView); return true; } @Override public boolean onResourceReady(GlideDrawable resource, Uri model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) { return false; } }; Glide.with(imageView.getContext()) .load(photoUri) .diskCacheStrategy(DiskCacheStrategy.NONE) .listener(noPhotoListener) .dontAnimate() .override(mPictureSizeInPx, mPictureSizeInPx) .into(imageView); } else { loadFallbackPicture(address, imageView); } }</code><technical_language>need for this var final</technical_language>

Target:
public void loadContactPicture(final Address address, final ImageView imageView) { Uri photoUri = mContactsHelper.getPhotoUri(address.getAddress()); loadContactPicture(photoUri, address, imageView); }
Source:
<code>public void testBufferSizeFlush() throws Exception { int maxSize = 1024; BufferedMutatorParams params = new BufferedMutatorParams(TABLE_NAME) .writeBufferSize(maxSize); try (BufferedMutator mutator = connection.getBufferedMutator(params)) { Put put = getPut(); mutator.mutate(put); <START> Assert.assertTrue(mutator.getWriteBufferSize() > 0); <END> Put largePut = new Put(dataHelper.randomData("testrow-")); largePut.addColumn(COLUMN_FAMILY, qualifier, Bytes.toBytes(RandomStringUtils.randomAlphanumeric(maxSize * 2))); long heapSize = largePut.heapSize(); Assert.assertTrue("largePut heapsize is : " + heapSize, heapSize > maxSize); mutator.mutate(largePut); Assert.assertTrue( 0 == mutator.getWriteBufferSize() || maxSize == mutator.getWriteBufferSize()); } }</code><technical_language>Check is 0 put</technical_language>

Target:
public void testBufferSizeFlush() throws Exception { int maxSize = 1024; BufferedMutatorParams params = new BufferedMutatorParams(TABLE_NAME) .writeBufferSize(maxSize); try (BufferedMutator mutator = connection.getBufferedMutator(params)) { Assert.assertTrue( 0 == mutator.getWriteBufferSize() || maxSize == mutator.getWriteBufferSize()); Put put = getPut(); mutator.mutate(put); Assert.assertTrue(mutator.getWriteBufferSize() > 0); Put largePut = new Put(dataHelper.randomData("testrow-")); largePut.addColumn(COLUMN_FAMILY, qualifier, Bytes.toBytes(RandomStringUtils.randomAlphanumeric(maxSize * 2))); long heapSize = largePut.heapSize(); Assert.assertTrue("largePut heapsize is : " + heapSize, heapSize > maxSize); mutator.mutate(largePut); Assert.assertTrue( 0 == mutator.getWriteBufferSize() || maxSize == mutator.getWriteBufferSize()); } }
Source:
<code>private ConfigurationObjectDto retrieveConfigurationObject(final DlmsConnectionHolder conn) throws IOException, TimeoutException, ProtocolAdapterException { final AttributeAddress configurationObjectValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); conn.getDlmsMessageListener() <START> .setDescription("SetConfigurationObject retrieve current value, retrieve attribute: " <END> + JdlmsObjectToStringUtil.describeAttributes(configurationObjectValue)); LOGGER.info( "Retrieving current configuration object by issuing get request for class id: {}, obis code: {}, attribute id: {}", CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final GetResult getResult = conn.getConnection().get(configurationObjectValue); if (getResult == null) { throw new ProtocolAdapterException("No result received while retrieving current configuration object."); } return this.getConfigurationObject(getResult); }</code><technical_language>method getConfigurationObjectDto(DlmsConnectionHolder) get called GetConfigurationObjectCommandExecutor SetConfigurationObjectCommandExecutor. description is set DLMS message listener starts "SetConfigurationObject", confusing called configuration object</technical_language>

Target:
private ConfigurationObjectDto retrieveConfigurationObject(final DlmsConnectionHolder conn) throws IOException, TimeoutException, ProtocolAdapterException { final AttributeAddress configurationObjectValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); conn.getDlmsMessageListener().setDescription("retrieve current ConfigurationObject, attribute: " + JdlmsObjectToStringUtil.describeAttributes(configurationObjectValue)); LOGGER.info( "Retrieving current configuration object by issuing get request for class id: {}, obis code: {}, attribute id: {}", CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final GetResult getResult = conn.getConnection().get(configurationObjectValue); if (getResult == null) { throw new ProtocolAdapterException("No result received while retrieving current configuration object."); } return this.getConfigurationObject(getResult); }
Source:
<code>private void test(int callsiteSize) { String testName = "Test" + callsiteSize + " callsites"; addCallsites(callsiteSize); Performance perf = Performance.getDefault(); <START> PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName); <END> testMain(pm); pm.commit(); }</code><technical_language>Other test suits a line perf.tagAsSummary() example below. Do need here, too? perf.tagAsSummary(pm, TEST_SUITE_NAME + ':' + testName, Dimension.CPU_TIME);</technical_language>

Target:
private void test(int callsiteSize) { String testName = "Test" + callsiteSize + " callsites"; addCallsites(callsiteSize); Performance perf = Performance.getDefault(); PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName); perf.tagAsSummary(pm, TEST_SUITE_NAME + ':' + callsiteSize + " callsites", Dimension.CPU_TIME); testMain(pm); pm.commit(); }
Source:
<code>private void handleDescription(List<StringField> descriptionList, DataSetReference.Builder metaBuilder) { if (CollectionUtils.isNotEmpty(descriptionList)) { <START> for (StringField currentDescription : descriptionList) { if (fieldApprover.approve(currentDescription.getDataInfo()) && StringUtils.isNotBlank(currentDescription.getValue()) && !NULL_STRING_VALUE.equals(currentDescription.getValue())) { metaBuilder.setDescription(currentDescription.getValue()); break; } } } <END> }</code><technical_language>I this is more readable java descriptionList.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .filter(x -> StringUtils.isNotBlank(x.getValue())) .filter(x -> !NULL_STRING_VALUE.equals(x.getValue())) .findFirst() .map(StringField::getValue) .ifPresent(metaBuilder::setDescription);</technical_language>

Target:
private void handleDescription(List<StringField> descriptionList, DataSetReference.Builder metaBuilder) { if (CollectionUtils.isNotEmpty(descriptionList)) { descriptionList.stream().filter(x -> fieldApprover.approve(x.getDataInfo())) .filter(x -> StringUtils.isNotBlank(x.getValue())) .filter(x -> !NULL_STRING_VALUE.equals(x.getValue())).findFirst().map(StringField::getValue) .ifPresent(metaBuilder::setDescription); } }
Source:
<code>public static void assumeChrome(WebDriver driver) { Assume.assumeNotNull(driver); String chromeArguments = System.getProperty("chromeArguments"); Assume.assumeNotNull(chromeArguments); Assume.assumeTrue(chromeArguments.contains("--enable-web-authentication-testing-api")); Assume.assumeTrue("Browser must be Chrome (RemoteWebDriver)!", driver instanceof RemoteWebDriver); Capabilities cap = ((RemoteWebDriver) driver).getCapabilities(); String browserName = cap.getBrowserName().toLowerCase(); int version = Integer.parseInt(cap.getVersion().substring(0, cap.getVersion().indexOf("."))); Assume.assumeTrue("Browser must be Chrome !", browserName.equals(CHROME_NAME)); <START> Assume.assumeTrue("Version of chrome must be higher than " + CHROME_MIN_VERSION, version >= CHROME_MIN_VERSION); <END> }</code><technical_language>I "Version of chrome higher equal " appropriate. do it</technical_language>

Target:
public static void assumeChrome(WebDriver driver) { Assume.assumeNotNull(driver); String chromeArguments = System.getProperty("chromeArguments"); Assume.assumeNotNull(chromeArguments); Assume.assumeTrue(chromeArguments.contains("--enable-web-authentication-testing-api")); Assume.assumeTrue("Browser must be Chrome (RemoteWebDriver)!", driver instanceof RemoteWebDriver); Capabilities cap = ((RemoteWebDriver) driver).getCapabilities(); String browserName = cap.getBrowserName().toLowerCase(); int version = Integer.parseInt(cap.getVersion().substring(0, cap.getVersion().indexOf("."))); Assume.assumeTrue("Browser must be Chrome !", browserName.equals(CHROME_NAME)); Assume.assumeTrue("Version of chrome must be higher than or equal to " + CHROME_MIN_VERSION, version >= CHROME_MIN_VERSION); }
Source:
<code>private Operation<List<BuildConfig>> showConfirmDialog(final ProjectDescriptor projectDescriptor, final String nameSpace) { return new Operation<List<BuildConfig>>() { @Override public void apply(List<BuildConfig> configs) throws OperationException { String dialogLabel = ""; if (configs.isEmpty()) { dialogLabel = locale.deleteProjectWithoutAppLabel(nameSpace); } <START> if (configs.size() == 1) { <END> dialogLabel = locale.deleteSingleAppProjectLabel(nameSpace); } if (configs.size() > 1) { String applications = getBuildConfigNames(configs); dialogLabel = locale.deleteMultipleAppProjectLabel(nameSpace, applications); } dialogFactory.createConfirmDialog(locale.deleteProjectDialogTitle(), dialogLabel, new ConfirmCallback() { @Override public void accepted() { service.deleteProject(nameSpace).then(new Operation<Void>() { @Override public void apply(Void arg) throws OperationException { notificationManager.showInfo(locale.deleteNameSpaceSuccess(nameSpace)); cleanUpApplication(projectDescriptor, nameSpace); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { handleError(nameSpace); } }); } }, null).show(); } }; }</code><technical_language>please if else statement</technical_language>

Target:
private Operation<List<BuildConfig>> showConfirmDialog(final ProjectDescriptor projectDescriptor, final String nameSpace) { return new Operation<List<BuildConfig>>() { @Override public void apply(List<BuildConfig> configs) throws OperationException { String dialogLabel; if (configs.isEmpty()) { dialogLabel = locale.deleteProjectWithoutAppLabel(nameSpace); } else if (configs.size() == 1) { dialogLabel = locale.deleteSingleAppProjectLabel(nameSpace); } else { String applications = getBuildConfigNames(configs); dialogLabel = locale.deleteMultipleAppProjectLabel(nameSpace, applications); } dialogFactory.createConfirmDialog(locale.deleteProjectDialogTitle(), dialogLabel, new ConfirmCallback() { @Override public void accepted() { service.deleteProject(nameSpace).then(new Operation<Void>() { @Override public void apply(Void arg) throws OperationException { notificationManager.showInfo(locale.deleteProjectSuccess(nameSpace)); removeOpenshiftMixin(projectDescriptor, nameSpace); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { handleError(nameSpace); } }); } }, null).show(); } }; }
Source:
<code>public void removeListenersFromController(GenericHelixController controller) { PropertyKey.Builder keyBuilder = new PropertyKey.Builder(_manager.getClusterName()); _manager.removeListener(keyBuilder.idealStates(), controller); _manager.removeListener(keyBuilder.liveInstances(), controller); _manager.removeListener(keyBuilder.clusterConfig(), controller); _manager.removeListener(keyBuilder.resourceConfigs(), controller); _manager.removeListener(keyBuilder.instanceConfigs(), controller); <START> _manager.removeListener(keyBuilder.customizedStateConfig(), controller); <END> _manager.removeListener(keyBuilder.controller(), controller); _manager.removeListener(keyBuilder.controllerMessages(), _messagingService.getExecutor()); }</code><technical_language>Please follow reverse order in listeners added</technical_language>

Target:
public void removeListenersFromController(GenericHelixController controller) { PropertyKey.Builder keyBuilder = new PropertyKey.Builder(_manager.getClusterName()); _manager.removeListener(keyBuilder.idealStates(), controller); _manager.removeListener(keyBuilder.liveInstances(), controller); _manager.removeListener(keyBuilder.customizedStateConfig(), controller); _manager.removeListener(keyBuilder.clusterConfig(), controller); _manager.removeListener(keyBuilder.resourceConfigs(), controller); _manager.removeListener(keyBuilder.instanceConfigs(), controller); _manager.removeListener(keyBuilder.controller(), controller); _manager.removeListener(keyBuilder.controllerMessages(), _messagingService.getExecutor()); }
Source:
<code>public void set(String name, Object value, Document document, LuceneOptions luceneOptions) { if ( value == null ) { return; } Double doubleValue = ((WrappedDoubleValue) value).value; if ( doubleValue == null ) { return; } <START> document.add( new DoubleDocValuesField( name, doubleValue ) ); <END> }</code><technical_language>get rid of luceneOptions</technical_language>

Target:
public void set(String name, Object value, Document document, LuceneOptions luceneOptions) { if ( value == null ) { return; } Double doubleValue = ((WrappedDoubleValue) value).value; if ( doubleValue == null ) { return; } luceneOptions.addNumericFieldToDocument( name, doubleValue, document ); document.add( new DoubleDocValuesField( name, doubleValue ) ); }
Source:
<code>private boolean startIPv6() { try { mNwService.setInterfaceIpv6PrivacyExtensions(mInterfaceName, true); <START> setIPv6AddrGenModeIfSupported(); <END> mNwService.enableIpv6(mInterfaceName); } catch (RemoteException re) { logError("Unable to change interface settings: %s", re); return false; } catch (IllegalStateException ie) { logError("Unable to change interface settings: %s", ie); return false; } return true; }</code><technical_language>Note this impossible disable stable privacy, setIPv6AddrGenMode(IPV6_ADDR_GEN_MODE_STABLE_PRIVACY) result in netd writing "" stable_secret, turn stable privacy. in-person solution, netd do right writing netlink code set addrgenmode</technical_language>

Target:
private boolean startIPv6() { try { mNwService.setInterfaceIpv6PrivacyExtensions(mInterfaceName, true); setIPv6AddrGenModeIfSupported(); mNwService.enableIpv6(mInterfaceName); } catch (IllegalStateException | RemoteException | ServiceSpecificException e) { logError("Unable to change interface settings: %s", e); return false; } return true; }