auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addPages() { newFileCreationPage = new NewFileCreationPage("CPSWizardNewFileCreationPage", selection); newFileCreationPage.setTitle(TITLE); newFileCreationPage.setDescription("Create a new CyberPhysicalSystem model file"); newFileCreationPage.setFileName(DEFAULT_FILENAME + "." + EXTENSION); addPage(newFileCreationPage); <START> if (selection != null && !selection.isEmpty()) { <END> Object selectedElement = selection.iterator().next(); if (selectedElement instanceof IResource) { IResource selectedResource = (IResource) selectedElement; if (selectedResource.getType() == IResource.FILE) { selectedResource = selectedResource.getParent(); } if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); String modelFilename = DEFAULT_FILENAME + "." + EXTENSION; for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { modelFilename = DEFAULT_FILENAME + i + "." + EXTENSION; } newFileCreationPage.setFileName(modelFilename); } } } constraintPage = new ConstraintTypePage(); constraintPage.setTitle(TITLE); addPage(constraintPage); detailsPage = new ConstraintDetailsPage(); detailsPage.setTitle(TITLE); addPage(detailsPage); }</code><technical_language>if selection contains multiple resources (files, folders, projects)? I see, is special handling for case. I suggest, behave generic file wizard handles initial selection</technical_language>

Target:
public void addPages() { newFileCreationPage = new NewFileCreationPage("CPSWizardNewFileCreationPage", selection, EXTENSION); newFileCreationPage.setTitle(TITLE); newFileCreationPage.setDescription("Create a new CyberPhysicalSystem model file"); newFileCreationPage.setFileName(DEFAULT_FILENAME + "." + EXTENSION); addPage(newFileCreationPage); if (selection != null && !selection.isEmpty()) { Object selectedElement = selection.iterator().next(); if (selectedElement instanceof IResource) { IResource selectedResource = (IResource) selectedElement; if (selectedResource.getType() == IResource.FILE) { selectedResource = selectedResource.getParent(); } if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); String modelFilename = DEFAULT_FILENAME + "." + EXTENSION; for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { modelFilename = DEFAULT_FILENAME + i + "." + EXTENSION; } newFileCreationPage.setFileName(modelFilename); } } } constraintPage = new ConstraintTypePage(); constraintPage.setTitle(TITLE); addPage(constraintPage); detailsPage = new ConstraintDetailsPage(); detailsPage.setTitle(TITLE); addPage(detailsPage); }
Source:
<code>public boolean performClick() { if (mPopup != null) { <START> if (!mPopup.isShowing()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { mPopup.show(getTextDirection(), getTextAlignment()); } else { mPopup.show(-1, -1); } } <END> return true; } return super.performClick(); }</code><technical_language>this code is repeated in 2 places, a private showPopup() method this for you</technical_language>

Target:
public boolean performClick() { if (mPopup != null) { if (!mPopup.isShowing()) { showPopup(); } return true; } return super.performClick(); }
Source:
<code>public List<IPersonAttributeDao> scriptedAttributeRepositories() { final List<IPersonAttributeDao> list = new ArrayList<>(); casProperties.getAuthn().getAttributeRepository().getScript() .forEach(Unchecked.consumer(script -> { final String scriptContents = IOUtils.toString(script.getLocation().getInputStream(), StandardCharsets.UTF_8); final String engineName = script.getEngineName() == null ? ScriptEnginePersonAttributeDao.getScriptEngineName(script.getLocation().getFilename()) : script.getEngineName(); <START> if (engineName == null) { <END> LOGGER.warn("Unable to determine script engineName for script: {}", script.getLocation().getFilename()); } final ScriptEnginePersonAttributeDao dao = new ScriptEnginePersonAttributeDao(scriptContents, engineName); dao.setCaseInsensitiveUsername(script.isCaseInsensitive()); dao.setOrder(script.getOrder()); LOGGER.debug("Configured scripted attribute sources from [{}]", script.getLocation()); list.add(dao); })); return list; }</code><technical_language>this check DAO itself, if is already</technical_language>

Target:
public List<IPersonAttributeDao> scriptedAttributeRepositories() { final List<IPersonAttributeDao> list = new ArrayList<>(); casProperties.getAuthn().getAttributeRepository().getScript() .forEach(Unchecked.consumer(script -> { final String scriptContents = IOUtils.toString(script.getLocation().getInputStream(), StandardCharsets.UTF_8); final String engineName = script.getEngineName() == null ? ScriptEnginePersonAttributeDao.getScriptEngineName(script.getLocation().getFilename()) : script.getEngineName(); final ScriptEnginePersonAttributeDao dao = new ScriptEnginePersonAttributeDao(scriptContents, engineName); dao.setCaseInsensitiveUsername(script.isCaseInsensitive()); dao.setOrder(script.getOrder()); LOGGER.debug("Configured scripted attribute sources from [{}]", script.getLocation()); list.add(dao); })); return list; }
Source:
<code>private static List<Type> closeMethodThrownTypes(Type classType) { List<Type> thrownTypes = classType.symbol().lookupSymbols("close").stream() .filter(Symbol::isMethodSymbol) .map(Symbol.MethodSymbol.class::cast) .filter(method -> method.parameterTypes().isEmpty()) .map(Symbol.MethodSymbol::thrownTypes) .findFirst() .orElse(null); <START> if (thrownTypes == null) { <END> thrownTypes = directSuperTypeStream(classType).map(ThrownExceptionVisitor::closeMethodThrownTypes) .filter(Objects::nonNull) .findFirst() .orElse(null); } return thrownTypes; }</code><technical_language>need this intermediary null assignment, put next lines in orElse for results! (eventually extract in a method)</technical_language>

