auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addTaskAndResolveOrphans(ITmfStateSystemBuilder ssb, TaskContainerEvent t) { processTaskEvent(ssb, t); setTaskCPUStatus(ssb, t); boolean retryUnresolvedTasks = false; do { retryUnresolvedTasks = false; for (Iterator<TaskContainerEvent> iterator = unresolvedTasks.iterator(); iterator.hasNext();) { <START> final TaskContainerEvent orphan = iterator.next(); <END> if (orphan == null) { iterator.remove(); continue; } if (isParentContainerAdded(ssb, orphan)) { processTaskEvent(ssb, orphan); setTaskCPUStatus(ssb, t); iterator.remove(); retryUnresolvedTasks = true; } } } while (retryUnresolvedTasks); }</code><technical_language>"for each" syntax, is more succint, error-prone: for (TaskContainerEvent orphan : unresolvedTasks) { (it works array of object implements Iterable)</technical_language>

Target:
private void addTaskAndResolveOrphans(ITmfStateSystemBuilder ssb, TaskContainerEvent t) { processTaskEvent(ssb, t); setTaskCPUStatus(ssb, t); boolean retryUnresolvedTasks = false; do { retryUnresolvedTasks = false; List<TaskContainerEvent> stillUnresolvedTasks = new LinkedList<>(); for (TaskContainerEvent orphan : unresolvedTasks) { if (isParentContainerAdded(ssb, orphan)) { processTaskEvent(ssb, orphan); setTaskCPUStatus(ssb, t); retryUnresolvedTasks = true; } else { stillUnresolvedTasks.add(orphan); } } unresolvedTasks = stillUnresolvedTasks; } while (retryUnresolvedTasks); }
Source:
<code>public CcmV2Parameters getCcmV2Parameters(@Nonnull String accountId, @Nonnull String clusterGatewayDomain, @Nonnull String agentKeyId) { String requestId = Optional.ofNullable(MDCBuilder.getMdcContextMap().get(LoggerContextKey.REQUEST_ID.toString())).orElse(UUID.randomUUID().toString()); MDCBuilder.addRequestId(requestId); InvertingProxy invertingProxy = ccmV2Client.awaitReadyInvertingProxyForAccount(requestId, accountId); InvertingProxyAgent invertingProxyAgent = ccmV2Client.registerInvertingProxyAgent(requestId, accountId, clusterGatewayDomain, agentKeyId); <START> checkArgument(StringUtils.isNotEmpty(invertingProxy.getHostname()), "InvertingProxy Hostname is not initialized."); checkArgument(StringUtils.isNotEmpty(invertingProxy.getCertificate()), "InvertingProxy Certificate is not initialized."); checkArgument(StringUtils.isNotEmpty(invertingProxyAgent.getAgentCrn()), "InvertingProxyAgent Crn is not initialized."); checkArgument(StringUtils.isNotEmpty(invertingProxyAgent.getEncipheredPrivateKey()), "InvertingProxyAgent Enciphered Key is not initialized."); checkArgument(StringUtils.isNotEmpty(invertingProxyAgent.getCertificate()), "InvertingProxyAgent Certificate is not initialized."); <END> LOGGER.debug("CcmV2Config successfully retrieved InvertingProxyHost : '{}', InvertingProxyStatus : '{}' InvertingProxyAgentCrn '{}'", invertingProxy.getHostname(), invertingProxy.getStatus(), invertingProxyAgent.getAgentCrn()); return new DefaultCcmV2Parameters(invertingProxy.getHostname(), invertingProxy.getCertificate(), invertingProxyAgent.getAgentCrn(), agentKeyId, invertingProxyAgent.getEncipheredPrivateKey(), invertingProxyAgent.getCertificate()); }</code><technical_language>move validations a separate method? thanks</technical_language>

Target:
public CcmV2Parameters getCcmV2Parameters(@Nonnull String accountId, @Nonnull String clusterGatewayDomain, @Nonnull String agentKeyId) { String requestId = MDCBuilder.getOrGenerateRequestId(); InvertingProxy invertingProxy = ccmV2Client.awaitReadyInvertingProxyForAccount(requestId, accountId); InvertingProxyAgent invertingProxyAgent = ccmV2Client.registerInvertingProxyAgent(requestId, accountId, clusterGatewayDomain, agentKeyId); validateCcmV2ConfigResponse(invertingProxy, invertingProxyAgent); LOGGER.debug("CcmV2Config successfully retrieved InvertingProxyHost : '{}', InvertingProxyStatus : '{}' InvertingProxyAgentCrn '{}'", invertingProxy.getHostname(), invertingProxy.getStatus(), invertingProxyAgent.getAgentCrn()); return new DefaultCcmV2Parameters(invertingProxy.getHostname(), invertingProxy.getCertificate(), invertingProxyAgent.getAgentCrn(), agentKeyId, invertingProxyAgent.getEncipheredPrivateKey(), invertingProxyAgent.getCertificate()); }
Source:
<code>@Test public void getUrlAndUrlParamThrows() { class Example { @GET("foo/bar") Call<Object> method(@Url Object url) { return null; } } try { <START> buildRequest(Example.class, "foo/bar"); <END> } catch (IllegalArgumentException e) { assertThat(e).hasMessage("@Url must be String type. (parameter #1)\n" + " for method Example.method"); } }</code><technical_language>fail</technical_language>

Target:
@Test public void getUrlAndUrlParamThrows() { class Example { @GET("foo/bar") Call<Object> method(@Url Object url) { return null; } } try { buildRequest(Example.class, "foo/bar"); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("@Url must be String type. (parameter #1)\n" + " for method Example.method"); } }
Source:
<code>public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<SessionInfo> iterator = sessionInfoList.iterator(); while (iterator.hasNext()) { ConcurrentMap<String, Object> sessionMap = iterator.next().sessionMap; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if (hardLimit != null) { if (hardLimit.before(now)) { iterator.remove(); } } else if (softLimit != null) { if (softLimit.before(now)) { iterator.remove(); } <START> } <END> } }</code><technical_language>this I understand! put null instead of MAX_INT if limit</technical_language>

