auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void activate(ComponentContext componentContext) { eventHandler = new ThreadedEventHandler(typedEventSubscribers, typedEventFactories, safeCaller); <START> eventSubscriberServiceTracker = new EventSubscriberServiceTracker(componentContext.getBundleContext()); <END> eventSubscriberServiceTracker.open(); }</code><technical_language>Slightly unrelated, refactoring code in this PR: Do happen know, work a service tracker instead of a 0..n dynamic dependency? I especially in light of #4775 wrong here..</technical_language>

Target:
protected void activate(ComponentContext componentContext) { eventHandler = new ThreadedEventHandler(typedEventFactories, safeCaller); eventSubscriberServiceTracker = new EventSubscriberServiceTracker(componentContext.getBundleContext()); eventSubscriberServiceTracker.open(); }
Source:
<code>public void removeBindingProvider(BindingProvider provider) { super.removeBindingProvider(provider); <START> logger.debug("removeBindingProvider: " + Arrays.toString(provider.getItemNames().toArray())); <END> for (String itemName: provider.getItemNames()) { unBindGpioPin((MCP23017BindingProvider) provider, itemName); } }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
public void removeBindingProvider(BindingProvider provider) { super.removeBindingProvider(provider); logger.debug("removeBindingProvider: {}", Arrays.toString(provider.getItemNames().toArray())); for (String itemName : provider.getItemNames()) { unBindGpioPin((MCP23017BindingProvider) provider, itemName); } }
Source:
<code>public static <T, E extends Exception> ListenableFuture<T> maybeLogAsync( CallableCheckedException<ListenableFuture<T>, E> action, BiConsumer<LoggingFunction, Stopwatch> primaryLogger, BiConsumer<LoggingFunction, T> additionalLoggerWithAccessToResult) throws E { ListenableFuture<T> future = action.call(); if (log.isTraceEnabled() || slowlogger.isWarnEnabled()) { Monitor<T> monitor = Monitor.createMonitor( primaryLogger, additionalLoggerWithAccessToResult, slowLogPredicate); Futures.addCallback(future, new FutureCallback<T>() { @Override public void onSuccess(T result) { <START> monitor.registerResult(result); <END> monitor.log(); } @Override public void onFailure(Throwable t) { monitor.registerException(new Exception(t)); monitor.log(); } }, MoreExecutors.directExecutor()); } return future; }</code><technical_language>I this is fine, this change do</technical_language>

Target:
public static <T, E extends Exception> ListenableFuture<T> maybeLogAsync( CallableCheckedException<ListenableFuture<T>, E> action, BiConsumer<LoggingFunction, Stopwatch> primaryLogger, BiConsumer<LoggingFunction, T> additionalLoggerWithAccessToResult) throws E { ListenableFuture<T> future = action.call(); if (log.isTraceEnabled() || slowlogger.isWarnEnabled()) { Monitor<T> monitor = Monitor.createMonitor( primaryLogger, additionalLoggerWithAccessToResult, slowLogPredicate); Futures.addCallback(future, new FutureCallback<T>() { @Override public void onSuccess(@Nullable T result) { monitor.registerResult(result); monitor.log(); } @Override public void onFailure(Throwable t) { monitor.registerException(new Exception(t)); monitor.log(); } }, MoreExecutors.directExecutor()); } return future; }
Source:
<code>public EntitySubnodeDetailAdapter(Context context, Detail detail, List<TreeReference> references, List<Entity<TreeReference>> entities, ListItemViewModifier modifier) { this.context = context; this.detail = detail; this.references = references; this.references = new Vector<>(); this.entities = new Vector<>(); int entityIndex = 0; for (Entity e : entities) { boolean isValid = false; for (int i = 0; i < e.getNumFields(); i++) { if (e.isValidField(i)) { isValid = true; } } if (isValid) { this.entities.add(e); <START> this.references.add(references.get(entityIndex)); <END> } entityIndex++; } }</code><technical_language>isValid boolean needed: if move adds body of e.isValidField(i) conditional break behavior intermediate boolean</technical_language>

Target:
public EntitySubnodeDetailAdapter(Context context, Detail detail, List<TreeReference> references, List<Entity<TreeReference>> entities, ListItemViewModifier modifier) { this.context = context; this.detail = detail; this.modifier = modifier; this.initializeData(references, entities); }
Source:
<code>public PublishingEndPoint getEnabledSendingEndPointByAddress(String address) throws DotDataException { ensureCacheIsLoaded(); List<PublishingEndPoint> allEndPoints = getEndPoints(); String ipOrNetMask; boolean match; for(PublishingEndPoint endPoint : allEndPoints) { ipOrNetMask = endPoint.getAddress(); if (ipOrNetMask.contains("/")) { match = new SubnetUtils(ipOrNetMask).getInfo().isInRange(address); } else { match = isMatchingEndpoint(ipOrNetMask, address); } <START> if(match && endPoint.isEnabled() && endPoint.isSending()) <END> return endPoint; } return null; }</code><technical_language>extract a bit of this, for example create a "boolean isInRange(address, netmask) method" checks if netmask is a netmask in case do range check. move some of responsibility of this method a new method</technical_language>