Target:
private static List<Type> closeMethodThrownTypes(Type classType) { return classType.symbol().lookupSymbols("close").stream() .filter(Symbol::isMethodSymbol) .map(Symbol.MethodSymbol.class::cast) .filter(method -> method.parameterTypes().isEmpty()) .map(Symbol.MethodSymbol::thrownTypes) .findFirst() .orElseGet(() -> directSuperTypeStream(classType).map(ThrownExceptionVisitor::closeMethodThrownTypes) .filter(Objects::nonNull) .findFirst() .orElse(null)); }
Source:
<code>public List<QuotaUsageVO> findQuotaUsage(final Long accountId, final Long domainId, final Integer usageType, final Date startDate, final Date endDate) { final short opendb = TransactionLegacy.currentTxn().getDatabaseId(); List<QuotaUsageVO> quotaUsageRecords = new ArrayList<QuotaUsageVO>(); try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB)) { SearchCriteria<QuotaUsageVO> sc = createSearchCriteria(); if (accountId != null) { sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); } if (domainId != null) { sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); } if (usageType != null) { sc.addAnd("usageType", SearchCriteria.Op.EQ, usageType); } if ((startDate != null) && (endDate != null) && startDate.before(endDate)) { sc.addAnd("startDate", SearchCriteria.Op.BETWEEN, startDate, endDate); sc.addAnd("endDate", SearchCriteria.Op.BETWEEN, startDate, endDate); } else { <START> return new ArrayList<QuotaUsageVO>(); <END> } quotaUsageRecords = listBy(sc); } catch (Exception e) { s_logger.error("QuotaUsageDaoImpl::findQuotaUsage() failed due to: " + e.getMessage()); throw new CloudRuntimeException("Unable to find quota usage"); } finally { TransactionLegacy.open(opendb).close(); } return quotaUsageRecords; }</code><technical_language>Collections.emptyList() avoid unnecessary object creation</technical_language>

Target:
public List<QuotaUsageVO> findQuotaUsage(final Long accountId, final Long domainId, final Integer usageType, final Date startDate, final Date endDate) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaUsageVO>>() { @Override public List<QuotaUsageVO> doInTransaction(final TransactionStatus status) { List<QuotaUsageVO> quv; if ((startDate != null) && (endDate != null) && startDate.before(endDate)) { QueryBuilder<QuotaUsageVO> qb = QueryBuilder.create(QuotaUsageVO.class); if (accountId != null) { qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId); } if (domainId != null) { qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId); } if (usageType != null) { qb.and(qb.entity().getUsageType(), SearchCriteria.Op.EQ, usageType); } qb.and(qb.entity().getStartDate(), SearchCriteria.Op.BETWEEN, startDate, endDate); qb.and(qb.entity().getEndDate(), SearchCriteria.Op.BETWEEN, startDate, endDate); quv = listBy(qb.create()); } else { quv = new ArrayList<QuotaUsageVO>(); } if (quv.isEmpty()){ QuotaUsageVO qu = new QuotaUsageVO(); qu.setAccountId(accountId); qu.setDomainId(domainId); qu.setStartDate(startDate); qu.setEndDate(endDate); qu.setQuotaUsed(new BigDecimal(0)); qu.setUsageType(-1); quv.add(qu); } return quv; } }); }
Source:
<code>private boolean startsOrEndsWithWhitespace(String value) { boolean startsOrEndsWithWhitespace = false; int lastIndex = value.length() - 1; if (value.charAt(0) == ' ') { startsOrEndsWithWhitespace = true; <START> } else if (Character.isWhitespace(value.charAt(lastIndex))) { <END> startsOrEndsWithWhitespace = true; } return startsOrEndsWithWhitespace; }</code><technical_language>this contains file separator, is this want? if <LINK_0></technical_language>

Target:
private boolean startsOrEndsWithWhitespace(String value) { return (StringUtils.isNotBlank(value) && (Character.isSpaceChar(value.charAt(0)) || Character.isSpaceChar(value.charAt(value.length() -1)))); }
Source:
<code>private Pair<List<File>, List<File>> createFilesAndDirsAtPath(File dir, int fileCount, int dirCount) throws IOException { List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < fileCount; i++) { File createdFile = new File(dir, "created-file-" + i); if (!createdFile.exists()) { assertTrue("Could not create " + createdFile, createdFile.createNewFile()); } createdFile.deleteOnExit(); createdFiles.add(createdFile); } List<File> createdDirs = new ArrayList<>(); for (int i = 0; i < dirCount; i++) { File createdDir = new File(dir, "created-dir-" + i); <START> assertTrue(createdDir + " exists and is not a directory", !createdDir.exists() || createdDir.isDirectory()); <END> if (!createdDir.exists()) { assertTrue("Could not create " + createdDir, createdDir.mkdir()); } createdDir.deleteOnExit(); createdDirs.add(createdDir); } return new Pair<>(createdFiles, createdDirs); }</code><technical_language>Correct if I wrong. If createdDir exists isDirectory, pass this check. createdDir added createdDirs twice</technical_language>

Target:
private Pair<List<File>, List<File>> createFilesAndDirsAtPath(File dir, int fileCount, int dirCount) throws IOException { List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < fileCount; i++) { File createdFile = new File(dir, "created-file-" + i); if (!createdFile.exists()) { assertTrue("Could not create " + createdFile, createdFile.createNewFile()); } createdFile.deleteOnExit(); createdFiles.add(createdFile); } List<File> createdDirs = new ArrayList<>(); for (int i = 0; i < dirCount; i++) { File createdDir = new File(dir, "created-dir-" + i); assertTrue("Could not create " + createdDir + " now", createdDir.mkdir()); createdDir.deleteOnExit(); createdDirs.add(createdDir); } return new Pair<>(createdFiles, createdDirs); }
Source:
<code>private List<SubscriptionEventTypeStats> createSubscriptionStat(final Subscription subscription) throws ServiceUnavailableException { final String subscriptionId = subscription.getId(); final ZkSubscriptionClient zkSubscriptionClient = zkSubscriptionClientFactory.createZkSubscriptionClient(subscriptionId); <START> final ZkSubscriptionNode zkSubscriptionNode = zkSubscriptionClient.getZkSubscriptionNode(); <END> final boolean hasSessions = zkSubscriptionNode.getSessions().length > 0; final List<EventType> eventTypes = subscription.getEventTypes().stream() .map(Try.wrap(eventTypeRepository::findByName)) .map(Try::getOrThrow) .collect(Collectors.toList()); final Set<String> topics = eventTypes.stream() .map(EventType::getTopic) .collect(Collectors.toSet()); final List<TopicPartition> topicPartitions = topicRepository.listPartitions(topics); return eventTypes.stream() .map(eventType -> { final Set<SubscriptionEventTypeStats.Partition> statPartitions = Arrays.stream(zkSubscriptionNode.getPartitions()) .sorted((p1, p2) -> p1.getKey().getPartition().compareTo(p2.getKey().getPartition())) .filter(partition -> eventType.getTopic().equals(partition.getKey().getTopic())) .flatMap(partition -> filterTopicPartitions(zkSubscriptionClient, topicPartitions, partition, hasSessions)) .collect(Collectors.toSet()); return new SubscriptionEventTypeStats(eventType.getName(), statPartitions); }) .collect(Collectors.toList()); }</code><technical_language>Dmitry lock requesting data subscription</technical_language>