Target:
public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<SessionInfo> iterator = sessionInfoList.iterator(); while (iterator.hasNext()) { ConcurrentMap<String, Object> sessionMap = iterator.next().sessionMap; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if (hardLimit != null) { if (hardLimit.before(now)) { iterator.remove(); } } if (softLimit != null) { if (softLimit.before(now)) { iterator.remove(); } } } }
Source:
<code>private void initializeLookupsConfigWatcher() { lookupMapConfigRef = configManager.watch( LOOKUP_CONFIG_KEY, new TypeReference<Map<String, Map<String, LookupExtractorFactoryMapContainer>>>() { }, null ); if (lookupMapConfigRef.get() == null) { Map<String, Map<String, Map<String, Object>>> oldLookups = configManager.watch( OLD_LOOKUP_CONFIG_KEY, new TypeReference<Map<String, Map<String, Map<String, Object>>>>() { }, null ).get(); if (oldLookups != null) { Map<String, Map<String, LookupExtractorFactoryMapContainer>> converted = new HashMap<>(); for (Map.Entry<String, Map<String, Map<String, Object>>> tierEntry : oldLookups.entrySet()) { Map<String, Map<String, Object>> oldTierLookups = tierEntry.getValue(); if (oldTierLookups != null && !oldTierLookups.isEmpty()) { Map<String, LookupExtractorFactoryMapContainer> convertedTierLookups = new HashMap<>(); for (Map.Entry<String, Map<String, Object>> e : oldTierLookups.entrySet()) { convertedTierLookups.put(e.getKey(), new LookupExtractorFactoryMapContainer(null, e.getValue())); } converted.put(tierEntry.getKey(), convertedTierLookups); } } configManager.set( LOOKUP_CONFIG_KEY, converted, <START> new AuditInfo("autoConversion", "autoConversion", "127.0.0.1") <END> ); } } }</code><technical_language>Suggest druid.host instead of 127.0.0.1</technical_language>

Target:
private void initializeLookupsConfigWatcher() { lookupMapConfigRef = configManager.watch( LOOKUP_CONFIG_KEY, new TypeReference<Map<String, Map<String, LookupExtractorFactoryMapContainer>>>() { }, null ); if (lookupMapConfigRef.get() == null) { Map<String, Map<String, Map<String, Object>>> oldLookups = configManager.watch( OLD_LOOKUP_CONFIG_KEY, new TypeReference<Map<String, Map<String, Map<String, Object>>>>() { }, null ).get(); if (oldLookups != null) { Map<String, Map<String, LookupExtractorFactoryMapContainer>> converted = new HashMap<>(); oldLookups.forEach( (tier, oldTierLookups) -> { if (oldTierLookups != null && !oldTierLookups.isEmpty()) { converted.put(tier, convertTierLookups(oldTierLookups)); } } ); configManager.set( LOOKUP_CONFIG_KEY, converted, new AuditInfo("autoConversion", "autoConversion", "127.0.0.1") ); } } }
Source:
<code>public int compareTypeSafe(Value v, CompareMode mode) { <START> return 0; <END> }</code><technical_language>This method implemented</technical_language>

Target:
public int compareTypeSafe(Value v, CompareMode mode) { JsonNode other = ((ValueJson) v).json; if (this.json.equals(other)) { return 0; } if ((this.json.isNumber()) && other.isNumber()) { double d1 = this.json.asDouble(); double d2 = other.asDouble(); return Double.compare(d1, d2); } int comp = this.json.asText().compareTo(other.asText()); if (comp == 0) { return Integer.compare(this.json.hashCode(), other.hashCode()); } return comp; }
Source:
<code>public String asCql() { StringBuilder builder = new StringBuilder("INSERT INTO "); CqlHelper.qualify(keyspace, table, builder); if (json == null) { CqlHelper.appendIds(assignments.keySet(), builder, " (", ",", ")"); CqlHelper.append(assignments.values(), builder, " VALUES (", ",", ")"); } else { builder.append(" JSON "); json.appendTo(builder); if (missingJsonBehavior == MissingJsonBehavior.NULL) { builder.append(" DEFAULT NULL"); } else if (missingJsonBehavior == MissingJsonBehavior.UNSET) { builder.append(" DEFAULT UNSET"); } } if (ifNotExists) { builder.append(" IF NOT EXISTS"); } if (timestamp != null) { builder.append(" USING TIMESTAMP "); if (timestamp instanceof BindMarker) { ((BindMarker) timestamp).appendTo(builder); } else { builder.append(timestamp); } } if (ttl != null) { <START> builder.append(" USING TTL "); <END> if (ttl instanceof BindMarker) { ((BindMarker) ttl).appendTo(builder); } else { builder.append(ttl); } } return builder.toString(); }</code><technical_language>If timestamp specified, this " TTL ". clauses I need get fancy, re-check timestamp != null determine keyword use</technical_language>