Target:
public PublishingEndPoint getEnabledSendingEndPointByAddress(String address) throws DotDataException { ensureCacheIsLoaded(); List<PublishingEndPoint> allEndPoints = getEndPoints(); for(PublishingEndPoint endPoint : allEndPoints) { if (validateAddress(address, endPoint.getAddress(), endPoint)) { return endPoint; } } return null; }
Source:
<code>public List<VDS> filter(SchedulingContext context, List<VDS> hosts, VM vm, PerHostMessages messages) { if (vm.getLeaseStorageDomainId() == null) { return hosts; } return hosts.stream() .filter(vds -> { ArrayList<VDSDomainsData> domainsData = resourceManager.getVdsManager(vds.getId()).getDomains(); <START> if (domainsData == null) { <END> log.info("No domain data, skipping host {}", vds.getName()); messages.addMessage(vds.getId(), EngineMessage.ACTION_TYPE_FAILED_VM_LEASE_IS_NOT_READY_FOR_HOST.toString()); return false; } else if (!isVmLeaseReadyForHost(domainsData, vm)) { messages.addMessage(vds.getId(), EngineMessage.ACTION_TYPE_FAILED_VM_LEASE_IS_NOT_READY_FOR_HOST.toString()); return false; } return true; }).collect(Collectors.toList()); }</code><technical_language>merge if, else if condition: if (domainsData == null || !isVmLeaseReadyForHost(domainsData, vm) { ... }</technical_language>

Target:
public List<VDS> filter(SchedulingContext context, List<VDS> hosts, VM vm, PerHostMessages messages) { if (vm.getLeaseStorageDomainId() == null) { return hosts; } return hosts.stream() .filter(vds -> { ArrayList<VDSDomainsData> domainsData = resourceManager.getVdsManager(vds.getId()).getDomains(); if (domainsData == null) { log.debug("No domain data, skipping host {}", vds.getName()); messages.addMessage(vds.getId(), EngineMessage.ACTION_TYPE_FAILED_VM_LEASE_IS_NOT_READY_FOR_HOST.toString()); return false; } else if (!isVmLeaseReadyForHost(domainsData, vm)) { messages.addMessage(vds.getId(), EngineMessage.ACTION_TYPE_FAILED_VM_LEASE_IS_NOT_READY_FOR_HOST.toString()); return false; } return true; }).collect(Collectors.toList()); }
Source:
<code>public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { for (Argument arg : scriptEntry.getProcessedArgs()) { if (!scriptEntry.hasObject("position") && arg.matchesPrefix("position")) { scriptEntry.addObject("position", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("file") && arg.matchesPrefix("file")) { scriptEntry.addObject("file", arg.asElement()); } else if (!scriptEntry.hasObject("cuboid") && arg.matchesPrefix("cuboid")) { scriptEntry.addObject("cuboid", arg.asType(CuboidTag.class)); } else if (!scriptEntry.hasObject("noair") && arg.matches("noair")) { scriptEntry.addObject("noair", new ElementTag(true)); } else if (!scriptEntry.hasObject("undoable") && arg.matches("undoable")) { scriptEntry.addObject("undoable", new ElementTag(true)); } else if (!scriptEntry.hasObject("rotate") && arg.matchesPrefix("rotate")) { scriptEntry.addObject("rotate", arg.asElement()); } else if (!scriptEntry.hasObject("action") && arg.matchesEnum(Action.values())) { scriptEntry.addObject("action", arg.asElement()); } else { arg.reportUnhandled(); } } if (!scriptEntry.hasObject("action")) { throw new InvalidArgumentsException("Action not specified!"); } if (Utilities.entryHasPlayer(scriptEntry)) { <START> scriptEntry.addObject("target", Utilities.getEntryPlayer(scriptEntry)); <END> } }</code><technical_language>is this? If user-specifiable, a script entry object..</technical_language>

Target:
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { for (Argument arg : scriptEntry.getProcessedArgs()) { if (!scriptEntry.hasObject("position") && arg.matchesPrefix("position")) { scriptEntry.addObject("position", arg.asType(LocationTag.class)); } else if (!scriptEntry.hasObject("file") && arg.matchesPrefix("file")) { scriptEntry.addObject("file", arg.asElement()); } else if (!scriptEntry.hasObject("cuboid") && arg.matchesPrefix("cuboid")) { scriptEntry.addObject("cuboid", arg.asType(CuboidTag.class)); } else if (!scriptEntry.hasObject("noair") && arg.matches("noair")) { scriptEntry.addObject("noair", new ElementTag(true)); } else if (!scriptEntry.hasObject("undoable") && arg.matches("undoable")) { scriptEntry.addObject("undoable", new ElementTag(true)); } else if (!scriptEntry.hasObject("rotate") && arg.matchesPrefix("rotate")) { scriptEntry.addObject("rotate", arg.asElement()); } else if (!scriptEntry.hasObject("action") && arg.matchesEnum(Action.values())) { scriptEntry.addObject("action", arg.asElement()); } else { arg.reportUnhandled(); } } if (!scriptEntry.hasObject("action")) { throw new InvalidArgumentsException("Action not specified!"); } }
Source:
<code>private Object readResolve() { if(includeRegex!=null) { try { includePattern = Pattern.compile(includeRegex); } catch (PatternSyntaxException x) { includeRegex = null; OldDataMonitor.report(this, Collections.singleton(x)); } } synchronized(this) { if (jobNames == null) { jobNames = new TreeSet<>(CaseInsensitiveComparator.INSTANCE); } } initColumns(); initJobFilters(); if (statusFilter != null) { <START> jobFilters.add(new StatusFilter(statusFilter)); <END> } return this; }</code><technical_language>This add StatusFilter list minimize behavior changes interactions filters</technical_language>

Target:
private Object readResolve() { if(includeRegex!=null) { try { includePattern = Pattern.compile(includeRegex); } catch (PatternSyntaxException x) { includeRegex = null; OldDataMonitor.report(this, Collections.singleton(x)); } } synchronized(this) { if (jobNames == null) { jobNames = new TreeSet<>(CaseInsensitiveComparator.INSTANCE); } } initColumns(); initJobFilters(); if (statusFilter != null) { jobFilters.add(0, new StatusFilter(statusFilter)); } return this; }
Source:
<code>private final boolean isPasteTriggeredByMiddleClick() { EventData event = history_.findEvent(new JavaScriptEventHistory.Predicate() { @Override public boolean accept(EventData event) { String type = event.getType(); for (String candidate : CANDIDATES) if (type.contentEquals(candidate)) <START> return true; <END> return false; } private final String[] CANDIDATES = new String[] { "mousedown", "click", "mouseup", "keydown", "keypress", "keyup" }; }); if (event == null) return false; String type = event.getType(); return type.equals("mousedown") || type.equals("click") || type.equals("mouseup"); }</code><technical_language>Do need check button triggered event</technical_language>

Target:
private final boolean isPasteTriggeredByMiddleClick() { EventData event = history_.findEvent(new JavaScriptEventHistory.Predicate() { @Override public boolean accept(EventData event) { String type = event.getType(); for (String candidate : CANDIDATES) if (type.contentEquals(candidate)) return true; return false; } private final String[] CANDIDATES = new String[] { "mousedown", "click", "mouseup", "keydown", "keypress", "keyup" }; }); if (event == null) return false; int button = event.getButton(); if (button != Event.BUTTON_MIDDLE) return false; String type = event.getType(); return type.equals("mousedown") || type.equals("click") || type.equals("mouseup"); }
Source:
<code>public void tracingDisabledUpdatesInstantly() { boolean initialTracingDisabled = Boolean.parseBoolean(Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_TRACING_DISABLED)); System.setProperty(Configuration.PROPERTY_AZURE_TRACING_DISABLED, Boolean.toString(!initialTracingDisabled)); assertNotEquals(initialTracingDisabled, Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_TRACING_DISABLED)); <START> System.setProperty(Configuration.PROPERTY_AZURE_TRACING_DISABLED, Boolean.toString(initialTracingDisabled)); <END> }</code><technical_language>I wrap this in a try/finally block, if test fails line 111, this get reset. line 103</technical_language>