Target:
private List<SubscriptionEventTypeStats> createSubscriptionStat(final Subscription subscription) throws ServiceUnavailableException { final ZkSubscriptionClient zkSubscriptionClient = zkSubscriptionClientFactory.createZkSubscriptionClient(subscription.getId()); final ZkSubscriptionNode zkSubscriptionNode = zkSubscriptionClient.getZkSubscriptionNodeLocked(); final List<EventType> eventTypes = subscription.getEventTypes().stream() .map(Try.wrap(eventTypeRepository::findByName)) .map(Try::getOrThrow) .collect(Collectors.toList()); final Set<String> topics = eventTypes.stream() .map(EventType::getTopic) .collect(Collectors.toSet()); final List<TopicPartition> topicPartitions = topicRepository.listPartitions(topics); return eventTypes.stream() .map(eventType -> { final Set<SubscriptionEventTypeStats.Partition> statPartitions = topicPartitions.stream() .filter(partition -> eventType.getTopic().equals(partition.getTopicId())) .map(Try.wrap(partition -> mergePartitions(zkSubscriptionClient, zkSubscriptionNode, partition))) .map(Try::getOrThrow) .collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingInt(p -> Integer.valueOf(p.getPartition())))) ); return new SubscriptionEventTypeStats(eventType.getName(), statPartitions); }) .collect(Collectors.toList()); }
Source:
<code>public IFolder getFolder(IReferencePoint referencePoint, IPath referencePointRelativePath) { if (referencePoint == null) throw new IllegalArgumentException("Reference point is null"); if (referencePointRelativePath == null) throw new IllegalArgumentException("Path is null"); org.eclipse.core.resources.IProject project = getProject(referencePoint); if (project == null) <START> throw new IllegalArgumentException( <END> "For reference point " + referencePoint + " does'nt exist a project."); return project.getFolder(referencePointRelativePath); }</code><technical_language>typo:</technical_language>

Target:
public IFolder getFolder(IReferencePoint referencePoint, IPath referencePointRelativePath) { checkArgument(referencePoint, "Reference point is null"); checkArgument(referencePointRelativePath, "ReferencePointsRelativePath is null"); IProject project = Objects.requireNonNull(getProject(referencePoint)); return project.getFolder(referencePointRelativePath); }
Source:
<code><START> public <T extends ActionRequest> void validate(T request) throws FoxtrotException { <END> Set<String> validationErrors = request.validate(); if (!CollectionUtils.isSetNullOrEmpty(validationErrors)) { throw FoxtrotExceptions.createMalformedQueryException(request, new ArrayList<>(validationErrors)); } }</code><technical_language>Hmmm .. this is there, create abstract validateImpl(request) method, consolidated in action, model class</technical_language>

Target:
public <T extends ActionRequest> void validate(T request) throws FoxtrotException { resolve(request).validateImpl(); }
Source:
<code>public void updateInferredMethodParameterTypes( MethodInvocationNode methodInvNode, Tree receiverTree, ExecutableElement methodElt, AnnotatedTypeFactory atf) { if (receiverTree == null) { return; } <START> final MethodTree methodDefinitionTree = (MethodTree) atf.declarationFromElement(methodElt); <END> final ClassSymbol classSymbol; if (methodDefinitionTree != null) { classSymbol = getEnclosingClassSymbol(methodDefinitionTree); } else { classSymbol = getEnclosingClassSymbol(receiverTree); } if (classSymbol == null) { return; } String className = classSymbol.flatname.toString(); String jaifPath = helper.getJaifPath(className); AClass clazz = helper.getAClass(className, jaifPath); String methodName = JVMNames.getJVMMethodName(methodElt); AMethod method = clazz.methods.getVivify(methodName); List<Node> arguments = methodInvNode.getArguments(); updateInferredExecutableParameterTypes(methodElt, atf, jaifPath, method, arguments); }</code><technical_language>declarationFromElement returns a tree if methodElt declared in current complication unit. ElementUtils.enclosingClass(methodElt); ((MethodSymbol) methodElt).enclClass() intstead</technical_language>

Target:
public void updateInferredMethodParameterTypes( MethodInvocationNode methodInvNode, Tree receiverTree, ExecutableElement methodElt, AnnotatedTypeFactory atf) { if (ElementUtils.isElementFromByteCode(methodElt)) { return; } String className = getEnclosingClassName(methodElt); String jaifPath = helper.getJaifPath(className); AClass clazz = helper.getAClass(className, jaifPath); String methodName = JVMNames.getJVMMethodName(methodElt); AMethod method = clazz.methods.getVivify(methodName); List<Node> arguments = methodInvNode.getArguments(); updateInferredExecutableParameterTypes(methodElt, atf, jaifPath, method, arguments); }
Source:
<code>public void removeProviderLoaderTest() throws Exception { String providerLoaderName = randomAlphanumeric(5); Address providerLoaderAddress = elyOps.getElytronAddress(PROVIDER_LOADER, providerLoaderName); <START> page.navigateToApplication().selectResource(PROVIDER_LOADER_LABEL); <END> try { ops.add(providerLoaderAddress); page.navigateToApplication().selectResource(PROVIDER_LOADER_LABEL).getResourceManager() .removeResource(providerLoaderName).confirmAndDismissReloadRequiredMessage().assertClosed(); assertFalse("Removed resource should not be present in the table any more!", page.resourceIsPresentInMainTable(providerLoaderName)); new ResourceVerifier(providerLoaderAddress, client).verifyDoesNotExist(); } finally { ops.removeIfExists(providerLoaderAddress); adminOps.reloadIfRequired(); } }</code><technical_language>Navigation is performed I missing something</technical_language>