Target:
public String asCql() { StringBuilder builder = new StringBuilder("INSERT INTO "); CqlHelper.qualify(keyspace, table, builder); if (json == null) { CqlHelper.appendIds(assignments.keySet(), builder, " (", ",", ")"); CqlHelper.append(assignments.values(), builder, " VALUES (", ",", ")"); } else { builder.append(" JSON "); json.appendTo(builder); if (missingJsonBehavior == MissingJsonBehavior.NULL) { builder.append(" DEFAULT NULL"); } else if (missingJsonBehavior == MissingJsonBehavior.UNSET) { builder.append(" DEFAULT UNSET"); } } if (ifNotExists) { builder.append(" IF NOT EXISTS"); } if (timestamp != null) { builder.append(" USING TIMESTAMP "); if (timestamp instanceof BindMarker) { ((BindMarker) timestamp).appendTo(builder); } else { builder.append(timestamp); } } if (ttlInSeconds != null) { builder.append((timestamp != null) ? " AND " : " USING ").append("TTL "); if (ttlInSeconds instanceof BindMarker) { ((BindMarker) ttlInSeconds).appendTo(builder); } else { builder.append(ttlInSeconds); } } return builder.toString(); }
Source:
<code>public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); String response = null; Matcher matcher; try { response = urlopen.open("<LINK_0>"); matcher = reAccounts.matcher(response); int accId = 0; while (matcher.find()) { mIdMappings.put(Integer.toString(accId), matcher.group(2).trim()); accounts.add(new Account(Html.fromHtml(matcher.group(1)).toString().trim() + " (Tillgängligt belopp)", Helpers.parseBalance(matcher.group(5).trim()), Integer.toString(accId))); Account account = new Account(Html.fromHtml(matcher.group(1)).toString().trim() + " (Saldo)", Helpers.parseBalance(matcher.group(6).trim()), "a:" + accId); account.setAliasfor(matcher.group(1).trim()); accounts.add(account); balance = balance.add(Helpers.parseBalance(matcher.group(5))); accId++; } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } <START> } finally { <END> super.updateComplete(); } }</code><technical_language>remove finally {</technical_language>

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); String response = urlopen.open("<LINK_0>"); Matcher matcher = reAccounts.matcher(response); int accId = 0; while (matcher.find()) { mIdMappings.put(Integer.toString(accId), matcher.group(2).trim()); accounts.add(new Account(Html.fromHtml(matcher.group(1)).toString().trim() + " (Tillgängligt belopp)", Helpers.parseBalance(matcher.group(5).trim()), Integer.toString(accId))); Account account = new Account(Html.fromHtml(matcher.group(1)).toString().trim() + " (Saldo)", Helpers.parseBalance(matcher.group(6).trim()), "a:" + accId); account.setAliasfor(matcher.group(1).trim()); accounts.add(account); balance = balance.add(Helpers.parseBalance(matcher.group(5))); accId++; } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
<code>public void update(PhysicalPlanHelper physicalPlanHelper) { if (bolt instanceof IUpdatable) { <START> ((IUpdatable) bolt).update(physicalPlanHelper.getTopologyContext()); <END> } }</code><technical_language>invoke user code fail/block. is expectation in cases? I executor log error launch a new instance if error occurs</technical_language>