Target:
public void tracingDisabledUpdatesInstantly() { boolean initialTracingDisabled = Boolean.parseBoolean(Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_TRACING_DISABLED)); try { System.setProperty(Configuration.PROPERTY_AZURE_TRACING_DISABLED, Boolean.toString(!initialTracingDisabled)); assertNotEquals(initialTracingDisabled, Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_TRACING_DISABLED)); } finally { System.setProperty(Configuration.PROPERTY_AZURE_TRACING_DISABLED, Boolean.toString(initialTracingDisabled)); } }
Source:
<code>private static String normalizePath(final String path) { String s = path; if (s == null || "".equals(s)) { <START> return ""; <END> } int n = 0; for (; n < s.length(); n++) { if (s.charAt(n) != '/') { break; } } if (n > 1) { s = s.substring(n - 1); } if (!s.startsWith("/")) { s = "/" + s; } return s; }</code><technical_language>please TextUtils#isBlank instead of "".equals(s)</technical_language>

Target:
private static String normalizePath(final String path) { String s = path; if (TextUtils.isBlank(s)) { return ""; } int n = 0; for (; n < s.length(); n++) { if (s.charAt(n) != '/') { break; } } if (n > 1) { s = s.substring(n - 1); } if (!s.startsWith("/")) { s = "/" + s; } return s; }
Source:
<code>public boolean isUnifiable(Index index) { return index instanceof TopIndex || equals(index) || (index instanceof KLabelIndex && <START> ((KLabelIndex) index).kLabel().sorts().contains(sort)); <END> }</code><technical_language>question</technical_language>

Target:
public boolean isUnifiable(Index index) { return index instanceof TopIndex || equals(index); }
Source:
<code>private List<StoreKey> deserializeMetadataContent(ByteBuffer metadataContent, StoreKeyFactory storeKeyFactory) throws MessageFormatException, IOException { ByteBufferInputStream byteBufferInputStream = new ByteBufferInputStream(metadataContent); DataInputStream inputStream = new DataInputStream(byteBufferInputStream); short metdataContentVersion = inputStream.readShort(); <START> Assert.assertEquals("Metadata Content Version mismatch ", metdataContentVersion, <END> MessageFormatRecord.Metadata_Content_Version_V1); return MessageFormatRecord.Metadata_Content_Format_V1.deserializeMetadataContentRecord(inputStream, storeKeyFactory); }</code><technical_language>flip</technical_language>

Target:
private List<StoreKey> deserializeMetadataContent(ByteBuffer metadataContent, StoreKeyFactory storeKeyFactory) throws MessageFormatException, IOException { ByteBufferInputStream byteBufferInputStream = new ByteBufferInputStream(metadataContent); DataInputStream inputStream = new DataInputStream(byteBufferInputStream); short metdataContentVersion = inputStream.readShort(); Assert.assertEquals("Metadata Content Version mismatch ", MessageFormatRecord.Metadata_Content_Version_V1, metdataContentVersion); return MessageFormatRecord.Metadata_Content_Format_V1 .deserializeMetadataContentRecord(inputStream, storeKeyFactory); }
Source:
<code>void updateData(List<Podcast> result) { this.searchResults = result; adapter.clear(); if (result != null && result.size() > 0) { gridView.setVisibility(View.VISIBLE); txtvEmpty.setVisibility(View.GONE); <START> adapter.addAll(result); <END> adapter.notifyDataSetInvalidated(); } else { gridView.setVisibility(View.GONE); txtvEmpty.setVisibility(View.VISIBLE); } }</code><technical_language>Call requires API level 11 (we 10)</technical_language>

Target:
void updateData(List<Podcast> result) { this.searchResults = result; adapter.clear(); if (result != null && result.size() > 0) { gridView.setVisibility(View.VISIBLE); txtvEmpty.setVisibility(View.GONE); for (Podcast p : result) { adapter.add(p); } adapter.notifyDataSetInvalidated(); } else { gridView.setVisibility(View.GONE); txtvEmpty.setVisibility(View.VISIBLE); } }
Source:
<code>public SingleServerAppliance getImage(String id) { logger.trace("<< searching for image with id=%s", id); GenericQueryOptions options = new GenericQueryOptions(); options.options(0, 0, null, id, null); try { List<ServerAppliance> list = api.serverApplianceApi().list(options); if (list.size() > 0) { ServerAppliance appliance = list.get(0); List<SingleServerAppliance.AvailableDataCenters> availableDatacenters = new ArrayList<SingleServerAppliance.AvailableDataCenters>(); for (String dcId : appliance.availableDataCenters()) { availableDatacenters.add(SingleServerAppliance.AvailableDataCenters.create(dcId, "")); } SingleServerAppliance image = SingleServerAppliance.create(appliance.id(), appliance.name(), availableDatacenters, appliance.osInstallationBase(), appliance.osFamily(), appliance.os(), appliance.osVersion(), appliance.osArchitecture(), appliance.osImageType(), appliance.minHddSize(), appliance.type(), appliance.state(), appliance.version(), appliance.categories(), appliance.eulaUrl()); <START> if (image != null) { <END> logger.trace(">> found image [%s].", image.name()); return image; } } } catch (Exception ex) { throw new ResourceNotFoundException("No image with id '" + id + "' was found"); } throw new ResourceNotFoundException("No image with id '" + id + "' was found"); }</code><technical_language>This check is redundant</technical_language>