Target:
public void removeProviderLoaderTest() throws Exception { String providerLoaderName = randomAlphanumeric(5); Address providerLoaderAddress = elyOps.getElytronAddress(PROVIDER_LOADER, providerLoaderName); try { ops.add(providerLoaderAddress).assertSuccess(); page.navigateToApplication().selectResource(PROVIDER_LOADER_LABEL).getResourceManager() .removeResource(providerLoaderName).confirmAndDismissReloadRequiredMessage().assertClosed(); assertFalse("Removed resource should not be present in the table any more!", page.resourceIsPresentInMainTable(providerLoaderName)); new ResourceVerifier(providerLoaderAddress, client).verifyDoesNotExist(); } finally { ops.removeIfExists(providerLoaderAddress); adminOps.reloadIfRequired(); } }
Source:
<code>public void deleteObservation_ShouldDeleteObservation() { mDatabase.observationRoomDAO().saveObervation(expectedObservationEntity); mDatabase.observationRoomDAO().deleteObservation(expectedObservationEntity); mDatabase.observationRoomDAO().getObservationByUUID("uuid").subscribe(new Subscriber<ObservationEntity>() { @Override public void onSubscribe(Subscription s) { } @Override public void onNext(ObservationEntity observationEntity) { <START> Assert.assertEquals(observationEntity, null); <END> } @Override public void onError(Throwable t) { } @Override public void onComplete() { } }); }</code><technical_language>simplified, assertNull instead</technical_language>

Target:
public void deleteObservation_ShouldDeleteObservation() { mDatabase.observationRoomDAO().saveObservation(expectedObservationEntity); mDatabase.observationRoomDAO().deleteObservation(expectedObservationEntity); mDatabase.observationRoomDAO().getObservationByUUID("uuid").subscribe(new Subscriber<ObservationEntity>() { @Override public void onSubscribe(Subscription s) { } @Override public void onNext(ObservationEntity observationEntity) { Assert.assertNull(observationEntity); } @Override public void onError(Throwable t) { } @Override public void onComplete() { } }); }
Source:
<code>public boolean hasPermission(User user, long id) { boolean hasPermission = hasRole(user, ADMIN_ROLE_ID); if (!hasPermission && user != null && user.permissions != null) { for (Permission permission : user.permissions) { if (permission.id != null && permission.id.longValue() == id) { hasPermission = true; break; } } } if (!hasPermission && user != null && user.roles != null) { for (Role role : user.roles) { <START> if (role.permissions != null) { <END> for (Permission permission : role.permissions) { if (permission.id != null && permission.id.longValue() == id) { hasPermission = true; break; } } } } } return hasPermission; }</code><technical_language>This is loop please put loops in a single method searches a collection of permissions for id (Can a private method in of helper classes)</technical_language>

Target:
public boolean hasPermission(User user, long id) { boolean hasPermission = hasRole(user, ADMIN_ROLE_ID); if (!hasPermission && user != null) { if (user.roles != null) { for (Role role : user.roles) { if (!hasPermission && role.permissions != null) { hasPermission = hasIdPermission(role.permissions, id); if (hasPermission) { break; } } } } if (!hasPermission && user.permissions != null) { hasPermission = hasIdPermission(user.permissions, id); } } return hasPermission; }
Source:
<code>public boolean isExpandable(Object elementOrTreePath) { Object element; TreePath path; if (elementOrTreePath instanceof TreePath) { path = (TreePath) elementOrTreePath; element = path.getLastSegment(); } else { element = elementOrTreePath; <START> path = null; <END> } IContentProvider cp = getContentProvider(); if (cp instanceof ITreeContentProvider) { ITreeContentProvider tcp = (ITreeContentProvider) cp; return tcp.hasChildren(element); } return false; }</code><technical_language>is point of setting path null here. is needed in if statement</technical_language>

Target:
public boolean isExpandable(Object elementOrTreePath) { Object element; TreePath path = null; if (elementOrTreePath instanceof TreePath) { path = (TreePath) elementOrTreePath; element = path.getLastSegment(); } else { element = elementOrTreePath; } IContentProvider cp = getContentProvider(); if (cp instanceof ITreeContentProvider) { ITreeContentProvider tcp = (ITreeContentProvider) cp; return tcp.hasChildren(element); } return false; }
Source:
<code>private void sendSource(String host, String source) { String url = "http://" + host + "/1/sources/current"; StringBuilder content = new StringBuilder(); <START> content.append("{\"id\":\"" + source + "\"}"); <END> logger.debug("Switching source of host " + host + " to " + source); logger.trace(content.toString()); HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content.toString()), CONTENT_TYPE_JSON, 1000); }</code><technical_language>please a "normal" String instead of StringBuilder in this case</technical_language>