Target:
public void update(PhysicalPlanHelper physicalPlanHelper) { if (bolt instanceof IUpdatable) { ((IUpdatable) bolt).update(physicalPlanHelper.getTopologyContext()); } collector.updatePhysicalPlanHelper(physicalPlanHelper); }
Source:
<code>private static WebElement findElement(Hook hook, WebDriver driver) throws CandybeanException { try { return driver.findElement(getBy(hook)); <START> } catch (NoSuchElementException e) { <END> throw e; } catch (WebDriverException e) { throw e; } }</code><technical_language>catch blocks body Java 7, user multi-catch syntax: } catch(NoSuchElementException|WebDriverException e {</technical_language>

Target:
private static WebElement findElement(Hook hook, WebDriver driver) throws CandybeanException { try { return driver.findElement(getBy(hook)); } catch (WebDriverException e) { throw e; } }
Source:
<code>public void delete(Long id) { Form form = formsRepository.get(id); List<Instance> instances = instancesRepository.getAllByJrFormId(form.getJrFormId()); <START> long instancesForVersion = instances.stream().filter(instance -> Objects.equals(instance.getJrVersion(), form.getJrVersion())).count(); <END> if (instancesForVersion > 0) { formsRepository.softDelete(form.getId()); } else { formsRepository.delete(id); } }</code><technical_language>getAllByJrFormIdAndJrVersion</technical_language>

Target:
public void delete(Long id) { Form form = formsRepository.get(id); List<Instance> instancesForVersion = instancesRepository.getAllByJrFormIdAndJrVersion(form.getJrFormId(), form.getJrVersion()); if (instancesForVersion.isEmpty()) { formsRepository.delete(id); } else { formsRepository.softDelete(form.getId()); } }
Source:
<code>private static void show(JComponent... components) { for (JComponent component : components) { component.setVisible(true); <START> component.getParent().invalidate(); <END> component.getParent().getParent().invalidate(); } }</code><technical_language>curious, do invalidate direct parent if invalidate grandparent</technical_language>

Target:
private static void show(JComponent... components) { for (JComponent component : components) { component.setVisible(true); component.getParent().invalidate(); } }
Source:
<code>public JdbcTaskExecutionDao(DataSource dataSource) { Assert.notNull(dataSource, "The dataSource must not be null."); this.jdbcTemplate = new JdbcTemplate(dataSource); <START> this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(this.jdbcTemplate); <END> this.dataSource = dataSource; orderMap = new LinkedHashMap<>(); orderMap.put("START_TIME", Order.DESCENDING); orderMap.put("TASK_EXECUTION_ID", Order.DESCENDING); }</code><technical_language>this is internal, pick instead of creating templates (there is a constructor takes a DataSource)</technical_language>

Target:
public JdbcTaskExecutionDao(DataSource dataSource) { Assert.notNull(dataSource, "The dataSource must not be null."); this.jdbcTemplate = new NamedParameterJdbcTemplate(dataSource); this.dataSource = dataSource; orderMap = new LinkedHashMap<>(); orderMap.put("START_TIME", Order.DESCENDING); orderMap.put("TASK_EXECUTION_ID", Order.DESCENDING); }
Source:
<code>private static String injectRealAccounts(String jsonString) { return jsonString .replace("${test.student1}", TestProperties.inst().TEST_STUDENT1_ACCOUNT) .replace("${test.student2}", TestProperties.inst().TEST_STUDENT2_ACCOUNT) .replace("${test.instructor}", TestProperties.inst().TEST_INSTRUCTOR_ACCOUNT) .replace("${test.unreg}", TestProperties.inst().TEST_UNREG_ACCOUNT) .replace("${test.admin}", TestProperties.inst().TEST_ADMIN_ACCOUNT) <START> .replace("${test.truncatedAdmin}", StringHelper.truncate(TestProperties.inst().TEST_ADMIN_ACCOUNT, Const.SystemParams.USER_ID_MAX_DISPLAY_LENGTH)) <END> .replace("${support.email}", Config.SUPPORT_EMAIL); }</code><technical_language>sense include ${test.truncatedAdmin} truncation of admin's account for display, this method is values get inserted database</technical_language>

Target:
private static String injectRealAccounts(String jsonString) { return jsonString .replace("${test.student1}", TestProperties.inst().TEST_STUDENT1_ACCOUNT) .replace("${test.student2}", TestProperties.inst().TEST_STUDENT2_ACCOUNT) .replace("${test.instructor}", TestProperties.inst().TEST_INSTRUCTOR_ACCOUNT) .replace("${test.unreg}", TestProperties.inst().TEST_UNREG_ACCOUNT) .replace("${test.admin}", TestProperties.inst().TEST_ADMIN_ACCOUNT) .replace("${support.email}", Config.SUPPORT_EMAIL); }
Source:
<code><START> public synchronized static VertexHopCriteria createCriteria(String namespace, String nodeId, String nodeLabel) { <END> VertexHopCriteria criterion = new LinkdHopCriteria(namespace,nodeId, nodeLabel); return criterion; }</code><technical_language>synchronized safely removed this method is stateless. suggestion public static VertexHopCriteria createCriteria(String namespace, String nodeId, String nodeLabel) {</technical_language>

Target:
public static VertexHopCriteria createCriteria(String namespace, String nodeId, String nodeLabel) { VertexHopCriteria criterion = new LinkdHopCriteria(namespace, nodeId, nodeLabel); return criterion; }
Source:
<code>public void close() { <START> this.reactivateExecutorService.shutdown(); <END> }</code><technical_language>this shutdownNow pending reactivate commands terminated</technical_language>

Target:
public void close() { this.reactivateExecutorService.shutdownNow(); }
Source:
<code>public static String generateScript(Script script, Map<String, Object> parameterValues) { StringWriter stringWriter = new StringWriter(); try { Template template = new Template(null, new StringReader(script.getContent()), new Configuration(Configuration.VERSION_2_3_21)); template.process(parameterValues, stringWriter); } catch (TemplateException | IOException e) { <START> throw new InvalidParameterException(script.getName(), e); <END> } return stringWriter.toString(); }</code><technical_language>Bit specific I think, takes try blocks if want determine step fails (generating template processing parameterValues</technical_language>

Target:
public static String generateScript(Script script, Map<String, Object> parameterValues) { StringWriter stringWriter = new StringWriter(); try { Template template = new Template(null, new StringReader(script.getContent()), new Configuration(Configuration.VERSION_2_3_21)); template.process(parameterValues, stringWriter); } catch (TemplateException e) { throw new InvalidParameterException(script.getName(), e); } catch (IOException e) { throw new TemplateCreationException(script.getName(), e); } return stringWriter.toString(); }
Source:
<code>public List<CssValueNode> getCallResultNodes(List<CssValueNode> cssValueNodes, ErrorManager errorManager) throws GssFunctionException { CssValueNode functionToEval = cssValueNodes.get(0); CssDotPathNode dotPathValue = new CssDotPathNode(functionToEval.getValue(), "", "", functionToEval.getSourceCodeLocation()); <START> JType methodType; <END> try { List<String> parts = dotPathValue.getParts(); methodType = ResourceGeneratorUtil.getMethodByPath(context.getClientBundleType(), parts, null).getReturnType(); } catch (NotFoundException e) { String message = e.getMessage(); errorManager.report(new GssError(message, functionToEval.getSourceCodeLocation())); throw new GssFunctionException(message); } if (!dataResourceType.isAssignableFrom((JClassType) methodType) && !imageResourceType.isAssignableFrom((JClassType) methodType)) { String message = "Invalid method type for url substitution: " + methodType + ". " + "Only DataResource and ImageResource are supported."; errorManager.report(new GssError(message, functionToEval.getSourceCodeLocation())); throw new GssFunctionException(message); } String instance = context.getImplementationSimpleSourceName() + ".this." + dotPathValue.getValue() + ".getSafeUri().asString()"; CssFunctionNode node = GssFunctions.createUrlNode("", functionToEval.getSourceCodeLocation()); CssJavaExpressionNode cssJavaExpressionNode = new CssJavaExpressionNode(instance); CssFunctionArgumentsNode arguments = new CssFunctionArgumentsNode(ImmutableList.<CssValueNode>of(cssJavaExpressionNode)); node.setArguments(arguments); return ImmutableList.of((CssValueNode) node); }</code><technical_language>getMethodType is a good condidate for refactoring in small methods</technical_language>

Target:
public List<CssValueNode> getCallResultNodes(List<CssValueNode> cssValueNodes, ErrorManager errorManager) throws GssFunctionException { CssValueNode functionToEval = cssValueNodes.get(0); String value = functionToEval.getValue(); SourceCodeLocation location = functionToEval.getSourceCodeLocation(); String javaExpression = buildJavaExpression(value, location, errorManager); CssFunctionNode urlNode = buildUrlNode(javaExpression, location); return ImmutableList.<CssValueNode>of(urlNode); }
Source:
<code>private void updateSDCardSwitch(){ final PrefManager prefManager = new PrefManager(getActivity().getBaseContext(), PrefManager.Pref.SD_CARD); if (FileUtil.isRemovableStorageAvailable(getContext())) { mSDCardSwitch.setEnabled(true); mSDCardSwitch.setOnCheckedChangeListener(null); mSDCardSwitch.setChecked(prefManager.getBoolean(PrefManager.Key.DOWNLOAD_TO_SDCARD, true)); if ( !prefManager.contains(PrefManager.Key.DOWNLOAD_TO_SDCARD)){ <START> prefManager.put(PrefManager.Key.DOWNLOAD_TO_SDCARD, true); <END> } mSDCardSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { prefManager.put(PrefManager.Key.DOWNLOAD_TO_SDCARD, isChecked); } }); } else { prefManager.put(PrefManager.Key.DOWNLOAD_TO_SDCARD, false); mSDCardSwitch.setEnabled(false); } }</code><technical_language>Extra new line</technical_language>

Target:
private void updateSDCardSwitch() { final PrefManager prefManager = new PrefManager(getActivity().getBaseContext(), PrefManager.Pref.SD_CARD); if (!environment.getConfig().isSDCardDownloadEnabled()){ sdCardSettinglayout.setVisibility(View.GONE); } else { sdCardSwitch.setOnCheckedChangeListener(null); sdCardSwitch.setChecked(prefManager.getBoolean(PrefManager.Key.DOWNLOAD_TO_SDCARD, true)); sdCardSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { prefManager.put(PrefManager.Key.DOWNLOAD_TO_SDCARD, isChecked); } }); } }
Source:
<code>public Set<ProcessingDetails> getProcessingDetails() { <START> if (details == null) { <END> details = new HashSet<>(); } return details; }</code><technical_language>I setter a more place for this defensive logic</technical_language>