Target:
public SingleServerAppliance getImage(String id) { logger.trace("<< searching for image with id=%s", id); GenericQueryOptions options = new GenericQueryOptions(); options.options(0, 0, null, id, null); try { List<ServerAppliance> list = api.serverApplianceApi().list(options); if (list.size() > 0) { ServerAppliance appliance = list.get(0); List<SingleServerAppliance.AvailableDataCenters> availableDatacenters = new ArrayList<SingleServerAppliance.AvailableDataCenters>(); for (String dcId : appliance.availableDataCenters()) { availableDatacenters.add(SingleServerAppliance.AvailableDataCenters.create(dcId, "")); } SingleServerAppliance image = SingleServerAppliance.create(appliance.id(), appliance.name(), availableDatacenters, appliance.osInstallationBase(), appliance.osFamily(), appliance.os(), appliance.osVersion(), appliance.osArchitecture(), appliance.osImageType(), appliance.minHddSize(), appliance.type(), appliance.state(), appliance.version(), appliance.categories(), appliance.eulaUrl()); logger.trace(">> found image [%s].", image.name()); return image; } } catch (Exception ex) { throw new ResourceNotFoundException("No image with id '" + id + "' was found"); } throw new ResourceNotFoundException("No image with id '" + id + "' was found"); }
Source:
<code>public AsyncExecutorService(Elide elide, Integer threadPoolSize, Integer maxRunTime, AsyncQueryDAO asyncQueryDao) { this.elide = elide; this.runner = new QueryRunner(elide); this.maxRunTime = maxRunTime; <START> executor = AsyncExecutorService.getInstance(threadPoolSize == null ? DEFAULT_THREADPOOL_SIZE : threadPoolSize).getExecutorService(); <END> interruptor = AsyncExecutorService.getInstance(threadPoolSize == null ? DEFAULT_THREADPOOL_SIZE : threadPoolSize).getInterruptorService(); this.asyncQueryDao = asyncQueryDao; }</code><technical_language>This wrong me. A constructor call a factory method itself. eliminate singletons</technical_language>

Target:
private AsyncExecutorService(Elide elide, Integer threadPoolSize, Integer maxRunTime, AsyncQueryDAO asyncQueryDao) { this.elide = elide; this.runner = new QueryRunner(elide); this.maxRunTime = maxRunTime; executor = Executors.newFixedThreadPool(threadPoolSize == null ? defaultThreadpoolSize : threadPoolSize); interruptor = Executors.newFixedThreadPool(threadPoolSize == null ? defaultThreadpoolSize : threadPoolSize); this.asyncQueryDao = asyncQueryDao; }
Source:
<code>public void run() { if (!isEnabled()) { return; } TaskContainmentHierarchyFacade facade = createContainmentFacade(); for (Task t : facade.getTasksInDocumentOrder()) { <START> if (facade.getDepth(t) == 0) { <END> run(t); } } }</code><technical_language>algorithm is top-down, remove this loop completely root task facade</technical_language>

Target:
public void run() { if (!isEnabled()) { return; } TaskContainmentHierarchyFacade facade = createContainmentFacade(); recalculateSupertaskCompletionPercentage(facade.getRootTask(), facade); }
Source:
<code>default Instant getClaimAsInstant(String claim) { if (!this.containsClaim(claim)) { return null; } Object claimValue = this.getClaims().get(claim); if (Long.class.isAssignableFrom(claimValue.getClass()) || Integer.class.isAssignableFrom(claimValue.getClass()) || Double.class.isAssignableFrom(claimValue.getClass())) { return Instant.ofEpochSecond(((Number) claimValue).longValue()); } if (Date.class.isAssignableFrom(claimValue.getClass())) { return ((Date) claimValue).toInstant(); } if (Instant.class.isAssignableFrom(claimValue.getClass())) { return (Instant) claimValue; } if (String.class.isAssignableFrom(claimValue.getClass())) { try { <START> return Instant.parse((String) claimValue); <END> } catch(DateTimeParseException e){ throw new IllegalArgumentException("Unable to convert claim '" + claim + "' from string '" + claimValue + "' to Instant."); } } throw new IllegalArgumentException("Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to Instant."); }</code><technical_language>Instead of Instant.parse() attempt of these: ZonedDateTime.parse(claimValue, DateTimeFormatter.ISO_INSTANT) ZonedDateTime.parse(claimValue, DateTimeFormatter.ISO_ZONED_DATE_TIME) If of do parse previous (existing) parse attempts throwing IllegalArgumentException is current behaviour. I I I agreed throw for getters, this is a special case IMO. If claim exists, is case if parse attempt proceed return null basically silently ignoring error _existing_ claim. This bigger issues for user tracking root issue more difficult</technical_language>