Target:
private void sendSource(String host, String source) { String url = "http://" + host + "/1/sources/current"; String content = "{\"id\":\"" + source + "\"}"; logger.debug("Switching source of host to {}", host, source); logger.trace(content.toString()); HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content), CONTENT_TYPE_JSON, 1000); }
Source:
<code>private void showNetworkError(String statusCode) { TextView errorMessage = (TextView) networkError.findViewById(R.id.page_error_message); TextView statusCodeView = (TextView) networkError.findViewById(R.id.network_status_code); TextView statusMessageView = (TextView) networkError.findViewById(R.id.network_status_message); if (!NetworkUtils.isNetworkConnectionPresent(app)) { statusCodeView.setVisibility(View.GONE); statusMessageView.setVisibility(View.GONE); errorMessage.setText(R.string.error_network_error_try_again); } else { errorMessage.setText(R.string.generic_page_error); statusCodeView.setVisibility(View.VISIBLE); statusMessageView.setVisibility(View.VISIBLE); List<String> allStatusCodes = new ArrayList<>(); allStatusCodes.addAll(Arrays.asList(app.getResources().getStringArray(R.array.status_codes))); if (statusCode != null && allStatusCodes.contains(statusCode)) { statusCodeView.setText(statusCode); List<String> allStatusMessages = new ArrayList<>(); allStatusMessages.addAll(Arrays.asList(app.getResources().getStringArray(R.array.status_messages))); statusMessageView.setText(allStatusMessages.get(allStatusCodes.indexOf(statusCode))); } else { <START> statusMessageView.setText("Server status code unavailable"); <END> } } hidePageContent(); ViewAnimations.fadeIn(networkError); }</code><technical_language>User-visible strings need in string resources, translated</technical_language>

Target:
private void showNetworkError(String statusCode) { TextView errorMessage = (TextView) networkError.findViewById(R.id.page_error_message); TextView statusCodeView = (TextView) networkError.findViewById(R.id.network_status_code); TextView statusMessageView = (TextView) networkError.findViewById(R.id.network_status_message); if (!NetworkUtils.isNetworkConnectionPresent(app)) { statusCodeView.setVisibility(View.GONE); statusMessageView.setVisibility(View.GONE); errorMessage.setText(R.string.error_network_error_try_again); } else { errorMessage.setText(R.string.generic_page_error); statusCodeView.setVisibility(View.VISIBLE); statusMessageView.setVisibility(View.VISIBLE); List<String> allStatusCodes = new ArrayList<>(); allStatusCodes.addAll(Arrays.asList(app.getResources().getStringArray(R.array.status_codes))); if (statusCode != null && allStatusCodes.contains(statusCode)) { statusCodeView.setText(statusCode); List<String> allStatusMessages = new ArrayList<>(); allStatusMessages.addAll(Arrays.asList(app.getResources().getStringArray(R.array.status_messages))); statusMessageView.setText(allStatusMessages.get(allStatusCodes.indexOf(statusCode))); } else { statusMessageView.setText(R.string.status_code_unavailable); } } hidePageContent(); ViewAnimations.fadeIn(networkError); }
Source:
<code>public void testSaveAirline() { Iterable<Airline> itr = airlineRepository.save(Arrays.asList(a)); <START> Assert.assertThat(itr, Matchers.notNullValue()); <END> Airline airline = airlineRepository.findOne(a.getId()); Assert.assertThat(airline, Matchers.notNullValue()); Assert.assertThat(airline, Matchers.is(a)); Assert.assertThat(airline, Matchers.not(b)); airlineRepository.delete(a.getId()); }</code><technical_language>Please AssertJ assertions static import a * static methods need qualified. other projects for example</technical_language>

Target:
public void testSaveAirline() { Iterable<Airline> itr = airlineRepository.save(Arrays.asList(a)); assertThat(itr).isNotNull(); Airline airline = airlineRepository.findOne(a.getId()); assertThat(airline).isNotNull(); assertThat(airline).isEqualTo(a); assertThat(airline).isNotEqualTo(b); airlineRepository.delete(a.getId()); }
Source:
<code>public MotorIdle(Motor motor) { super("motorIdle", motor); <END> <START> this.motor = motor; LogKitten.d("MotorIdle created"); }</code><technical_language>name requirements stuff</technical_language>

Target:
public MotorIdle(Motor motor) { this("MotorIdle", motor); }
Source:
<code>private Set<TreeReference> runAndTest(EvaluationContext context, String text, String... matches) { XPathExpression expression; try { expression = XPathParseTool.parseXPath(text); } catch(XPathSyntaxException e) { throw new RuntimeException(e); } TreeReferenceAccumulatingAnalyzer analyzer; if (context == null) { analyzer = new TreeReferenceAccumulatingAnalyzer(); } else { analyzer = new TreeReferenceAccumulatingAnalyzer(context); } Set<TreeReference> results = analyzer.accumulate(expression); if (results == null) { <START> return null; <END> } Set<TreeReference> expressions = new HashSet<>(); for (String match : matches) { expressions.add(XPathReference.getPathExpr(match).getReference()); } Assert.assertEquals(text, expressions, results); return results; }</code><technical_language>this return null? If is in matches, test fail this point</technical_language>

Target:
private void runAndTest(EvaluationContext context, String text, String... matches) throws AnalysisInvalidException { XPathExpression expression; try { expression = XPathParseTool.parseXPath(text); } catch(XPathSyntaxException e) { throw new RuntimeException(e); } TreeReferenceAccumulatingAnalyzer analyzer; if (context == null) { analyzer = new TreeReferenceAccumulatingAnalyzer(); } else { analyzer = new TreeReferenceAccumulatingAnalyzer(context); } Set<TreeReference> results = analyzer.accumulate(expression); if (results == null) { throw new AnalysisInvalidException(String.format("Couldn't analyze expression: %s",text)); } Set<TreeReference> expressions = new HashSet<>(); for (String match : matches) { expressions.add(XPathReference.getPathExpr(match).getReference()); } Assert.assertEquals(text, expressions, results); }
Source:
<code>public PlanNode visitTableScan(TableScanNode node, RewriteContext<Void> context) { PartitioningHandle partitioning = metadata.getLayout(session, node.getTable()) .getTablePartitioning() .map(TablePartitioning::getPartitioningHandle) .orElse(SOURCE_DISTRIBUTION); if (partitioning.equals(fragmentPartitioningHandle)) { return node; } TableHandle newTableHandle = metadata.getAlternativeTableHandle(session, node.getTable(), fragmentPartitioningHandle); return new TableScanNode( node.getId(), newTableHandle, node.getOutputSymbols(), node.getAssignments(), <START> Optional.empty(), <END> node.getCurrentConstraint(), node.getEnforcedConstraint(), node.isTemporaryTable()); }</code><technical_language>in theory this newTableHandle.getLayout . if decided squash commits matter.</technical_language>