Target:
public Set<ProcessingDetails> getProcessingDetails() { return details; }
Source:
<code>public void newClientCanBeCreated() { PaxosLearner learner = paxosComponents.learner(CLIENT); learner.learn(PAXOS_ROUND_ONE, PAXOS_VALUE); assertThat(learner.getGreatestLearnedValue()) <START> .isPresent() <END> .hasValueSatisfying(paxosValue -> { assertThat(paxosValue.getLeaderUUID()).isEqualTo(PAXOS_UUID); assertThat(paxosValue.getData()).isEqualTo(PAXOS_DATA); }); PaxosAcceptor acceptor = paxosComponents.acceptor(CLIENT); acceptor.accept(PAXOS_ROUND_TWO, PAXOS_PROPOSAL); assertThat(acceptor.getLatestSequencePreparedOrAccepted()).isEqualTo(PAXOS_ROUND_TWO); }</code><technical_language>Call isPresent removed, [hasValueSatisfying](<LINK_0> assert is present</technical_language>

Target:
public void newClientCanBeCreated() { PaxosLearner learner = paxosComponents.learner(CLIENT); learner.learn(PAXOS_ROUND_ONE, PAXOS_VALUE); assertThat(learner.getGreatestLearnedValue()).map(PaxosValue::getLeaderUUID).contains(PAXOS_UUID); assertThat(learner.getGreatestLearnedValue()).map(PaxosValue::getData).contains(PAXOS_DATA); PaxosAcceptor acceptor = paxosComponents.acceptor(CLIENT); acceptor.accept(PAXOS_ROUND_TWO, PAXOS_PROPOSAL); assertThat(acceptor.getLatestSequencePreparedOrAccepted()).isEqualTo(PAXOS_ROUND_TWO); }
Source:
<code>public JNDIObjectLocator build() { Map<String, String> environment; switch (this.environmentKey == null ? 0 : this.environmentKey.size()) { case 0: environment = Collections.emptyMap(); break; case 1: environment = Collections.singletonMap(this.environmentKey.get(0), this.environmentValue.get(0)); break; default: environment = new LinkedHashMap<>(this.environmentKey.size() < 1073741824 ? 1 + this.environmentKey.size() + (this.environmentKey.size() - 3) / 3 : Integer.MAX_VALUE); for (int ii = 0; ii < this.environmentKey.size(); ii++) { environment.put(this.environmentKey.get(ii), this.environmentValue.get(ii)); } environment = unmodifiableMap(environment); } String namespaceValue = this.namespaceValue; <START> if (!this.namespaceSet) { <END> namespaceValue = JNDI.JNDI_NAMESPACE_MODULE; } return new JNDIObjectLocator(environment, namespaceValue, this.noCaching, this.cacheRemote); }</code><technical_language>if (namespaceValue == null)</technical_language>

Target:
public JNDIObjectLocator build() { Map<String, String> environment; switch (this.environmentKeys == null ? 0 : this.environmentKeys.size()) { case 0: environment = Collections.emptyMap(); break; case 1: environment = Collections.singletonMap(this.environmentKeys.get(0), this.environmentValues.get(0)); break; default: environment = new LinkedHashMap<>(this.environmentKeys.size() < 1073741824 ? 1 + this.environmentKeys.size() + (this.environmentKeys.size() - 3) / 3 : Integer.MAX_VALUE); for (int ii = 0; ii < this.environmentKeys.size(); ii++) { environment.put(this.environmentKeys.get(ii), this.environmentValues.get(ii)); } environment = unmodifiableMap(environment); } String namespaceValue = this.namespaceValue; if (!this.namespaceSet) { namespaceValue = JNDI.JNDI_NAMESPACE_MODULE; } return new JNDIObjectLocator(environment, namespaceValue, this.noCaching, this.cacheRemote); }
Source:
<code><START> default String getName() { <END> return this.shadow$getName(); }</code><technical_language>If this is intrinsic, needs prefixed</technical_language>

Target:
default String api$getName() { return this.shadow$getName(); }
Source:
<code>private void writeCatchHandler(ICPPASTCatchHandler catchStatement) { <START> writeAttributes(catchStatement, EnumSet.of(SpaceLocation.AFTER)); <END> scribe.print(CATCH); if (catchStatement.isCatchAll()) { scribe.print(VAR_ARGS); } else { scribe.noSemicolon(); scribe.noNewLines(); catchStatement.getDeclaration().accept(visitor); scribe.newLines(); } scribe.print(')'); writeBodyStatement(catchStatement.getCatchBody(), true); }</code><technical_language>attributes ICPPASTCatchHandler? is a CPPASTAttributeOwner, standard allow for attributes here. [gram.stmt] allows for attribute-specifier-seq try-block [gram.except] allow for attribute-specifier-seq handler-seq handler. a "bug" ICPPASTCatchHandler is a CPPASTAttributeOwner in place</technical_language>

Target:
private void writeCatchHandler(ICPPASTCatchHandler catchStatement) { scribe.print(CATCH); if (catchStatement.isCatchAll()) { scribe.print(VAR_ARGS); } else { scribe.noSemicolon(); scribe.noNewLines(); catchStatement.getDeclaration().accept(visitor); scribe.newLines(); } scribe.print(')'); writeBodyStatement(catchStatement.getCatchBody(), true); }
Source:
<code>public void validate(ValidationContext vCxt, Shape shape, Node focusNode, Path path, Set<Node> pathNodes, Set<Node> compareNodes) { for ( Node vn : pathNodes ) { if ( ! compareNodes.contains(vn) ) { <START> String msg = toString()+": not disjoint: vakue node "+displayStr(vn)+" is not in "+compareNodes; <END> vCxt.builder().addReportEntry(msg, shape, focusNode, path, vn, this); } } for ( Node v : compareNodes ) { if ( ! pathNodes.contains(v) ) { String msg = toString()+": not disjoint: value "+displayStr(v)+" is not in "+pathNodes; vCxt.builder().addReportEntry(msg, shape, focusNode, path, v, this); } } }</code><technical_language>s/vakue/value</technical_language>

Target:
public void validate(ValidationContext vCxt, Shape shape, Node focusNode, Path path, Set<Node> pathNodes, Set<Node> compareNodes) { for ( Node vn : pathNodes ) { if ( ! compareNodes.contains(vn) ) { String msg = toString()+": not disjoint: value node "+displayStr(vn)+" is not in "+compareNodes; vCxt.reportEntry(msg, shape, focusNode, path, vn, this); } } for ( Node v : compareNodes ) { if ( ! pathNodes.contains(v) ) { String msg = toString()+": not disjoint: value "+displayStr(v)+" is not in "+pathNodes; vCxt.reportEntry(msg, shape, focusNode, path, v, this); } } }
Source:
<code>public DbSchedulerAutoConfiguration(DbSchedulerProperties dbSchedulerProperties, <START> DataSource dataSource, List<Task<?>> configuredTasks) { <END> this.config = Objects.requireNonNull(dbSchedulerProperties, "Can't configure DB Scheduler without required configuration"); this.existingDataSource = Objects.requireNonNull(dataSource, "An existing javax.sql.DataSource is required"); this.configuredTasks = Objects.requireNonNull(configuredTasks, "At least one Task must be configured"); }</code><technical_language>this inject instances of Task classpath</technical_language>

Target:
public DbSchedulerAutoConfiguration(DbSchedulerProperties dbSchedulerProperties, DataSource dataSource, List<Task<?>> configuredTasks) { this.config = Objects.requireNonNull(dbSchedulerProperties, "Can't configure db-scheduler without required configuration"); this.existingDataSource = Objects.requireNonNull(dataSource, "An existing javax.sql.DataSource is required"); this.configuredTasks = Objects.requireNonNull(configuredTasks, "At least one Task must be configured"); }
Source:
<code>public AtomicBoolean getCancelFlag(Meta.StatementHandle h) throws NoSuchStatementException { <START> return new AtomicBoolean(); <END> }</code><technical_language>this a worry if, some means, call connection.getCancelFlag(h) for h multiple times end multiple instances? initialize AtomicBoolean StatementHandle itself</technical_language>

Target:
public AtomicBoolean getCancelFlag(Meta.StatementHandle h) throws NoSuchStatementException { AvaticaUtils.upgrade("after dropping JDK 1.7, use Map.computeIfAbsent"); synchronized (flagMap) { AtomicBoolean b = flagMap.get(h.id); if (b == null) { b = new AtomicBoolean(); flagMap.put(h.id, b); } return b; } }
Source:
<code>private void doTestNewSessionRetrieveByTime(final WBORepository repository, final String expectedGUID) { final SuccessCreationDelegate createDelegate = new SuccessCreationDelegate() { @Override public void onSessionCreated(final RepositorySession session) { <START> System.out.println("Session created."); <END> session.begin(new SuccessBeginDelegate() { @Override public void onBeginSucceeded(final RepositorySession session) { session.fetchSince(0, new SuccessFetchDelegate() { @Override public void onFetchedRecord(Record record) { assertEq(expectedGUID, record.guid); } @Override public void onFetchCompleted(long end) { session.finish(new SuccessFinishDelegate() { @Override public void onFinishSucceeded(RepositorySession session, RepositorySessionBundle bundle) { performNotify(); } }); } }); } }); } }; Runnable create = new Runnable() { @Override public void run() { repository.createSession(createDelegate, getApplicationContext()); } }; performWait(create); }</code><technical_language>Log instead? want System.out.println</technical_language>

Target:
private void doTestNewSessionRetrieveByTime(final WBORepository repository, final String expectedGUID) { final SuccessCreationDelegate createDelegate = new SuccessCreationDelegate() { @Override public void onSessionCreated(final RepositorySession session) { Log.i(getName(), "Session created."); session.begin(new SuccessBeginDelegate() { @Override public void onBeginSucceeded(final RepositorySession session) { session.fetchSince(0, new SuccessFetchDelegate() { @Override public void onFetchedRecord(Record record) { assertEq(expectedGUID, record.guid); } @Override public void onFetchCompleted(long end) { session.finish(new SuccessFinishDelegate() { @Override public void onFinishSucceeded(RepositorySession session, RepositorySessionBundle bundle) { performNotify(); } }); } }); } }); } }; Runnable create = new Runnable() { @Override public void run() { repository.createSession(createDelegate, getApplicationContext()); } }; performWait(create); }
Source:
<code>public List<T> getAllValues() { <START> return Arrays.asList((T[]) arguments.toArray()); <END> }</code><technical_language>This feels hacky. I instead update arguments List<T> instead</technical_language>

Target:
public List<T> getAllValues() { readLock.lock(); try { return new ArrayList<T>((List) arguments); } finally { readLock.unlock(); } }
Source:
<code>public void whenSwitchingOnOperationSquareMe_thenWillReturnSquare() { var me = 4; var operation = "squareMe"; var result = switch (operation) { case "doubleMe" -> { yield me * 2; } case "squareMe" -> { yield me * me; } default -> me; }; <START> assertEquals(result, 16); <END> }</code><technical_language>suggestion assertEquals(16, result);</technical_language>

Target:
public void whenSwitchingOnOperationSquareMe_thenWillReturnSquare() { var me = 4; var operation = "squareMe"; var result = switch (operation) { case "doubleMe" -> { yield me * 2; } case "squareMe" -> { yield me * me; } default -> me; }; assertEquals(16, result); }
Source:
<code>@Override public OperationSecurityContext withContext(UUID subjId) { try { ClusterNode node = Optional.ofNullable(ctx.discovery().node(subjId)) .orElseGet(() -> ctx.discovery().historicalNode(subjId)); SecurityContext res = node != null ? secCtxs.computeIfAbsent(subjId, uuid -> nodeSecurityContext(marsh, U.resolveClassLoader(ctx.config()), node)) : secPrc.securityContext(subjId); if (res == null) <START> throw new IllegalStateException("Failed to find security context for subject with given ID : " + subjId); <END> return withContext(res); } catch (Throwable e) { log.error("Failed to obtain a security context.", e); throw e; } }</code><technical_language>point throw Exception catch lines later</technical_language>

Target:
@Override public OperationSecurityContext withContext(UUID subjId) { try { ClusterNode node = Optional.ofNullable(ctx.discovery().node(subjId)) .orElseGet(() -> ctx.discovery().historicalNode(subjId)); SecurityContext res = node != null ? secCtxs.computeIfAbsent(subjId, uuid -> nodeSecurityContext(marsh, U.resolveClassLoader(ctx.config()), node)) : secPrc.securityContext(subjId); if (res != null) return withContext(res); } catch (Throwable e) { log.error(FAILED_OBTAIN_SEC_CTX_MSG, e); throw e; } IllegalStateException error = new IllegalStateException("Failed to find security context " + "for subject with given ID : " + subjId); log.error(FAILED_OBTAIN_SEC_CTX_MSG, error); throw error; }
Source:
<code>private Eh107CacheManager createCacheManager(URI uri, Configuration config, Properties properties) { Eh107CacheLoaderWriterProvider cacheLoaderWriterFactory = new Eh107CacheLoaderWriterProvider(); Object[] serviceCreationConfigurations = config.getServiceCreationConfigurations().toArray(); Jsr107Service jsr107Service = new DefaultJsr107Service(ServiceUtils.findSingletonAmongst(Jsr107Configuration.class, serviceCreationConfigurations)); Collection<Service> services = new ArrayList<>(4); services.add(cacheLoaderWriterFactory); services.add(jsr107Service); if (ServiceUtils.findSingletonAmongst(DefaultSerializationProviderConfiguration.class, serviceCreationConfigurations) == null) { services.add(new DefaultJsr107SerializationProvider()); } org.ehcache.CacheManager ehcacheManager = new EhcacheManager(config, services, !jsr107Service.jsr107CompliantAtomics()); ehcacheManager.init(); return new Eh107CacheManager(this, ehcacheManager, jsr107Service.getStatistics(), properties, config.getClassLoader(), uri, new ConfigurationMerger(config, jsr107Service, cacheLoaderWriterFactory)); <START> } <END></code><technical_language>feels weird pass StatisticsService ehcacheManager is passed it</technical_language>

Target:
private Eh107CacheManager createCacheManager(URI uri, Configuration config, Properties properties) { Eh107CacheLoaderWriterProvider cacheLoaderWriterFactory = new Eh107CacheLoaderWriterProvider(); Collection<ServiceCreationConfiguration<?>> serviceCreationConfigurations = config.getServiceCreationConfigurations(); Jsr107Service jsr107Service = new DefaultJsr107Service(ServiceUtils.findSingletonAmongst(Jsr107Configuration.class, serviceCreationConfigurations)); Collection<Service> services = new ArrayList<>(4); services.add(cacheLoaderWriterFactory); services.add(jsr107Service); if (ServiceUtils.findSingletonAmongst(DefaultSerializationProviderConfiguration.class, serviceCreationConfigurations) == null) { services.add(new DefaultJsr107SerializationProvider()); } org.ehcache.CacheManager ehcacheManager = new EhcacheManager(config, services, !jsr107Service.jsr107CompliantAtomics()); ehcacheManager.init(); return new Eh107CacheManager(this, ehcacheManager, jsr107Service, properties, config.getClassLoader(), uri, new ConfigurationMerger(config, jsr107Service, cacheLoaderWriterFactory)); }
Source:
<code>public void setMultiline(boolean aMultiline) { <START> _multiline = aMultiline; <END> }</code><technical_language>this affect view user is able enter a newline character in text field</technical_language>

Target:
public void setMultiline(boolean aMultiline) { multiline = aMultiline; }
Source:
<code>private void txRemoteNodeFailover() throws Exception { startGrid(1); awaitPartitionMapExchange(); IgniteCache<String, Integer> remoteCache = jcache(1); String remotePrimaryKey = String.valueOf(primaryKey(remoteCache)); assert remotePrimaryKey != null; try { performTransactionFailover(remotePrimaryKey, 1, 0); if (transactionConcurrency.equals(TransactionConcurrency.PESSIMISTIC)) fail("Broken remote node must have caused exception"); } <START> catch (ClusterTopologyCheckedException e) { <END> } boolean txFinished = GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { GridCacheAdapter<?, ?> cache = ((IgniteKernal)ignite(0)).internalCache(DEFAULT_CACHE_NAME); IgniteTxManager txMgr = cache.isNear() ? ((GridNearCacheAdapter)cache).dht().context().tm() : cache.context().tm(); int txNum = txMgr.idMapSize(); return txNum == 0; } }, 10000); assertTrue(txFinished); IgniteCache<String, Integer> localCache = jcache(); if (transactionConcurrency.equals(TransactionConcurrency.OPTIMISTIC)) Assert.assertEquals(1, (long)localCache.get(remotePrimaryKey)); else Assert.assertNull(localCache.get(remotePrimaryKey)); localCache.removeAll(); }</code><technical_language>rename "e" "ignored"</technical_language>