Target:
default Instant getClaimAsInstant(String claim) { if (!this.containsClaim(claim)) { return null; } Object claimValue = this.getClaims().get(claim); if (Long.class.isAssignableFrom(claimValue.getClass()) || Integer.class.isAssignableFrom(claimValue.getClass()) || Double.class.isAssignableFrom(claimValue.getClass())) { return Instant.ofEpochSecond(((Number) claimValue).longValue()); } if (Date.class.isAssignableFrom(claimValue.getClass())) { return ((Date) claimValue).toInstant(); } if (Instant.class.isAssignableFrom(claimValue.getClass())) { return (Instant) claimValue; } if (String.class.isAssignableFrom(claimValue.getClass())) { try { return Instant.from(DateTimeFormatter.ISO_INSTANT.parse((String)claimValue)); } catch(DateTimeParseException e){ try { return ZonedDateTime.from(DateTimeFormatter.ISO_ZONED_DATE_TIME.parse((String)claimValue)) .toInstant(); } catch(DateTimeParseException e2){ throw new IllegalArgumentException("Unable to convert claim '" + claim + "' from string '" + claimValue + "' to Instant."); } } } throw new IllegalArgumentException("Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to Instant."); }
Source:
<code>public void setValue(ProjectAccess value) { if (editing && value.isOwnerOf(AccessSection.GLOBAL_CAPABILITIES) && value.getLocal(AccessSection.GLOBAL_CAPABILITIES) == null) { value.getLocal().add(0, new AccessSection(AccessSection.GLOBAL_CAPABILITIES)); } this.value = value; List<Project.NameKey> parents = value.getInheritsFrom(); if (parents != null && parents.size() > 0) { inheritsFrom.getStyle().setDisplay(Display.BLOCK); String text = new String(); for (int i = 0; i < parents.size(); i++) { text += parents.get(i).get(); if (i + 1 < parents.size()) text += ", "; <START> } <END> parentProject.setText(text); parentProject.setTargetHistoryToken( Dispatcher.toProjectAdmin(parents.get(0), ProjectScreen.ACCESS)); } else { inheritsFrom.getStyle().setDisplay(Display.NONE); } final GitwebLink c = Gerrit.getGitwebLink(); if (value.isConfigVisible() && c != null) { history.getStyle().setDisplay(Display.BLOCK); gitweb.setText(c.getLinkName()); gitweb.setHref(c.toFileHistory(new Branch.NameKey(value.getProjectName(), "refs/meta/config"), "project.config")); } else { history.getStyle().setDisplay(Display.NONE); } addSection.setVisible(value != null && editing && (!value.getOwnerOf().isEmpty() || value.canUpload())); }</code><technical_language>Ah, thanks. I suggest org.apache.commons.lang.StringUtils GWT-compatible</technical_language>

Target:
public void setValue(ProjectAccess value) { if (editing && value.isOwnerOf(AccessSection.GLOBAL_CAPABILITIES) && value.getLocal(AccessSection.GLOBAL_CAPABILITIES) == null) { value.getLocal().add(0, new AccessSection(AccessSection.GLOBAL_CAPABILITIES)); } this.value = value; List<Project.NameKey> parents = value.getInheritsFrom(); if (parents != null && parents.size() > 0) { inheritsFrom.getStyle().setDisplay(Display.BLOCK); String text = new String(parents.get(0).get()); for (int i = 1; i < parents.size(); i++) { text += ", " + parents.get(i).get(); } parentProject.setText(text); parentProject.setTargetHistoryToken( Dispatcher.toProjectAdmin(parents.get(0), ProjectScreen.ACCESS)); } else { inheritsFrom.getStyle().setDisplay(Display.NONE); } final GitwebLink c = Gerrit.getGitwebLink(); if (value.isConfigVisible() && c != null) { history.getStyle().setDisplay(Display.BLOCK); gitweb.setText(c.getLinkName()); gitweb.setHref(c.toFileHistory(new Branch.NameKey(value.getProjectName(), "refs/meta/config"), "project.config")); } else { history.getStyle().setDisplay(Display.NONE); } addSection.setVisible(value != null && editing && (!value.getOwnerOf().isEmpty() || value.canUpload())); }
Source:
<code>public void testUrlWithSchema() throws Exception { String url = "jdbc:splice://localhost:1527/splicedb;create=true;user=%s;password=%s;schema=" <START> + CLASS_NAME; <END> try (Connection connection = SpliceNetConnection.getConnectionAs(url, SpliceNetConnection.DEFAULT_USER, SpliceNetConnection.DEFAULT_USER_PASSWORD)) { try (Statement statement = connection.createStatement()) { statement.executeQuery("select * from a"); } } }</code><technical_language>I attribute "create=true" put in test case, is time create database</technical_language>

Target:
public void testUrlWithSchema() throws Exception { String url = "jdbc:splice://localhost:1527/splicedb;user=%s;password=%s;schema=" + CLASS_NAME; try (Connection connection = SpliceNetConnection.getConnectionAs(url, SpliceNetConnection.DEFAULT_USER, SpliceNetConnection.DEFAULT_USER_PASSWORD)) { try (Statement statement = connection.createStatement()) { statement.executeQuery("select * from a"); } } }
Source:
<code>protected void setUp() throws Exception { super.setUp(); genericSetUp(TEST_SEMANTIC_MODEL_PATH, MODELER_PATH); initViewpoint(DESIGN_VIEWPOINT_NAME); TestsUtil.emptyEventsFromUIThread(); <START> } <END></code><technical_language>test is OK shoulf fail code fix is merged</technical_language>

Target:
protected void setUp() throws Exception { super.setUp(); genericSetUp(TEST_SEMANTIC_MODEL_PATH, MODELER_PATH); initViewpoint(DESIGN_VIEWPOINT_NAME); TestsUtil.emptyEventsFromUIThread(); backedUpValue = TestsUtil.isCreateRepresentationInSeparateResource(); }
Source:
<code><START> private void updatePresenceStatusForXmppProvider( <END> ProtocolProviderService pps) { SipGateway sipGateway= ServiceUtils.getService( osgiContext, SipGateway.class); TranscriptionGateway transcriptionGateway = ServiceUtils.getService( osgiContext, TranscriptionGateway.class); int participants = 0; int sessions = 0; if(sipGateway != null) { for(SipGatewaySession ses : sipGateway.getActiveSessions()) { participants += ses.getJvbChatRoom().getMembersCount(); sessions++; } } if(transcriptionGateway != null) { for(TranscriptionGatewaySession ses : transcriptionGateway.getActiveSessions()) { participants += ses.getJvbChatRoom().getMembersCount(); sessions++; } } updatePresenceStatusForXmppProvider(pps, participants, sessions); }</code><technical_language>Ugh. do updatePresenceStatusForXmppProvider(pps) updatePresenceStatusForXmppProviders() implement logic twice? :/ I related PR, I expect fix</technical_language>