Target:
public PlanNode visitTableScan(TableScanNode node, RewriteContext<Void> context) { PartitioningHandle partitioning = metadata.getLayout(session, node.getTable()) .getTablePartitioning() .map(TablePartitioning::getPartitioningHandle) .orElse(SOURCE_DISTRIBUTION); if (partitioning.equals(fragmentPartitioningHandle)) { return node; } TableHandle newTableHandle = metadata.getAlternativeTableHandle(session, node.getTable(), fragmentPartitioningHandle); return new TableScanNode( node.getId(), newTableHandle, node.getOutputSymbols(), node.getAssignments(), node.getCurrentConstraint(), node.getEnforcedConstraint(), node.isTemporaryTable()); }
Source:
<code>public Iterable<VirtualMachine> listNodesByIds(Iterable<String> ids) { <START> return null; <END> }</code><technical_language>This implemented</technical_language>

Target:
public Iterable<VirtualMachine> listNodesByIds(Iterable<String> ids) { Iterable<VirtualMachine> vms = ImmutableSet.of(); try (VSphereServiceInstance instance = serviceInstance.get();) { Folder nodesFolder = instance.getInstance().getRootFolder(); List<List<String>> list = new ArrayList<List<String>>(); Iterator<String> idsIterator = ids.iterator(); while (idsIterator.hasNext()) { list.add(Lists.newArrayList("VirtualMachine", idsIterator.next())); } String[][] typeInfo = ListsUtils.ListToArray(list); ManagedEntity[] managedEntities = new InventoryNavigator(nodesFolder).searchManagedEntities( typeInfo, true); vms = Iterables.transform(Arrays.asList(managedEntities), new Function<ManagedEntity, VirtualMachine>() { public VirtualMachine apply(ManagedEntity input) { return (VirtualMachine) input; } }); } catch (Throwable e) { logger.error("Can't find vms ", e); } return vms; }
Source:
<code>private void buildFontList(String preferredFont, AssetManager assets) { fonts.clear(); fonts.put("default", Typeface.defaultFromStyle(Typeface.NORMAL)); String[] files = null; try { files = assets.list(FONT_PATH); } catch (IOException | RuntimeException e) { e.printStackTrace(); } if (files == null) { <START> Timber.e("Couldn't load fonts from files?"); <END> return; } for (String file : files) { String fileName = String.format("%s/%s", FONT_PATH, file); fonts.put(fileName, Typeface.createFromAsset(assets, fileName)); Timber.i("Processed Font: %s", fileName); } setCurrentFont(preferredFont); }</code><technical_language>log level, set this w? change message "couldn't list assets font path" ambiguous, failing load fonts if get me</technical_language>

Target:
public void buildFontList(String preferredFont, AssetManager assets) { fonts.clear(); fonts.put("default", Typeface.defaultFromStyle(Typeface.NORMAL)); String[] files = null; try { files = assets.list(FONT_PATH); } catch (IOException | RuntimeException e) { e.printStackTrace(); } if (files == null) { Timber.w("Couldn't load font assets from %s", FONT_PATH); return; } for (String file : files) { String fileName = String.format("%s/%s", FONT_PATH, file); fonts.put(fileName, Typeface.createFromAsset(assets, fileName)); Timber.i("Processed Font: %s", fileName); } setCurrentFont(preferredFont); }
Source:
<code>private void addWarnings(Pool pool, ModelMap model) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); Set<String> duplicates = pool.getDuplicateIndicesSequences(); Set<String> nearDuplicates = pool.getNearDuplicateIndicesSequences(); model.put("duplicateIndicesSequences", mapper.writeValueAsString(duplicates)); model.put("nearDuplicateIndicesSequences", mapper.writeValueAsString(nearDuplicates)); List<String> warnings = new ArrayList<>(); if (!duplicates.isEmpty()) { warnings.add("This pool contains duplicate indices!"); } else if (!nearDuplicates.isEmpty()) { warnings.add("This pool contains near-duplicate indices!"); } if (pool.hasViewWithoutIndex()) { <START> warnings.add("This pool contains a dilution with no index!"); <END> } addConsentWarning(pool, warnings); model.addAttribute("warnings", warnings); }</code><technical_language>index is library, this library, dilution</technical_language>

Target:
private void addWarnings(Pool pool, ModelMap model) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); Set<String> duplicates = pool.getDuplicateIndicesSequences(); Set<String> nearDuplicates = pool.getNearDuplicateIndicesSequences(); model.put("duplicateIndicesSequences", mapper.writeValueAsString(duplicates)); model.put("nearDuplicateIndicesSequences", mapper.writeValueAsString(nearDuplicates)); List<String> warnings = new ArrayList<>(); if (!duplicates.isEmpty()) { warnings.add("This pool contains duplicate indices!"); } else if (!nearDuplicates.isEmpty()) { warnings.add("This pool contains near-duplicate indices!"); } if (pool.hasLibrariesWithoutIndex()) { warnings.add("This pool contains multiple libraries with no index!"); } addConsentWarning(pool, warnings); model.addAttribute("warnings", warnings); }
Source:
<code>private void triggerMatchingPipelines(T event) { try { List<Pipeline> matchingPipelines = eventHandler.getMatchingPipelines(event, pipelineCache); matchingPipelines.stream() <START> .filter(p -> p.getErrorMessage() == null) <END> .map(pipelinePostProcessorHandler::process) .forEach( p -> { recordMatchingPipeline(p); pipelineInitiator.startPipeline(p, PipelineInitiator.TriggerSource.EVENT); }); matchingPipelines.stream() .filter(p -> p.getErrorMessage() != null) .forEach(pipelineInitiator::recordPipelineFailure); } catch (TimeoutException e) { log.error("Failed to get pipeline configs", e); } }</code><technical_language>thoughts allow empty string this filter? (And exclude filter below?)</technical_language>