Target:
private void txRemoteNodeFailover() throws Exception { startGrid(1); awaitPartitionMapExchange(); IgniteCache<String, Integer> remoteCache = jcache(1); String remotePrimaryKey = String.valueOf(primaryKey(remoteCache)); assert remotePrimaryKey != null; performTransactionFailover(remotePrimaryKey, 1, 0); waitAllTransactionsHasFinished(); IgniteCache<String, Integer> clientCache = jcache(0); assertEquals(1, (long)clientCache.get(remotePrimaryKey)); clientCache.removeAll(); }
Source:
<code>private static Schema resolveUnion(JsonNode datum, Collection<Schema> schemas) { for (Schema schema : schemas) { switch (schema.getType()) { case RECORD: if (datum.isObject()) { boolean missingField = false; for (Schema.Field field : schema.getFields()) { if (!datum.has(field.name()) && field.defaultValue() == null) { missingField = true; break; } } if (!missingField) { return schema; } } break; case MAP: if (datum.isObject()) { return schema; } break; case ARRAY: if (datum.isArray()) { return schema; } break; case BOOLEAN: if (datum.isBoolean()) { return schema; } break; case FLOAT: if (datum.isFloat() || datum.isInt()) { return schema; } break; case DOUBLE: if (datum.isDouble() || datum.isFloat() || <START> datum.isLong() || datum.isInt()) { <END> return schema; } break; case INT: if (datum.isInt()) { return schema; } break; case LONG: if (datum.isLong() || datum.isInt()) { return schema; } break; case STRING: if (datum.isTextual()) { return schema; } break; case ENUM: if (datum.isTextual() && schema.hasEnumSymbol(datum.textValue())) { return schema; } break; case BYTES: case FIXED: if (datum.isBinary()) { return schema; } break; case NULL: if (datum == null || datum.isNull()) { return schema; } break; default: throw new IllegalArgumentException("Unsupported schema: " + schema); } } throw new DatasetException(String.format( "Cannot resolve union: %s not in %s", datum, schemas)); }</code><technical_language>logic is right here. If I a union of [double, long] in JSON I integral number, expect resolved type of Avro schema long, double. reading of this code, end a double double is listed in union order. I need for schema is value, compatible type</technical_language>