Target:
private void updatePresenceStatusForXmppProvider( ProtocolProviderService pps) { SipGateway sipGateway= ServiceUtils.getService( osgiContext, SipGateway.class); TranscriptionGateway transcriptionGateway = ServiceUtils.getService( osgiContext, TranscriptionGateway.class); List<AbstractGatewaySession> sessions = new ArrayList<>(); if(sipGateway != null) { sessions.addAll(sipGateway.getActiveSessions()); } if(transcriptionGateway != null) { sessions.addAll(transcriptionGateway.getActiveSessions()); } int sesCount = 0; int participantCount = 0; for(AbstractGatewaySession ses : sessions) { ChatRoom room = ses.getJvbChatRoom(); if(room != null) { participantCount += ses.getJvbChatRoom().getMembersCount(); sesCount++; } else { logger.warn("non-active session in active session list"); } } updatePresenceStatusForXmppProvider(pps, participantCount, sesCount); }
Source:
<code>protected void configureServlets() { Map<String, String> loggingFilterConfig = new HashMap<>(); loggingFilterConfig.put("header.name", "x-candlepin-request-uuid"); String regex = ".*"; if (config.getBoolean(ConfigProperties.TOKEN_ENABLED)) { regex = "^(?!/docs|/token).*"; filterRegex(regex).through(CandlepinScopeFilter.class); filterRegex(regex).through(CandlepinPersistFilter.class); filterRegex(regex).through(LoggingFilter.class, loggingFilterConfig); filterRegex(regex).through(EventFilter.class); } <START> else if (config.getBoolean(ConfigProperties.TOKEN_ENABLED)) { <END> regex = "^(?!/docs).*"; filterRegex(regex).through(CandlepinScopeFilter.class); filterRegex(regex).through(CandlepinPersistFilter.class); filterRegex(regex).through(LoggingFilter.class, loggingFilterConfig); filterRegex(regex).through(EventFilter.class); } else { regex = "^(?!/token).*"; } serveRegex(regex).with(HttpServletDispatcher.class); }</code><technical_language>This is condition check</technical_language>

Target:
protected void configureServlets() { Map<String, String> loggingFilterConfig = new HashMap<>(); loggingFilterConfig.put("header.name", "x-candlepin-request-uuid"); String regex = ".*"; if (config.getBoolean(ConfigProperties.TOKENPAGE_ENABLED) && config.getBoolean(ConfigProperties.SWAGGER_ENABLED)) { regex = "^(?!/docs|/token).*"; } else if (config.getBoolean(ConfigProperties.SWAGGER_ENABLED)) { regex = "^(?!/docs).*"; } else if (config.getBoolean(ConfigProperties.TOKENPAGE_ENABLED)) { regex = "^(?!/token).*"; } filterRegex(regex).through(CandlepinScopeFilter.class); filterRegex(regex).through(CandlepinPersistFilter.class); filterRegex(regex).through(LoggingFilter.class, loggingFilterConfig); filterRegex(regex).through(EventFilter.class); serveRegex(regex).with(HttpServletDispatcher.class); }
Source:
<code>private void validateSortingPath(Path path, Set<String> allFields) { List<Path.PathElement> pathElemenets = path.getPathElements(); if (pathElemenets.size() > 2) { throw new UnsupportedOperationException( "Currently sorting on double nested fields is not supported"); } Path.PathElement currentElement = pathElemenets.get(0); String currentField = currentElement.getFieldName(); Class<?> currentClass = currentElement.getType(); if (!allFields.stream().anyMatch(field -> field.equals(currentField))) { throw new InvalidOperationException("Can't sort on " + currentField + " as it is not present in query"); } <START> if (dictionary.getIdFieldName(currentClass).equals(currentField) <END> || currentField.equals(EntityDictionary.REGULAR_ID_NAME)) { throw new InvalidOperationException("Sorting on id field is not permitted"); } }</code><technical_language>flip this expression dictionary.getIdFieldName(currentClass).equals(currentField) avoid case getIdFieldName() returns null</technical_language>

Target:
private void validateSortingPath(Path path, Set<String> allFields) { List<Path.PathElement> pathElemenets = path.getPathElements(); if (pathElemenets.size() > 2) { throw new UnsupportedOperationException( "Currently sorting on double nested fields is not supported"); } Path.PathElement currentElement = pathElemenets.get(0); String currentField = currentElement.getFieldName(); Class<?> currentClass = currentElement.getType(); if (!allFields.stream().anyMatch(field -> field.equals(currentField))) { throw new InvalidOperationException("Can't sort on " + currentField + " as it is not present in query"); } if (currentField.equals(dictionary.getIdFieldName(currentClass)) || currentField.equals(EntityDictionary.REGULAR_ID_NAME)) { throw new InvalidOperationException("Sorting on id field is not permitted"); } }
Source:
<code>private EdgeMapping createEdgeMappingInheritance(Layer layer, ToolSection toolSection, ContainerMapping classMapping) { EdgeMapping edgeMappingInheritance = DescriptionFactory.eINSTANCE.createEdgeMapping(); EdgeStyleDescription edgeStyleI = StyleFactory.eINSTANCE.createEdgeStyleDescription(); edgeMappingInheritance.setName(BASE_ID + ".edge.inheritance"); edgeMappingInheritance.setLabel("Inheritance"); edgeStyleI.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); edgeMappingInheritance.setStyle(edgeStyleI); edgeMappingInheritance.getSourceMapping().add(classMapping); edgeMappingInheritance.getTargetMapping().add(classMapping); layer.getEdgeMappings().add(edgeMappingInheritance); EdgeCreationDescription edgeCreationDescription = ToolFactory.eINSTANCE.createEdgeCreationDescription(); <START> edgeCreationDescription.setName(BASE_ID + ".package.toolsection.containerEdgeMappingInheritance"); <END> edgeCreationDescription.setLabel("Container EdgeMapping Inheritance"); edgeCreationDescription.getEdgeMappings().add(edgeMappingInheritance); toolSection.getOwnedTools().add(edgeCreationDescription); return edgeMappingInheritance; }</code><technical_language>".edge.inheritance.creation"</technical_language>