Target:
private void triggerMatchingPipelines(T event) { try { List<Pipeline> matchingPipelines = eventHandler.getMatchingPipelines(event, pipelineCache); matchingPipelines.stream() .filter(p -> Strings.isNullOrEmpty(p.getErrorMessage())) .map(pipelinePostProcessorHandler::process) .forEach( p -> { recordMatchingPipeline(p); pipelineInitiator.startPipeline(p, PipelineInitiator.TriggerSource.EVENT); }); matchingPipelines.stream() .filter(p -> !Strings.isNullOrEmpty(p.getErrorMessage())) .forEach(pipelineInitiator::recordPipelineFailure); } catch (TimeoutException e) { log.error("Failed to get pipeline configs", e); } }
Source:
<code>public void performDurablePublishRestartServerTestCase() throws Exception { AndesJMSConsumerClientConfiguration consumerConfig = new AndesJMSConsumerClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); consumerConfig.setDurable(true, "restartServerSub"); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); publisherConfig.setPrintsPerMessageCount(SEND_COUNT / 10L); publisherConfig.setNumberOfMessagesToSend(SEND_COUNT); AndesClient initialConsumerClient = new AndesClient(consumerConfig, true); initialConsumerClient.startClient(); AndesClientUtils.sleepForInterval(5000L); initialConsumerClient.stopClient(); AndesClientUtils.sleepForInterval(5000L); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils.sleepForInterval(5000L); super.restartServer(); <START> AndesClientUtils.sleepForInterval(20L * 1000L); <END> AndesClient secondaryConsumerClient = new AndesClient(consumerConfig, true); secondaryConsumerClient.startClient(); AndesClientUtils .waitForMessagesAndShutdown(secondaryConsumerClient, AndesClientConstants.DEFAULT_RUN_TIME); Assert.assertEquals(publisherClient .getSentMessageCount(), SEND_COUNT, "Message sending failed."); Assert.assertEquals(secondaryConsumerClient .getReceivedMessageCount(), EXPECTED_COUNT, "Message receiving failed for client 1."); }</code><technical_language>need this sleep test framework waits server restarts restartServer() is called</technical_language>

Target:
public void performDurablePublishRestartServerTestCase() throws Exception { AndesJMSConsumerClientConfiguration consumerConfig = new AndesJMSConsumerClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); consumerConfig.setDurable(true, "restartServerSub"); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); publisherConfig.setPrintsPerMessageCount(SEND_COUNT / 10L); publisherConfig.setNumberOfMessagesToSend(SEND_COUNT); AndesClient initialConsumerClient = new AndesClient(consumerConfig, true); initialConsumerClient.startClient(); AndesClientUtils.sleepForInterval(5000L); initialConsumerClient.stopClient(); AndesClientUtils.sleepForInterval(5000L); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils.sleepForInterval(5000L); super.restartServer(); AndesClient secondaryConsumerClient = new AndesClient(consumerConfig, true); secondaryConsumerClient.startClient(); AndesClientUtils .waitForMessagesAndShutdown(secondaryConsumerClient, AndesClientConstants.DEFAULT_RUN_TIME); Assert.assertEquals(publisherClient .getSentMessageCount(), SEND_COUNT, "Message sending failed."); Assert.assertEquals(secondaryConsumerClient .getReceivedMessageCount(), EXPECTED_COUNT, "Message receiving failed for client 1."); }
Source:
<code>public Object[][] webAppEntities() { Object[][] dataProviderResult; <START> Reflections reflections = new Reflections("org.apache.brooklyn.entity.webapp"); <END> Set<Class<? extends JavaWebAppSoftwareProcess>> reflectionsSubTypesOfJavaWebAppSoftwareProcess = reflections.getSubTypesOf(org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess.class); List<Object[]> webAppEntities = getEntitiesFromClasses(reflectionsSubTypesOfJavaWebAppSoftwareProcess); dataProviderResult = new Object[webAppEntities.size()][]; webAppEntities.toArray(dataProviderResult); return dataProviderResult; }</code><technical_language>This getEntitiesFromClasses is cute (much!) clearer return a reference classes explicitly. i.e. new Object[][]{TomcatServer.class}, {Jboss7Server.class}, ...}</technical_language>

Target:
public Object[][] webAppEntities() { Object[][] dataProviderResult = new Object[][] { {EntitySpec.create(JBoss6Server.class)}, {EntitySpec.create(JBoss7Server.class)}, {EntitySpec.create(Jetty6Server.class)}, {EntitySpec.create(TomcatServer.class)}, {EntitySpec.create(Tomcat8Server.class)} }; return dataProviderResult; }
Source:
<code>protected void reestablishConnectionIfNeeded() { if (getVds().getProtocol() == VdsProtocol.XML && FeatureSupported.jsonProtocol(getVds().getVdsGroupCompatibilityVersion()) <START> && getVds().getHostOs() != null) { <END> getVds().setProtocol(VdsProtocol.STOMP); getVdsStaticDao().save(getVds().getStaticData()); initializeVds(); } }</code><technical_language>hostOs is host active before</technical_language>