Target:
private static Schema resolveUnion(JsonNode datum, Collection<Schema> schemas) { Set<Schema.Type> primitives = Sets.newHashSet(); List<Schema> others = Lists.newArrayList(); for (Schema schema : schemas) { if (PRIMITIVES.containsKey(schema.getType())) { primitives.add(schema.getType()); } else { others.add(schema); } } Schema primitiveSchema = null; if (datum == null || datum.isNull()) { primitiveSchema = closestPrimitive(primitives, Schema.Type.NULL); } else if (datum.isShort() || datum.isInt()) { primitiveSchema = closestPrimitive(primitives, Schema.Type.INT, Schema.Type.LONG, Schema.Type.FLOAT, Schema.Type.DOUBLE); } else if (datum.isLong()) { primitiveSchema = closestPrimitive(primitives, Schema.Type.LONG, Schema.Type.DOUBLE); } else if (datum.isFloat()) { primitiveSchema = closestPrimitive(primitives, Schema.Type.FLOAT, Schema.Type.DOUBLE); } else if (datum.isDouble()) { primitiveSchema = closestPrimitive(primitives, Schema.Type.DOUBLE); } else if (datum.isBoolean()) { primitiveSchema = closestPrimitive(primitives, Schema.Type.BOOLEAN); } if (primitiveSchema != null) { return primitiveSchema; } for (Schema schema : others) { if (matches(datum, schema)) { return schema; } } throw new DatasetException(String.format( "Cannot resolve union: %s not in %s", datum, schemas)); }
Source:
<code>public void processStreamControl(String exportSource, List<String> exportTargets, OperationMode operation, VoltTable results) { exportLog.info("Export " + operation + " source:" + exportSource + " targets:" + exportTargets); synchronized (m_dataSourcesByPartition) { RealVoltDB volt = (RealVoltDB) VoltDB.instance(); for (Iterator<Integer> partitionIt = m_dataSourcesByPartition.keySet().iterator(); partitionIt.hasNext();) { Integer partition = partitionIt.next(); boolean isLeader = ((SpInitiator)volt.getInitiator(partition)).isLeader(); if (!isLeader) { continue; } Map<String, ExportDataSource> sources = m_dataSourcesByPartition.get(partition); for (Iterator<ExportDataSource> it = sources.values().iterator(); it.hasNext();) { ExportDataSource eds = it.next(); if (!eds.isBlocked() || !eds.isMastershipAccepted()) { continue; } if (!StringUtil.isEmpty(exportSource) && !eds.getTableName().equalsIgnoreCase(exportSource)) { continue; } if (!exportTargets.isEmpty() && !exportTargets.contains(eds.getTarget())) { continue; } <START> eds.processStreamControl(operation); <END> results.addRow(eds.getTableName(), eds.getTarget(), partition, VoltSystemProcedure.STATUS_OK, ""); } } } }</code><technical_language>is exception caught</technical_language>