Target:
private EdgeMapping createEdgeMappingInheritance(Layer layer, ToolSection toolSection, ContainerMapping classMapping) { EdgeMapping edgeMappingInheritance = DescriptionFactory.eINSTANCE.createEdgeMapping(); EdgeStyleDescription edgeStyleI = StyleFactory.eINSTANCE.createEdgeStyleDescription(); edgeMappingInheritance.setName(BASE_ID + ".edge.inheritance"); edgeMappingInheritance.setLabel("Inheritance"); edgeStyleI.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); edgeMappingInheritance.setStyle(edgeStyleI); edgeMappingInheritance.getSourceMapping().add(classMapping); edgeMappingInheritance.getTargetMapping().add(classMapping); layer.getEdgeMappings().add(edgeMappingInheritance); EdgeCreationDescription edgeCreationDescription = ToolFactory.eINSTANCE.createEdgeCreationDescription(); edgeCreationDescription.setName(BASE_ID + ".edge.inheritance.creation"); edgeCreationDescription.setLabel("Inheritance"); edgeCreationDescription.getEdgeMappings().add(edgeMappingInheritance); toolSection.getOwnedTools().add(edgeCreationDescription); return edgeMappingInheritance; }
Source:
<code>public @ResponseBody boolean addTeamToTournament( HttpSession session, @PathVariable int id, @RequestParam(value = "teamName") String teamName, @RequestParam(value = "acceptFreeAgents") boolean acceptFreeAgents, @RequestParam(value = "teamLeaderId") int teamLeaderId) { Member me = (Member) session.getAttribute("member"); if(me == null) { return false; } TournamentDao tournamentDao = new TournamentDao(); Tournament tournament = tournamentDao.getTournamentById(id, false, true); Team team = new Team(); team.setName(teamName); team.setAcceptFreeAgents(acceptFreeAgents); team.setTournament(tournament); team.setTeamLeader(me); TeamDao teamDao = new TeamDao(); teamDao.saveTeam(team); tournament.addTeam(team); tournamentDao.saveTournament(tournament); MessageDao messageDao = new MessageDao(); <START> for (Member player : team.getPlayers()) <END> messageDao.notify(player, team.getName() + " team was added to " + tournament.getName()); return true; }</code><technical_language>I impossible for people other team leader team this point, loop unnecessary</technical_language>

Target:
public @ResponseBody boolean addTeamToTournament( HttpSession session, @PathVariable int id, @RequestParam(value = "teamName") String teamName, @RequestParam(value = "acceptFreeAgents") boolean acceptFreeAgents, @RequestParam(value = "teamLeaderId") int teamLeaderId) { Member me = (Member) session.getAttribute("member"); if (me == null) { return false; } TournamentDao tournamentDao = new TournamentDao(); Tournament tournament = tournamentDao.getTournamentById(id, false, true); Team team = new Team(); team.setName(teamName); team.setAcceptFreeAgents(acceptFreeAgents); team.setTournament(tournament); team.setTeamLeader(me); TeamDao teamDao = new TeamDao(); teamDao.saveTeam(team); tournament.addTeam(team); tournamentDao.saveTournament(tournament); return true; }
Source:
<code>private Collection<String> discover(BeanDiscoveryMode beanDiscoveryMode, URL beansXmlUrl, URL indexUrl, Set<AnnotationType> beanDefiningAnnotations) { List<String> discoveredClasses = new ArrayList<String>(); BiConsumer<String, ClassFile> consumer; if (BeanDiscoveryMode.ANNOTATED.equals(beanDiscoveryMode)) { Index index = tryLoadIndex(indexUrl); if (index != null) { consumer = (name, classFile) -> { ClassInfo classInfo = index.getClassByName(DotName.createSimple(name)); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } }; } else { Indexer indexer = new Indexer(); consumer = (name, classFile) -> { try { <START> ClassInfo classInfo = indexer.index(classFile.openStream()); <END> if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } } catch (IOException e) { WeldLogger.DEPLOYMENT_LOGGER.cannotIndexClassName(name, beansXmlUrl); } }; } } else { consumer = (name, classFile) -> discoveredClasses.add(name); } UrlScanner scanner = new UrlScanner(beansXmlUrl, consumer); return scanner.scan() ? discoveredClasses : null; }</code><technical_language>this stream is closed</technical_language>

Target:
private Collection<String> discover(BeanDiscoveryMode beanDiscoveryMode, URL beansXmlUrl, URL indexUrl, Set<AnnotationType> beanDefiningAnnotations) { List<String> discoveredClasses = new ArrayList<String>(); BiConsumer<String, ClassFile> consumer; if (BeanDiscoveryMode.ANNOTATED.equals(beanDiscoveryMode)) { Index index = tryLoadIndex(indexUrl); if (index != null) { consumer = (name, classFile) -> { ClassInfo classInfo = index.getClassByName(DotName.createSimple(name)); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } }; } else { Indexer indexer = new Indexer(); consumer = (name, classFile) -> { try (InputStream in = classFile.openStream()) { ClassInfo classInfo = indexer.index(in); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } } catch (IOException e) { WeldLogger.DEPLOYMENT_LOGGER.cannotIndexClassName(name, beansXmlUrl); } }; } } else { consumer = (name, classFile) -> discoveredClasses.add(name); } UrlScanner scanner = new UrlScanner(beansXmlUrl, consumer); return scanner.scan() ? discoveredClasses : null; }
Source:
<code>public void patientVoided(Patient patient) throws APIException { List<Cohort> cohorts = Context.getCohortService().getCohortsContainingPatient(patient); for (Cohort cohort : cohorts) { List<CohortMembership> membersWithPatient = cohort.getMembers().stream() .filter(m -> m.getPatient().equals(patient)) .collect(Collectors.toList()); <START> membersWithPatient.forEach(m -> m.setVoided(patient.getVoided())); <END> } }</code><technical_language>instead call cohort.removePatient(Patient) save</technical_language>

Target:
public void patientVoided(Patient patient) throws APIException { List<Cohort> cohorts = Context.getCohortService().getCohortsContainingPatient(patient); for (Cohort cohort : cohorts) { List<CohortMembership> membersToVoid = cohort.getMembers().stream() .filter(m -> !m.getVoided() && patient.getVoided() && m.getPatient().getPatientId().equals(patient.getPatientId())) .collect(Collectors.toList()); for (CohortMembership member : membersToVoid) { member.setVoided(patient.getVoided()); member.setDateVoided(patient.getDateVoided()); member.setVoidedBy(patient.getVoidedBy()); member.setVoidReason(patient.getVoidReason()); } cohort.removeMember(patient); Context.getCohortService().saveCohort(cohort); } }
Source:
<code><START> public static void refreshPackages(Bundle[] bundles) { <END> FrameworkWiring wiring = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class); wiring.refreshBundles(asList(bundles)); }</code><technical_language>This method is longer waiting for refresh operation complete. if is important for test flow not</technical_language>