Target:
protected void reestablishConnectionIfNeeded() { if (getVds().getProtocol() == VdsProtocol.XML && FeatureSupported.jsonProtocol(getVds().getVdsGroupCompatibilityVersion()) && getVds().getHostOs() != null) { getVds().setProtocol(VdsProtocol.STOMP); getVdsStaticDao().save(getVds().getStaticData()); resourceManager.reestablishConnection(getVdsId()); } }
Source:
<code>public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RemoveImageCommand<RemoveImageParameters> cmd = CommandCoordinatorUtil.retrieveCommand(cmdId); if (asyncRetVal == null) { DiskImage diskImage = cmd.getDiskImage(); Guid storagePoolId = diskImage.getStoragePoolId() != null ? diskImage.getStoragePoolId() : Guid.Empty; Guid storageDomainId = (cmd.getParameters().getStorageDomainId() == null || <START> Guid.Empty.equals(cmd.getParameters().getStorageDomainId())) && <END> cmd.getDiskImage() != null ? diskImage.getStorageIds().get(0) : cmd.getParameters().getStorageDomainId(); asyncRetVal = ResourceManager.getInstance().runAsyncVdsCommand(VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage.getId(), diskImage.getImageId())); } if (asyncRetVal != null && asyncRetVal.isRequestCompleted()) { Object retVal = asyncRetVal.getReturnValue(); if (retVal == null) { cmd.setCommandStatus(asyncRetVal.getSucceeded() ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); } else { asyncRetVal = null; } } }</code><technical_language>condition simplified using: Guid.isNullOrEmpty(cmd.getParameters().getStorageDomainId())</technical_language>

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RemoveImageCommand<RemoveImageParameters> cmd = CommandCoordinatorUtil.retrieveCommand(cmdId); if (asyncRetVal == null) { DiskImage diskImage = cmd.getDiskImage(); Guid storagePoolId = diskImage.getStoragePoolId() != null ? diskImage.getStoragePoolId() : Guid.Empty; Guid storageDomainId = Guid.isNullOrEmpty(cmd.getParameters().getStorageDomainId()) && cmd.getDiskImage() != null ? diskImage.getStorageIds().get(0) : cmd.getParameters().getStorageDomainId(); asyncRetVal = ResourceManager.getInstance().runAsyncVdsCommand(VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage.getId(), diskImage.getImageId())); } if (asyncRetVal != null && asyncRetVal.isRequestCompleted()) { if (!asyncRetVal.getSucceeded()) { cmd.setCommandStatus(CommandStatus.SUCCEEDED); } else { asyncRetVal = null; } } }
Source:
<code>public MimeTypeEmail getMimeTypeEmail() throws MessagingException { MimeTypeEmailBuilder builder = new MimeTypeEmailBuilder(); String subject = String.format(CONSENT_EMAIL_SUBJECT, getStudy().getName()); builder.withSubject(subject); final String sendFromEmail = getFormattedSenderEmail(); builder.withSender(sendFromEmail); if (getStudy().getConsentNotificationEmail() != null) { Set<String> emailAddresses = BridgeUtils.commaListToOrderedSet(getStudy().getConsentNotificationEmail()); builder.withRecipients(emailAddresses); <START> } <END> String content = String.format("<p>User %s withdrew from the study on %s. </p>", getUserLabel(), FORMATTER.print(withdrewOn)); content += "<p>Reason:</p>"; if (StringUtils.isBlank(withdrawal.getReason())) { content += "<p><i>No reason given.</i></p>"; } else { content += "<p>" + nullSafeCleanHtml(withdrawal.getReason()) + "</p>"; } final MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setText(content, StandardCharsets.UTF_8.name(), SUB_TYPE_HTML); builder.withMessageParts(bodyPart); return builder.build(); }</code><technical_language>If is consent notification email, recipients for this email. in this case? unit test for this change</technical_language>

Target:
public MimeTypeEmail getMimeTypeEmail() throws MessagingException { MimeTypeEmailBuilder builder = new MimeTypeEmailBuilder(); String subject = String.format(CONSENT_EMAIL_SUBJECT, getStudy().getName()); builder.withSubject(subject); final String sendFromEmail = getFormattedSenderEmail(); builder.withSender(sendFromEmail); builder.withRecipients(recipients); String content = String.format("<p>User %s withdrew from the study on %s. </p>", getUserLabel(), FORMATTER.print(withdrewOn)); content += "<p>Reason:</p>"; if (StringUtils.isBlank(withdrawal.getReason())) { content += "<p><i>No reason given.</i></p>"; } else { content += "<p>" + nullSafeCleanHtml(withdrawal.getReason()) + "</p>"; } final MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setText(content, StandardCharsets.UTF_8.name(), SUB_TYPE_HTML); builder.withMessageParts(bodyPart); return builder.build(); }
Source:
<code>public void shouldRestoreNotifications() { NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, getBaseNotifBundle(), null); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; Intent intent = Shadows.shadowOf(blankActivity).getNextStartedService(); assertEquals(RestoreJobService.class.getName(), intent.getComponent().getClassName()); <START> advanceSystemTimeBy(time, 604_801); <END> NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; assertNull(Shadows.shadowOf(blankActivity).getNextStartedService()); }</code><technical_language>Instead of passing advanceSystemTimeBy call a method of time? **Example:** time.advanceSystemTimeBy(604_801)</technical_language>

Target:
public void shouldRestoreNotifications() { NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, getBaseNotifBundle(), null); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; Intent intent = Shadows.shadowOf(blankActivity).getNextStartedService(); assertEquals(RestoreJobService.class.getName(), intent.getComponent().getClassName()); time.advanceSystemTimeBy(604_801); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; assertNull(Shadows.shadowOf(blankActivity).getNextStartedService()); }
Source:
<code>default <R> Task<R> flatMap(final String desc, final Function1<? super T, Task<R>> func) { ArgumentUtil.requireNotNull(func, "function"); final Task<Task<R>> nested = map("map: " + desc, func); nested.getShallowTraceBuilder().setSystemHidden(true); <START> nested.getShallowTraceBuilder().setTaskType("nestedTask"); <END> return flatten(desc, nested); }</code><technical_language>I drop redundant "Task" suffix task types e.g.: "nestedTask" -> "nested" "withSideEffectTask" -> "withSideEffect" "timeoutTask" -> "timeout" "withTimeoutTask" -> "withTimeout"</technical_language>

Target:
default <R> Task<R> flatMap(final String desc, final Function1<? super T, Task<R>> func) { ArgumentUtil.requireNotNull(func, "function"); final Task<Task<R>> nested = map("map: " + desc, func); nested.getShallowTraceBuilder().setSystemHidden(true); return flatten(desc, nested); }
Source:
<code><START> public boolean waitInvisibility(WebElement webElement) { <END> return waitInvisibility(webElement, DEFAULT_TIMEOUT); }</code><technical_language>returning boolean type is useless return **true**, throw timeout exception</technical_language>

Target:
public void waitInvisibility(WebElement webElement) { waitInvisibility(webElement, DEFAULT_TIMEOUT); }