Target:
public void processStreamControl(String exportSource, List<String> exportTargets, OperationMode operation, VoltTable results) { exportLog.info("Export " + operation + " source:" + exportSource + " targets:" + exportTargets); synchronized (m_dataSourcesByPartition) { RealVoltDB volt = (RealVoltDB) VoltDB.instance(); for (Iterator<Integer> partitionIt = m_dataSourcesByPartition.keySet().iterator(); partitionIt.hasNext();) { Integer partition = partitionIt.next(); boolean isLeader = ((SpInitiator)volt.getInitiator(partition)).isLeader(); if (!isLeader) { continue; } Map<String, ExportDataSource> sources = m_dataSourcesByPartition.get(partition); for (Iterator<ExportDataSource> it = sources.values().iterator(); it.hasNext();) { ExportDataSource eds = it.next(); if (!StringUtil.isEmpty(exportSource) && !eds.getTableName().equalsIgnoreCase(exportSource)) { continue; } if (!exportTargets.isEmpty() && !exportTargets.contains(eds.getTarget())) { continue; } eds.processStreamControl(operation); results.addRow(eds.getTableName(), eds.getTarget(), partition, VoltSystemProcedure.STATUS_OK, ""); } } } }
Source:
<code>public HandlerStatus onRead() { src.flip(); try { if (src.remaining() < PROTOCOL_LENGTH) { return CLEAN; } String protocol = loadProtocol(); if (protocol.equals(supportedProtocol.getDescriptor())) { channel.inboundPipeline().replace(this, inboundHandlers); } else { <START> throw new IllegalStateException("Unsupported protocol exchange detected"); <END> } if (shouldSignalProtocolLoaded()) { encoder.signalProtocolLoaded(); } return CLEAN; } finally { compactOrClear(src); } }</code><technical_language>minor: protocol received in exception message</technical_language>

Target:
public HandlerStatus onRead() { src.flip(); try { if (src.remaining() < PROTOCOL_LENGTH) { return CLEAN; } String protocol = loadProtocol(); if (protocol.equals(supportedProtocol.getDescriptor())) { channel.inboundPipeline().replace(this, inboundHandlers); } else { throw new IllegalStateException("Unsupported protocol exchange detected, " + "expected protocol: " + supportedProtocol.name()); } if (shouldSignalProtocolLoaded()) { encoder.signalProtocolLoaded(); } return CLEAN; } finally { compactOrClear(src); } }