Target:
public static void refreshPackages(Bundle[] bundles) { FrameworkWiring wiring = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class); final boolean[] flag = new boolean[] { false }; FrameworkListener listener = event -> { if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) { synchronized (flag) { flag[0] = true; flag.notifyAll(); } } }; context.addFrameworkListener(listener); wiring.refreshBundles(asList(bundles)); synchronized (flag) { while (!flag[0]) { try { flag.wait(); } catch (InterruptedException e) { } } } context.removeFrameworkListener(listener); }
Source:
<code>private String insertSQL(SafeAppendable builder) { sqlClause(builder, "INSERT INTO", tables, "", "", ""); sqlClause(builder, "", columns, "(", ")", ", "); for (int i = 0; i < values.size(); i++) { String keyword = ""; String close = "),"; if(i == 0){ keyword = "VALUES"; } if(i == values.size() - 1){ close = ")"; } sqlClause(builder, keyword, values.get(i), "(", close, ", "); <START> } <END> return builder.toString(); }</code><technical_language>for loop simpler. java for (int i = 0 ; i < values.size(); i++) { sqlClause(builder, i > 0 ? "," : "VALUES", values.get(i), "(", ")", ", "); }</technical_language>

Target:
private String insertSQL(SafeAppendable builder) { sqlClause(builder, "INSERT INTO", tables, "", "", ""); sqlClause(builder, "", columns, "(", ")", ", "); for (int i = 0; i < valuesList.size(); i++) { sqlClause(builder, i > 0 ? "," : "VALUES", valuesList.get(i), "(", ")", ", "); } return builder.toString(); }
Source:
<code><START> public KubernetesCloud getCloud() { <END> Cloud cloud = Jenkins.getInstance().getCloud(getCloudName()); if (cloud instanceof KubernetesCloud) { return (KubernetesCloud) cloud; } else { throw new IllegalStateException(getClass().getName() + " can be launched only by instances of " + KubernetesCloud.class.getName()); } }</code><technical_language>I admit I understand enough this, this a binary compatibility issue</technical_language>

Target:
public Cloud getCloud() { return Jenkins.getInstance().getCloud(getCloudName()); }
Source:
<code>public void testGetProtection() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); GHBranchProtection protectionTest = repo.getBranch(BRANCH).getProtection(); assertTrue(protectionTest instanceof GHBranchProtection); <START> } <END></code><technical_language>GitHub is protected. data files show that</technical_language>

Target:
public void testGetProtection() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); GHBranchProtection protectionTest = repo.getBranch(BRANCH).getProtection(); assertTrue(protectionTest instanceof GHBranchProtection); assertTrue(repo.getBranch(BRANCH).isProtected()); }
Source:
<code><START> public boolean equals(final Object o) { <END> if (this == o) { return true; } if (!(o instanceof AbstractToolbarItem)) { return false; } AbstractToolbarItem that = (AbstractToolbarItem) o; return uuid.equals(that.uuid); }</code><technical_language>Missing hashCode method</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof AbstractToolbarItem)) { return false; } final AbstractToolbarItem that = (AbstractToolbarItem) o; return uuid.equals(that.uuid); }
Source:
<code><START> public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict( <END> C condition, ConditionAwareTransactionTask<T, C, E> task) throws E, TransactionFailedRetriableException { checkOpen(); RawTransaction tx = setupRunTaskWithConditionThrowOnConflict(condition); return finishRunTaskWithLockThrowOnConflict(tx, transaction -> task.execute(transaction, condition)); }</code><technical_language>I this break a lot of products. Instead of changing interface, add more method PreCommitCondition</technical_language>

Target:
public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E, TransactionFailedRetriableException { checkOpen(); try { RawTransaction tx = setupRunTaskWithConditionThrowOnConflict(condition); return finishRunTaskWithLockThrowOnConflict(tx, transaction -> task.execute(transaction, condition)); } finally { condition.cleanup(); } }
Source:
<code>public FeedbackRubricQuestionDetails() { super(FeedbackQuestionType.RUBRIC); this.hasAssignedWeights = false; this.rubricWeights = new ArrayList<>(); this.numOfRubricChoices = 0; this.rubricChoices = new ArrayList<>(); this.numOfRubricSubQuestions = 0; this.rubricSubQuestions = new ArrayList<>(); this.initializeRubricDescriptions(); <START> this.initializeRubricWeights(); <END> }</code><technical_language>initialise rubricWeightsForEachCell empty 2d list enough</technical_language>

Target:
public FeedbackRubricQuestionDetails() { super(FeedbackQuestionType.RUBRIC); this.hasAssignedWeights = false; this.rubricWeights = new ArrayList<>(); this.numOfRubricChoices = 0; this.rubricChoices = new ArrayList<>(); this.numOfRubricSubQuestions = 0; this.rubricSubQuestions = new ArrayList<>(); this.initializeRubricDescriptions(); this.rubricWeightsForEachCell = new ArrayList<>(); }
Source:
<code>private void onNext() { if (mClientCertificateCheckBox.isChecked()) { onManualSetup(); return; } String email = mEmailView.getText().toString(); ConnectionSettings connectionSettings = providersXmlDiscovery.discover(email); <START> if (connectionSettings == null) { <END> connectionSettings = srvServiceDiscovery.discover(email); } if (connectionSettings != null) { finishAutoSetup(connectionSettings); } else { onManualSetup(); } }</code><technical_language>ThunderbirdDiscovery, I want this yet. Please leave AccountSetupBasics unchanged</technical_language>

Target:
private void onNext() { if (mClientCertificateCheckBox.isChecked()) { onManualSetup(); return; } String email = mEmailView.getText().toString(); ConnectionSettings connectionSettings = providersXmlDiscovery.discover(email); if (connectionSettings != null) { finishAutoSetup(connectionSettings); } else { onManualSetup(); } }